From: H.J. Lu Date: Sun, 15 Dec 2024 13:24:14 +0000 (+0800) Subject: Add test-config-cflags-float-store for -ffloat-store X-Git-Tag: glibc-2.41~251 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56cdc529fb553a307be459df3f1be90d1a231f0a;p=thirdparty%2Fglibc.git Add test-config-cflags-float-store for -ffloat-store Clang doesn't support -ffloat-store: clang: error: optimization flag '-ffloat-store' is not supported [-Werror,-Wignored-optimization-argument] Define test-config-cflags-float-store for -ffloat-store and use it in math/Makefile for testing. Signed-off-by: H.J. Lu Reviewed-by: Sam James --- diff --git a/configure b/configure index aaad07e952..c3e850a9c8 100755 --- a/configure +++ b/configure @@ -7680,6 +7680,39 @@ config_vars="$config_vars config-cflags-signaling-nans = $libc_cv_cc_signaling_nans" + + +saved_CC="$CC" +CC="$TEST_CC" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -ffloat-store in testing" >&5 +printf %s "checking for -ffloat-store in testing... " >&6; } +if test ${libc_cv_test_cc_float_store+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if { ac_try='${CC-cc} -Werror -ffloat-store -xc /dev/null -S -o /dev/null' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then : + libc_cv_test_cc_float_store="-ffloat-store" +else case e in #( + e) libc_cv_test_cc_float_store= ;; +esac +fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_test_cc_float_store" >&5 +printf "%s\n" "$libc_cv_test_cc_float_store" >&6; } + +CC="$saved_CC" + + +config_vars="$config_vars +test-config-cflags-float-store = $libc_cv_test_cc_float_store" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC accepts -fno-tree-loop-distribute-patterns with \ __attribute__ ((__optimize__))" >&5 printf %s "checking if $CC accepts -fno-tree-loop-distribute-patterns with \ diff --git a/configure.ac b/configure.ac index d4c1c7c916..aa0ec5d7ff 100644 --- a/configure.ac +++ b/configure.ac @@ -1497,6 +1497,15 @@ LIBC_CONFIG_VAR([config-cflags-signaling-nans], [$libc_cv_cc_signaling_nans]) AC_SUBST(libc_cv_test_cc_signaling_nans) +dnl Determine if TEST_CC supports -ffloat-store. +LIBC_TRY_TEST_CC_OPTION([for -ffloat-store], + [-Werror -ffloat-store], + libc_cv_test_cc_float_store, + [libc_cv_test_cc_float_store="-ffloat-store"], + [libc_cv_test_cc_float_store=]) +LIBC_CONFIG_VAR([test-config-cflags-float-store], + [$libc_cv_test_cc_float_store]) + AC_CACHE_CHECK(if $CC accepts -fno-tree-loop-distribute-patterns with \ __attribute__ ((__optimize__)), libc_cv_cc_loop_to_function, [dnl cat > conftest.c <3 million), so it may take a