public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: YunQiang Su <syq@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-5524] libsanitizer/mips: always build with largefile support
Date: Tue, 31 Jan 2023 02:01:12 +0000 (GMT)	[thread overview]
Message-ID: <20230131020112.D021B3858D1E@sourceware.org> (raw)

https://gcc.gnu.org/g:e08835fd3a4a6559b79c26db9b18df0e838d943e

commit r13-5524-ge08835fd3a4a6559b79c26db9b18df0e838d943e
Author: YunQiang Su <yunqiang.su@cipunited.com>
Date:   Fri Jan 6 18:28:22 2023 +0800

    libsanitizer/mips: always build with largefile support
    
    -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 is always used for mips
    when build libsanitizer in LLVM. Thus
       FIRST_32_SECOND_64((_MIPS_SIM == _ABIN32) ? 176 : 160, 216);
    instead of
       FIRST_32_SECOND_64((_MIPS_SIM == _ABIN32) ? 160 : 144, 216);
    in sanitizer_platform_limits_posix.h.
    
    To keep sync with LLVM and to make the code simple, we use the
    largefile options always.
    
    libsanitizer/
            * configure.ac: set -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
            always for mips*.
            * configure: Regenerate.

Diff:
---
 libsanitizer/configure    | 13 ++++++++++---
 libsanitizer/configure.ac | 12 ++++++++++--
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/libsanitizer/configure b/libsanitizer/configure
index d3de3dbba51..d4ee0fac3e7 100755
--- a/libsanitizer/configure
+++ b/libsanitizer/configure
@@ -17045,9 +17045,16 @@ else
 $as_echo "no" >&6; }
 fi
 
-EXTRA_CFLAGS="$EXTRA_CFLAGS $CET_FLAGS"
-EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS $CET_FLAGS"
-EXTRA_ASFLAGS=$CET_FLAGS
+# Always set -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 to sync with LLVM,
+# and keep struct *stat* have the same size.
+case "${host}" in
+  mips*-*) FILE64_FLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" ;;
+  *) FILE64_FLAGS="" ;;
+esac
+
+EXTRA_CFLAGS="$EXTRA_CFLAGS $CET_FLAGS $FILE64_FLAGS"
+EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS $CET_FLAGS $FILE64_FLAGS"
+EXTRA_ASFLAGS="$CET_FLAGS $FILE64_FLAGS"
 
 
 
diff --git a/libsanitizer/configure.ac b/libsanitizer/configure.ac
index ad49f29db7e..04cd8910ed6 100644
--- a/libsanitizer/configure.ac
+++ b/libsanitizer/configure.ac
@@ -416,8 +416,16 @@ GCC_BASE_VER
 
 # Add CET specific flags if Intel CET is enabled.
 GCC_CET_FLAGS(CET_FLAGS)
-EXTRA_CFLAGS="$EXTRA_CFLAGS $CET_FLAGS"
-EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS $CET_FLAGS"
+
+# Always set -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 to sync with LLVM,
+# and keep struct *stat* have the same size.
+case "${host}" in
+  mips*-*) FILE64_FLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" ;;
+  *) FILE64_FLAGS="" ;;
+esac
+
+EXTRA_CFLAGS="$EXTRA_CFLAGS $CET_FLAGS $FILE64_FLAGS"
+EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS $CET_FLAGS $FILE64_FLAGS"
 EXTRA_ASFLAGS=$CET_FLAGS
 AC_SUBST(EXTRA_ASFLAGS)
 AC_SUBST(EXTRA_CFLAGS)

                 reply	other threads:[~2023-01-31  2:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230131020112.D021B3858D1E@sourceware.org \
    --to=syq@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).