2010/1/14 Rohan Hart <[email protected]>:
> Hi
>
> Now that my hacked binutils builds gold rather than ld I can't work
> out how to make a gcc which uses it.  From the docs it would seem to
> be something like:
>
>  gccGold = wrapGCC (gcc43_real.gcc.override {
>    stdenv = overrideInStdenv stdenv [binutilsGold];
>  });
>
> but while that builds gold it uses the standard binutils ld.
The 'ld' used by gcc when linking (instead of calling the 'ld' in
PATH) is defined I think in the gcc wrapper.

Check this part of all-packages.nix:
  wrapGCCWith = gccWrapper: glibc: baseGCC: gccWrapper {
    nativeTools = stdenv ? gcc && stdenv.gcc.nativeTools;
    nativeLibc = stdenv ? gcc && stdenv.gcc.nativeLibc;
    nativePrefix = if stdenv ? gcc then stdenv.gcc.nativePrefix else "";
    gcc = baseGCC;
    libc = glibc;
    inherit stdenv binutils;
  };

  wrapGCC = wrapGCCWith (import ../build-support/gcc-wrapper) glibc;


Look at the 'inherit ... binutils' there. You want a 'wrapGCCWith'
specific using your gold.
Pay attention, that the whole gcc wrapper includes the wrapper for ld.

If you check the 'pkgs/stdenv/generic/setup.sh' generic builder, you
will notice around line 90 this:
# Set up the initial path.
PATH=
for i in $NIX_GCC @initialPath@; do
    if test "$i" = /; then i=; fi
    addToSearchPath PATH $i/bin
done

So the gcc wrapper gets *first* in the path. With the expression you
used, I think gold went into the PATH, but *after* the ld in
gcc-wrapper.

Thank you for your work in 'gold'! Please let us know the results.

Regards,
Lluís.
_______________________________________________
nix-dev mailing list
[email protected]
https://mail.cs.uu.nl/mailman/listinfo/nix-dev

Reply via email to