binutils-unwrapped: expose if built with ld.gold #132538
binutils-unwrapped: expose if built with ld.gold #132538Ericson2314 merged 2 commits intoNixOS:stagingfrom
Conversation
|
Result of 2 packages skipped due to time constraints:
19 packages built successfully:
Result of 2 packages failed to build:20 packages skipped due to time constraints:
4 packages built successfully:
Note that build failures may predate this PR, and could be nondeterministic or hardware dependent. |
|
I dunno what's idiomatic with passthru and all that, but this is much better than the special-casing I was doing for gold on windows in #132199. |
|
Do |
No, I don't think we can influence the linker they use anyways. I assume they always call plain |
c664979 to
4643bd8
Compare
|
What uses GNU |
Yeah, I don’t see a gold flag or such.
Almost always, it seems. |
|
I'm pretty sure Maybe we should be more eager to use gold here anyways, since it likely speeds up linking?! |
Ericson2314
left a comment
There was a problem hiding this comment.
I would do gold ? execFormatIsELF and assert gold -> execFormatIsELF, as explicitly asking for gold when it won't build should be an error.
|
Makes sense yeah, but I wouldn't remove the |
|
Yeah I would expose |
ld.gold is “A new, faster, ELF only linker”. Thus we only should pass
the configure flag --with-gold if our target platform will actually
support gold (in which case binutil's configure script silently
disables it).
With this change, not only will configureFlags represent the actual
configuration more closely, but we can also expose if the binutils
derivation contains ld.gold via a passthru attr. Specifically this
means that:
nix-repl> pkgsCross.mingwW64.stdenv.cc.bintools.bintools.hasGold
false
The intended way to use this is to check
`stdenv.cc.bintools.bintools or false` which returns accurate results
regardless of the actual linker derivation.
TODO: maybe also add hasGold to binutils wrapper as it also symlinks
ld.gold in?
4643bd8 to
0908812
Compare
|
Done in 4c75874. |
Motivation for this change
ld.gold is “A new, faster, ELF only linker”. Thus we only should pass
the configure flag --with-gold if our target platform will actually
support gold (in which case binutil's configure script silently
disables it).
With this change, not only will configureFlags represent the actual
configuration more closely, but we can also expose if the binutils
derivation contains ld.gold via a passthru attr. Specifically this
means that:
The intended way to use this is to check
stdenv.cc.bintools.bintools or falsewhich returns accurate resultsregardless of the actual linker derivation.
TODO: maybe also add hasGold to binutils wrapper as it also symlinks
ld.gold in?
Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)