[Bug build/33318] -c shouldn't be passed to LIBC_TRY_TEST_CC_OPTION

cvs-commit at gcc dot gnu.org sourceware-bugzilla@sourceware.org
Sat Aug 23 23:00:01 GMT 2025


https://sourceware.org/bugzilla/show_bug.cgi?id=33318

--- Comment #1 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by H.J. Lu <hjl@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=027505a07b2fdef09749300b531623b12f4d5afe

commit 027505a07b2fdef09749300b531623b12f4d5afe
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sat Aug 23 07:04:48 2025 -0700

    Don't pass -c to LIBC_TRY_TEST_CC_OPTION

    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>

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Glibc-bugs mailing list