mirror of
https://github.com/gcc-mirror/gcc.git
synced 2026-05-06 14:59:39 +02:00
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 <jakub@redhat.com> 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.