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

--- Comment #6 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:14a3c867601a65fc306ec4ed2892b50638f795d0

commit r16-7833-g14a3c867601a65fc306ec4ed2892b50638f795d0
Author: Rainer Orth <[email protected]>
Date:   Sun Mar 1 21:16:33 2026 +0100

    Remove gld --as-needed workaround on Solaris/x86 [PR57261]

    When configured to use gld, gcc has disabled the --as-needed option
    as a workaround for binutils PR ld/12320:

            [build] Fix Solaris --as-needed/-z ignore detection (PR
target/57261)
            https://gcc.gnu.org/legacy-ml/gcc-patches/2013-05/msg00698.html

    gld would add an unnecessary dependency on libgcc_s.so.1 even though
    --as-needed was used.

    Back then, libgcc_s.so.1 wasn't bundled with Solaris, so even trivial
    programs would fail to run unless linked with -R <libdir>.

    This workaround is no longer necessary for several reasons:

    * In Solaris 11, libgcc_s.so.1 is bundled, so there won't be runtime
      failures.

    * Although the problem occured more often on x86, Solaris/SPARC is
      affected just the same.  Nonetheless the workaround isn't used there.

    * The gld bug has finally been fixed for binutils 2.47, so the issue is
      going to vanish soon.

    Therefore this patch removes the workaround, bringing x86 en par with
    SPARC.

    Bootstrapped without regressions on i386-pc-solaris2.11,
    amd64-pc-solaris2.11, and x86_64-pc-linux-gnu.

    2026-02-21  Rainer Orth  <[email protected]>

            gcc:
            PR target/57261
            * configure.ac (gcc_cv_ld_as_needed) <i?86-*-solaris2* |
            x86_64-*-solaris2*>: Don't disable.
            * configure: Regenerate.

Reply via email to