using the gold ld is not fully working with all the packages in the tree so adding the ld wrapper script would give us a simple sollution for now to switch to bfd ld on not working packages packages that really don't work just set an environment var Reproducible: Always
Created attachment 294655 [details, diff] example...toolchain-binutils.eclass.diff If you use PT_PAX_FLAGS segment, you should set ld.bfd as default ld.
yes this would be requred to have gold as default but there is no simple way to dynamically switch back to bfd as you can see in the http link a script as ld would be a simple and working sollution " By default, the wrapper will call to the default wrapper, but if you set the environment variable CTNG_LD_IS, you can change which linker will get called: CTNG_LD_IS=gold will unconditionally call the gold linker CTNG_LD_IS=bfd will unconditionally call the old bfd ld linker " this would also work in a crossdev environment.
You could install =sys-devel/binutils-config-3-r1 and do `binutils-config --linker ld.gold' so I don't see how this is different (other than that an environment variable would suit cases where different environments require different linkers, such as when testing for gold breakage - currently you can only set it system-wide).
(In reply to comment #3) > so I don't see how this is different Changing by environment means that e.g. the user could use gold by default while packages needing PAX marking could be linked with bfd anyway (e.g. pax-utils.eclass could set the required environment variable)
i'm not going to wrap ld
the idea is that the env var can be specified in the ebuild for a broken/unsupported package (glibc,qemu,dietlibc,samba,wine, ...) but still have other packages take advantage from the gold linker like lto LLVMgold ..... (offtopic: just compiling world with dragonegg and llvmgold and lto; just for curiosity)