]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
gmon: Only used -fno-tree-loop-distribute-patterns if compiler supports it
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 20 Oct 2025 12:27:50 +0000 (09:27 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 21 Oct 2025 12:27:01 +0000 (09:27 -0300)
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
configure
configure.ac
gmon/Makefile

index 789f68da757017cc22ea90a1f1b99ddb46ce8706..f44dfcb03c3b89604db86903acc14f98b3f7258d 100755 (executable)
--- a/configure
+++ b/configure
@@ -7515,7 +7515,8 @@ $conftest_code
 EOF
 
 saved_CC="$CC"
-CC="$TEST_CC"
+saved_CFLAGS="$CFLAGS"
+CC="$TEST_CC -Wno-unused-command-line-argument"
 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for traditional tls support in testing" >&5
 printf %s "checking for traditional tls support in testing... " >&6; }
 if test ${libc_cv_test_mtls_traditional+y}
@@ -7989,6 +7990,8 @@ if test $libc_cv_test_cc_loop_to_function = yes; then
 
 fi
 
+config_vars="$config_vars
+config-cflags-cc-loop-to-function = $libc_cv_cc_loop_to_function"
 
 
 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -Wimplicit-fallthrough" >&5
@@ -8081,7 +8084,8 @@ if test "$TEST_CC" = "$CC"; then
 else
 
 saved_CC="$CC"
-CC="$TEST_CC"
+saved_CFLAGS="$CFLAGS"
+CC="$TEST_CC -Wno-unused-command-line-argument"
 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -Wfree-labels in testing" >&5
 printf %s "checking for -Wfree-labels in testing... " >&6; }
 if test ${libc_cv_test_cc_wfree_labels+y}
@@ -8141,7 +8145,8 @@ if test "$TEST_CC" = "$CC"; then
 else
 
 saved_CC="$CC"
-CC="$TEST_CC"
+saved_CFLAGS="$CFLAGS"
+CC="$TEST_CC -Wno-unused-command-line-argument"
 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -Wmissing-parameter-name in testing" >&5
 printf %s "checking for -Wmissing-parameter-name in testing... " >&6; }
 if test ${libc_cv_test_cc_wmissing_parameter_name+y}
index aa4641edaec963770581f91acdd5f4054fa901c9..2cb49f49bc2834420ea8d47d267c4c3e8c253b26 100644 (file)
@@ -1590,6 +1590,7 @@ if test $libc_cv_test_cc_loop_to_function = yes; then
   AC_DEFINE(HAVE_TEST_CC_INHIBIT_LOOP_TO_LIBCALL)
 fi
 AC_SUBST(libc_cv_cc_loop_to_function)
+LIBC_CONFIG_VAR(config-cflags-cc-loop-to-function,$libc_cv_cc_loop_to_function)
 
 LIBC_TRY_CC_AND_TEST_CC_OPTION([for -Wimplicit-fallthrough],
   [-Werror -Wimplicit-fallthrough],
index b42c14aa83dd15849012454f9bff2cc0aa5f1f11..c7534bff67c8b05f1b53614d9df9221aa4a6562f 100644 (file)
@@ -64,7 +64,10 @@ endif
 
 # The mcount code won't work without a frame pointer nor when memcpy or
 # memset are called.
-CFLAGS-mcount.c := -fno-omit-frame-pointer -fno-tree-loop-distribute-patterns
+CFLAGS-mcount.c := -fno-omit-frame-pointer
+ifeq (yes,$(config-cflags-cc-loop-to-function))
+CFLAGS-mcount.c += -fno-tree-loop-distribute-patterns
+endif
 
 CFLAGS-tst-gmon.c := -fno-omit-frame-pointer -pg
 tst-gmon-no-pie = yes