Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 393035 - sys-devel/binutils: ld wrapper script
Summary: sys-devel/binutils: ld wrapper script
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal enhancement
Assignee: Gentoo Toolchain Maintainers
URL: http://old.nabble.com/-PATCH-06-of-10...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-03 16:51 UTC by Mario Fetka (geos_one)
Modified: 2011-12-04 17:16 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
example...toolchain-binutils.eclass.diff (toolchain-binutils.eclass.diff,905 bytes, patch)
2011-12-03 23:43 UTC, iGentoo
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mario Fetka (geos_one) 2011-12-03 16:51:43 UTC
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
Comment 1 iGentoo 2011-12-03 23:43:24 UTC
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.
Comment 2 Mario Fetka (geos_one) 2011-12-04 03:11:45 UTC
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.
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2011-12-04 05:32:31 UTC
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).
Comment 4 Martin Väth 2011-12-04 11:21:33 UTC
(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)
Comment 5 SpanKY gentoo-dev 2011-12-04 16:49:18 UTC
i'm not going to wrap ld
Comment 6 Mario Fetka (geos_one) 2011-12-04 17:16:19 UTC
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)