https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123841

--- Comment #39 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Rainer Orth <[email protected]>:

https://gcc.gnu.org/g:cc12934b555625b130e242eb6199c60b353ab509

commit r16-7269-gcc12934b555625b130e242eb6199c60b353ab509
Author: Rainer Orth <[email protected]>
Date:   Tue Feb 3 20:41:40 2026 +0100

    build: Only use gas_flag/gnu_ld_flag internally [PR123841]

    gcc/acinclude.m4, gcc/config.gcc, and gcc/configure.ac have two
    different variables that are checked to determine if GNU as and/or GNU
    ld are used.  config.gcc describes them like this:

      gas_flag              Either yes or no depending on whether GNU as was
                            requested.
      gnu_ld_flag           Either yes or no depending on whether GNU ld was
                            requested.

      gas                   Set to yes or no depending on whether the target
                            system normally uses GNU as.
      gnu_ld                Set to yes or no depending on whether the target
                            system normally uses GNU ld.

    I find this duplication highly confusing: what's the point of what a
    target normally uses when it can just be determined at configure time if
    the assembler/linker used is gas/gnu_ld?

    There are two uses for those variables:

    * gas/gnu_ld determine the setting of HAVE_GNU_AS/HAVE_GNU_LD.  In this
      case only, the normally part may be good enough, so this patch doesn't
      touch it.

    * However, there are several other places where this isn't good enough:
      when the assembler/linker is invoked at configure time, it's crucial
      that the right options and input syntax are use for the tool in
      question.

    Therefore this patch determines gas_flag/gnu_ld_flag at configure time
    if they are not yet set otherwise.  All tests that need to know which
    tool is used now check gas_flag/gnu_ld_flag only.

    Tested on {i386,amd64}-pc-solaris2.11, {i686,x86_64}-pc-linux-gnu,
    {i386,x86_64}-apple-darwin, and sparc64-unknown-linux-gnu.

    2026-01-30  Rainer Orth  <[email protected]>

            gcc:
            PR other/123841
            * acinclude.m4 (gcc_GAS_FLAGS): Check $gas_flag, $gnu_ld_flag
            instead of $gas, $gnu_ld.
            * configure.ac: Likewise.
            (gas_flag): Determine if not already set.
            (gnu_ld_flag): Likewise.
            (ld_32_opt): Only set after gnu_ld_flag is set.
            (ld_64_opt): Likewise.
            * configure: Regenerate.

Reply via email to