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

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

https://gcc.gnu.org/g:34039b22adea4d7809dae53f809177d6dd1155d9

commit r16-6892-g34039b22adea4d7809dae53f809177d6dd1155d9
Author: Jakub Jelinek <[email protected]>
Date:   Mon Jan 19 09:45:10 2026 +0100

    libatomic: Change installed libatomic_asneeded.a into a symlink [PR123650]

    So, apparently I've tripped over not just one linker bug with the
    libatomic/libgcc_s asneeded workaround for libtool bug, but two.
    One is that mold doesn't parse INPUT ( AS_NEEDED ( -latomic ) )
    or INPUT ( AS_NEEDED ( -lgcc_s ) ) correctly, I think that just
    should be fixed in mold.

    Another one is that ld.bfd doesn't handle correctly INPUT ( libatomic.a )
    when doing static linking with -flto.  While that bug should be fixed too
    in the linker, the reason to install a linker script for a static library
    has been just my laziness, a symbolic link is more efficient, and even on
    hosts without symbolic link for a very small library like libatomic.a
    we can live with a cp -pR copy of it.

    Furthermore, when I was checking in the last patch (i.e. r16-6736
PR123396),
    git was loudly complaining about libatomic_asneeded.a being checked
    into repository when *.a is in .gitignored.

    So, the following patch revamps the libatomic_asneeded* handling.
    libatomic_asneeded.so is rewritten in the way that libgcc_s_asneeded.so
    is done and libatomic_asneeded.a installed using $(LN_S).

    2026-01-19  Jakub Jelinek  <[email protected]>

            PR libgcc/123650
            * Makefile.am (toolexeclib_DATA): Remove.
            (all-local): For LIBAT_BUILD_ASNEEDED_SOLINK instead of installing
            libatomic_asneeded.{so,a} from top_srcdir cd into the destination
            directory, use echo to write libatomic_asneeded.so and $(LN_S) to
            symlink libatomic_asneeded.a to libatomic.a.
            (install-data-am): For LIBAT_BUILD_ASNEEDED_SOLINK depend on
            install-asneeded.
            (install-asneeded): New goal.
            * libatomic_asneeded.so: Remove.
            * libatomic_asneeded.a: Remove.
            * Makefile.in: Regenerate.

Reply via email to