[Nix-dev] Re: Re: mostly minimal Nixos built using gold ld where possible

Rohan Hart rohan.hart17 at gmail.com
Tue Nov 23 13:15:57 CET 2010


Thanks for the suggestions Yury

On 22 November 2010 18:11, Yury G. Kudryashov <urkud+nix at ya.ru> wrote:
> 1. Try not to change hashes of packages if binutils.gold = false. In
> particular, you can use
> stdenv.mkDerivation ({ old args} // (if goldEnabled then { ... } else { }))
> instead of
> { configureFlags = if ...; }

I've tried to avoid changing hashes but couldn't find a way to avoid
it in all cases.  This seems easy to apply.

> 2. Add passthru.gold (or passthru.goldEnabled) to binutils derivation. This
> will not change hash but will allow you to use
> stdenv.mkDerivation {
> } // (if binutils.goldEnabled then { configureFlags = ...; } else { })
> This solution will not allow user to break curl by passing goldEnabled =
> true and ld binutils.

So this ensures that goldEnabled is the same in binutils and, eg., curl?

Very few derivations are passed binutils directly. However it seems that:
  if stdenv.gcc.binutils.goldEnabled then ...
is visible.  Will do.

cheers
Rohan



More information about the nix-dev mailing list