diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2025-09-02 15:58:26 -0700 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2025-09-02 15:58:26 -0700 |
commit | 071b4126c613881f4cb25b4e5c39032964827f88 (patch) | |
tree | 7ed805786566918630d1d617b1ed8f7310f5fd8e /gcc/configure.ac | |
parent | 845d23f3ea08ba873197c275a8857eee7edad996 (diff) | |
parent | caa1c2f42691d68af4d894a5c3e700ecd2dba080 (diff) | |
download | gcc-devel/gfortran-test.zip gcc-devel/gfortran-test.tar.gz gcc-devel/gfortran-test.tar.bz2 |
Merge branch 'master' into gfortran-testdevel/gfortran-test
Diffstat (limited to 'gcc/configure.ac')
-rw-r--r-- | gcc/configure.ac | 58 |
1 files changed, 27 insertions, 31 deletions
diff --git a/gcc/configure.ac b/gcc/configure.ac index 2c43b38..7e57d52 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -563,35 +563,6 @@ if test $ac_cv_std_swap_in_utility = yes; then [Define if <utility> defines std::swap.]) fi -# Check whether compiler is affected by placement new aliasing bug (PR 29286). -# If the host compiler is affected by the bug, and we build with optimization -# enabled (which happens e.g. when cross-compiling), the pool allocator may -# get miscompiled. Use -fno-strict-aliasing to work around this problem. -# Since there is no reliable feature check for the presence of this bug, -# we simply use a GCC version number check. (This should never trigger for -# stages 2 or 3 of a native bootstrap.) -aliasing_flags= -if test "$GCC" = yes; then - saved_CXXFLAGS="$CXXFLAGS" - - # The following test compilation will succeed if and only if $CXX accepts - # -fno-strict-aliasing *and* is older than GCC 4.3. - CXXFLAGS="$CXXFLAGS -fno-strict-aliasing" - AC_MSG_CHECKING([whether $CXX is affected by placement new aliasing bug]) - AC_COMPILE_IFELSE([AC_LANG_SOURCE([ -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) -#error compiler not affected by placement new aliasing bug -#endif -])], - [AC_MSG_RESULT([yes]); aliasing_flags='-fno-strict-aliasing'], - [AC_MSG_RESULT([no])]) - - CXXFLAGS="$saved_CXXFLAGS" -fi -AC_SUBST(aliasing_flags) - - - # --------------------- # Warnings and checking # --------------------- @@ -3336,8 +3307,8 @@ case $target in esac # Check if we have .[us]leb128, and support symbol arithmetic with it. -# Older versions of GAS and some non-GNU assemblers, have a bugs handling -# these directives, even when they appear to accept them. +# Older versions of GAS and some non-GNU assemblers have bugs in handling +# of these directives, even when they appear to accept them. gcc_GAS_CHECK_FEATURE([.sleb128 and .uleb128], gcc_cv_as_leb128, [$check_leb128_asflags], [ .data @@ -3359,6 +3330,11 @@ elif test "x$gcc_cv_otool" != x; then | grep '04 80 0a 8e 78 80 80 80 80 80 80 80 80 80 01' >/dev/null; then gcc_cv_as_leb128=yes fi +elif test "x$gcc_cv_readelf" != x; then + if $gcc_cv_readelf -x .data conftest.o 2>/dev/null \ + | grep '04800a8e 78808080 80808080 808001' >/dev/null; then + gcc_cv_as_leb128=yes + fi else # play safe, assume the assembler is broken. : @@ -3427,6 +3403,12 @@ gcc_GAS_CHECK_FEATURE([cfi directives], gcc_cv_as_cfi_directive,, esac fi ;; + x86_64-*-darwin* | i?86-*-darwin* | powerpc*-darwin-*) + # Darwin has assemblers that support .cfi_ instructions, but that then + # triggers emission of compact unwind which has incompatibilities with + # current GCC output. + gcc_cv_as_cfi_directive=no + ;; *-*-*) gcc_cv_as_cfi_directive=yes ;; @@ -6421,6 +6403,7 @@ if test x"$ld64_flag" = x"yes"; then gcc_cv_ld64_platform_version=0 gcc_cv_ld64_macos_version_min=0 gcc_cv_ld64_demangle=0 + gcc_cv_ld64_no_deduplicate=0 if test "$build" = "$host"; then darwin_try_test=1 @@ -6448,6 +6431,9 @@ if test x"$ld64_flag" = x"yes"; then if test "$gcc_cv_ld64_major" -ge 236; then gcc_cv_ld64_export_dynamic=1 fi + if test "$gcc_cv_ld64_major" -ge 262; then + gcc_cv_ld64_no_deduplicate=1 + fi if test "$gcc_cv_ld64_major" -ge 512; then gcc_cv_ld64_platform_version=1 gcc_cv_ld64_macos_version_min=1 @@ -6476,6 +6462,13 @@ if test x"$ld64_flag" = x"yes"; then fi AC_MSG_RESULT($gcc_cv_ld64_export_dynamic) + AC_MSG_CHECKING(linker for -no_deduplicate support) + gcc_cv_ld64_no_deduplicate=1 + if $gcc_cv_ld -no_deduplicate < /dev/null 2>&1 | grep 'unknown option' > /dev/null; then + gcc_cv_ld64_no_deduplicate=0 + fi + AC_MSG_RESULT($gcc_cv_ld64_no_deduplicate) + AC_MSG_CHECKING(linker for -platform_version support) gcc_cv_ld64_platform_version=1 if $gcc_cv_ld -platform_version macos 10.5 0.0 < /dev/null 2>&1 | grep 'unknown option' > /dev/null; then @@ -6502,6 +6495,9 @@ if test x"$ld64_flag" = x"yes"; then AC_DEFINE_UNQUOTED(LD64_HAS_EXPORT_DYNAMIC, $gcc_cv_ld64_export_dynamic, [Define to 1 if ld64 supports '-export_dynamic'.]) + AC_DEFINE_UNQUOTED(LD64_HAS_NO_DEDUPLICATE, $gcc_cv_ld64_no_deduplicate, + [Define to 1 if ld64 supports '-no_deduplicate'.]) + AC_DEFINE_UNQUOTED(LD64_HAS_PLATFORM_VERSION, $gcc_cv_ld64_platform_version, [Define to 1 if ld64 supports '-platform_version'.]) |