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

Yury G. Kudryashov urkud+nix at ya.ru
Mon Nov 22 18:11:27 CET 2010


Rohan Hart wrote:

> Using a very recent build of binutils it is possible to leave
> non-gold-using-stdenv untouched while building stdenv, X11, xmonad,
> ghc and dependencies with gold.  There's still a lot of packages to
> test.  Most particularly I'm not running Gnome or Kde - this is a
> works-for-me release.
> The non-gold stdenv is still on the latest stable release of binutils.
> 
> After applying the attached patch a gold based system can be activated
> by adding the following to configuration.nix
> 
> nixpkgs.config = {
>     binutils.gold = true;
>   };
> 
> To build with gold when using nix-env add the following to
> ~/.nixpkgs/config.nix
> 
> {
>     binutils.gold = true;
> }
> 
> If someone could configure hydra.nixos.org to build this (assuming
> it's not too overloaded) then I can fix any outstanding errors.
A few remarks on coding style (don't hesitate to tell me if you do not 
agree):

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 ...; }

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.




More information about the nix-dev mailing list