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>
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=$?
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=$?
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=$?
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=$?
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=$?
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]
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=]
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=]
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=]
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=]
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=$?
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]