https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123654
--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Jonathan Wakely from comment #12) > (In reply to Sam James from comment #11) > > We have https://github.com/rui314/mold/issues/1545 (didn't realise until > > after had filed), so MOVED. > > I've put a patch to fix it there, but as Arsen observed, the problem only > happens if a linker script is used by -latomic_asneeded, so giving a full > path to libatomic_asneeded.a would also solve the problem. Though we don't want to hardcode paths, gcc needs to be a relocatable package. And even when using relative paths, something we add by default in -L arguments, hardcoding where exactly libatomic_asneeded.so etc. are doesn't look like a good idea. Not to mention that because of the other bug we want to use a symlink or copy rather than a linker script for libatomic_asneeded.a and -l is the only way to let the linker choose library suffix based on -static and other linker options. And, e.g. vanilla gcc installs libatomic{,_asneeded}.{a,so,so.*} to the prefix/lib/multiosdirectory/ directory, while e.g. in Fedora packaging we move all such *.a/*.so links/linker scripts to /usr/lib/gcc/target/version/ subdirectories.
