]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Don't pass -c to LIBC_TRY_TEST_CC_OPTION master
authorH.J. Lu <hjl.tools@gmail.com>
Sat, 23 Aug 2025 14:04:48 +0000 (07:04 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Sat, 23 Aug 2025 22:59:42 +0000 (15:59 -0700)
LIBC_TRY_TEST_CC_OPTION is defined with LIBC_TRY_CC_OPTION:

dnl Test a compiler option or options with an empty input file.
dnl LIBC_TRY_CC_OPTION([options], [action-if-true], [action-if-false])
AC_DEFUN([LIBC_TRY_CC_OPTION],
[AS_IF([AC_TRY_COMMAND([${CC-cc} $1 -xc /dev/null -S -o /dev/null])],
        [$2], [$3])])

which passes -S to compiler.  Unlike gcc, when -c is also passed to clang
20, we get

configure:7838: clang -c -Werror -fsemantic-interposition -xc /dev/null -S -o /dev/null
clang: error: argument unused during compilation: '-c' [-Werror,-Wunused-command-line-argument]

Don't pass -c to LIBC_TRY_TEST_CC_OPTION since -c isn't needed.

This fixes BZ #33318.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
configure
configure.ac
sysdeps/x86/configure
sysdeps/x86/configure.ac

index 613ebe670a13c400ffc24b561b4b79af07b7b18c..222f04db220ddf6849ccd8f40e431233cc9d52db 100755 (executable)
--- a/configure
+++ b/configure
@@ -7834,7 +7834,7 @@ if test ${libc_cv_test_cc_cflags_fsemantic_interposition+y}
 then :
   printf %s "(cached) " >&6
 else case e in #(
 then :
   printf %s "(cached) " >&6
 else case e in #(
-  e) if { ac_try='${CC-cc} -c -Werror -fsemantic-interposition -xc /dev/null -S -o /dev/null'
+  e) if { ac_try='${CC-cc} -Werror -fsemantic-interposition -xc /dev/null -S -o /dev/null'
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8204,7 +8204,7 @@ if test ${libc_cv_test_cflags_wno_restrict+y}
 then :
   printf %s "(cached) " >&6
 else case e in #(
 then :
   printf %s "(cached) " >&6
 else case e in #(
-  e) if { ac_try='${CC-cc} -c -Werror -Wno-restrict -xc /dev/null -S -o /dev/null'
+  e) if { ac_try='${CC-cc} -Werror -Wno-restrict -xc /dev/null -S -o /dev/null'
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8238,7 +8238,7 @@ if test ${libc_cv_test_cflags_wno_fortify_source+y}
 then :
   printf %s "(cached) " >&6
 else case e in #(
 then :
   printf %s "(cached) " >&6
 else case e in #(
-  e) if { ac_try='${CC-cc} -c -Werror -Wno-fortify-source -xc /dev/null -S -o /dev/null'
+  e) if { ac_try='${CC-cc} -Werror -Wno-fortify-source -xc /dev/null -S -o /dev/null'
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8272,7 +8272,7 @@ if test ${libc_cv_test_cflags_finput_charset_ascii+y}
 then :
   printf %s "(cached) " >&6
 else case e in #(
 then :
   printf %s "(cached) " >&6
 else case e in #(
-  e) if { ac_try='${CC-cc} -c -Werror -finput-charset=ascii -xc /dev/null -S -o /dev/null'
+  e) if { ac_try='${CC-cc} -Werror -finput-charset=ascii -xc /dev/null -S -o /dev/null'
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8306,7 +8306,7 @@ if test ${libc_cv_test_cxxflags_finput_charset_ascii+y}
 then :
   printf %s "(cached) " >&6
 else case e in #(
 then :
   printf %s "(cached) " >&6
 else case e in #(
-  e) if { ac_try='${CXX-c++} -c -Werror -finput-charset=ascii -xc++ /dev/null -S -o /dev/null'
+  e) if { ac_try='${CXX-c++} -Werror -finput-charset=ascii -xc++ /dev/null -S -o /dev/null'
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
   (eval $ac_try) 2>&5
   ac_status=$?
index 6aefff94a294088633b45d7cf29e4dd43203d6f7..af57b0cbae8c1b22bfdc7a4e47d46c4e5064873a 100644 (file)
@@ -1543,7 +1543,7 @@ AC_SUBST(libc_cv_test_cc_signaling_nans)
 
 dnl Check if TEST_CC supports -fsemantic-interposition.
 LIBC_TRY_TEST_CC_OPTION([-fsemantic-interposition],
 
 dnl Check if TEST_CC supports -fsemantic-interposition.
 LIBC_TRY_TEST_CC_OPTION([-fsemantic-interposition],
-  [-c -Werror -fsemantic-interposition],
+  [-Werror -fsemantic-interposition],
   libc_cv_test_cc_cflags_fsemantic_interposition,
   [libc_cv_test_cc_cflags_fsemantic_interposition=yes],
   [libc_cv_test_cc_cflags_fsemantic_interposition=no]
   libc_cv_test_cc_cflags_fsemantic_interposition,
   [libc_cv_test_cc_cflags_fsemantic_interposition=yes],
   [libc_cv_test_cc_cflags_fsemantic_interposition=no]
@@ -1649,7 +1649,7 @@ LIBC_CONFIG_VAR([have-test-cc-trampoline],
 
 dnl Check if TEST_CC supports -Wno-restrict.
 LIBC_TRY_TEST_CC_OPTION([-Wno-restrict],
 
 dnl Check if TEST_CC supports -Wno-restrict.
 LIBC_TRY_TEST_CC_OPTION([-Wno-restrict],
-  [-c -Werror -Wno-restrict],
+  [-Werror -Wno-restrict],
   libc_cv_test_cflags_wno_restrict,
   [libc_cv_test_cflags_wno_restrict=-Wno-restrict],
   [libc_cv_test_cflags_wno_restrict=]
   libc_cv_test_cflags_wno_restrict,
   [libc_cv_test_cflags_wno_restrict=-Wno-restrict],
   [libc_cv_test_cflags_wno_restrict=]
@@ -1659,7 +1659,7 @@ LIBC_CONFIG_VAR([test-config-cflags-wno-restrict],
 
 dnl Check if TEST_CC supports -Wno-fortify-source.
 LIBC_TRY_TEST_CC_OPTION([-Wno-fortify-source],
 
 dnl Check if TEST_CC supports -Wno-fortify-source.
 LIBC_TRY_TEST_CC_OPTION([-Wno-fortify-source],
-  [-c -Werror -Wno-fortify-source],
+  [-Werror -Wno-fortify-source],
   libc_cv_test_cflags_wno_fortify_source,
   [libc_cv_test_cflags_wno_fortify_source=-Wno-fortify-source],
   [libc_cv_test_cflags_wno_fortify_source=]
   libc_cv_test_cflags_wno_fortify_source,
   [libc_cv_test_cflags_wno_fortify_source=-Wno-fortify-source],
   [libc_cv_test_cflags_wno_fortify_source=]
@@ -1669,7 +1669,7 @@ LIBC_CONFIG_VAR([test-config-cflags-wno-fortify-source],
 
 dnl Check if TEST_CC supports -finput-charset=ascii.
 LIBC_TRY_TEST_CC_OPTION([-finput-charset=ascii],
 
 dnl Check if TEST_CC supports -finput-charset=ascii.
 LIBC_TRY_TEST_CC_OPTION([-finput-charset=ascii],
-  [-c -Werror -finput-charset=ascii],
+  [-Werror -finput-charset=ascii],
   libc_cv_test_cflags_finput_charset_ascii,
   [libc_cv_test_cflags_finput_charset_ascii="-finput-charset=ascii"],
   [libc_cv_test_cflags_finput_charset_ascii=]
   libc_cv_test_cflags_finput_charset_ascii,
   [libc_cv_test_cflags_finput_charset_ascii="-finput-charset=ascii"],
   [libc_cv_test_cflags_finput_charset_ascii=]
@@ -1679,7 +1679,7 @@ LIBC_CONFIG_VAR(test-config-cflags-finput-charset-ascii,
 
 dnl Check if TEST_CXX supports -finput-charset=ascii.
 LIBC_TRY_TEST_CXX_OPTION([$CXX -finput-charset=ascii],
 
 dnl Check if TEST_CXX supports -finput-charset=ascii.
 LIBC_TRY_TEST_CXX_OPTION([$CXX -finput-charset=ascii],
-  [-c -Werror -finput-charset=ascii],
+  [-Werror -finput-charset=ascii],
   libc_cv_test_cxxflags_finput_charset_ascii,
   [libc_cv_test_cxxflags_finput_charset_ascii="-finput-charset=ascii"],
   [libc_cv_test_cxxflags_finput_charset_ascii=]
   libc_cv_test_cxxflags_finput_charset_ascii,
   [libc_cv_test_cxxflags_finput_charset_ascii="-finput-charset=ascii"],
   [libc_cv_test_cxxflags_finput_charset_ascii=]
index f495f69894cff98be87cc0ed0da709b5c14601d8..b8583e266be0ebfd47520d3e86d04c3bdbdb9794 100644 (file)
@@ -189,7 +189,7 @@ if test ${libc_cv_have_test_cc_cflags_mfpmath_387+y}
 then :
   printf %s "(cached) " >&6
 else case e in #(
 then :
   printf %s "(cached) " >&6
 else case e in #(
-  e) if { ac_try='${CC-cc} -c -Werror -mfpmath=387 -xc /dev/null -S -o /dev/null'
+  e) if { ac_try='${CC-cc} -Werror -mfpmath=387 -xc /dev/null -S -o /dev/null'
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
   (eval $ac_try) 2>&5
   ac_status=$?
index 77ba6721ecd622661e8bdeec83c1f25561fe7c66..07f62d0616bbc8aaf25333996c0efcca6db3fb59 100644 (file)
@@ -124,7 +124,7 @@ LIBC_CONFIG_VAR([enable-x86-isa-level], [$libc_cv_include_x86_isa_level])
 
 dnl Check if TEST_CC supports -mfpmath=387
 LIBC_TRY_TEST_CC_OPTION([if -mfpmath=387 works],
 
 dnl Check if TEST_CC supports -mfpmath=387
 LIBC_TRY_TEST_CC_OPTION([if -mfpmath=387 works],
-  [-c -Werror -mfpmath=387],
+  [-Werror -mfpmath=387],
   libc_cv_have_test_cc_cflags_mfpmath_387,
   [libc_cv_have_test_cc_cflags_mfpmath_387=yes],
   [libc_cv_have_test_cc_cflags_mfpmath_387=no]
   libc_cv_have_test_cc_cflags_mfpmath_387,
   [libc_cv_have_test_cc_cflags_mfpmath_387=yes],
   [libc_cv_have_test_cc_cflags_mfpmath_387=no]