binutils: No more darwin conditionals

Since at least d7bddc27b2, we've had a
situation where one should depend on:

 - `stdenv.cc.bintools`: for executables at build time
 - `libbfd` or `libiberty`: for those libraries
 - `targetPackages.cc.bintools`: for exectuables at *run* time
 - `binutils`: only for specifically GNU Binutils's executables,
   regardless of the host platform, at run time.

and that commit cleaned up this usage to reflect that. This PR flips the
switch so that:

 - `binutils` is indeed unconditionally GNU Binutils
 - `binutils-raw`, which previously served that role, is gone.

so that the correct usage will be enforced going forward and everything
is simple.

N.B. In a few cases `binutils-unwrapped` (which before and now was
unconditionally actual GNU binutils), rather than `binutils` was used to
replace old `binutils-raw` as it is friendly towards some cross
compilation usage by avoiding a reference to the next bootstrapping
change.
This commit is contained in:
John Ericson
2018-04-03 13:34:52 -04:00
parent 9714501256
commit adaa110a72
7 changed files with 23 additions and 30 deletions
+7 -7
View File
@@ -1,13 +1,13 @@
{ stdenv, binutils-raw, cctools
{ stdenv, binutils-unwrapped, cctools
, hostPlatform, targetPlatform
}:
# Make sure both underlying packages claim to have prepended their binaries
# with the same targetPrefix.
assert binutils-raw.targetPrefix == cctools.targetPrefix;
assert binutils-unwrapped.targetPrefix == cctools.targetPrefix;
let
inherit (binutils-raw) targetPrefix;
inherit (binutils-unwrapped) targetPrefix;
cmds = [
"ar" "ranlib" "as" "dsymutil" "install_name_tool"
"ld" "strip" "otool" "lipo" "nm" "strings" "size"
@@ -21,7 +21,7 @@ stdenv.mkDerivation {
buildCommand = ''
mkdir -p $out/bin $out/include
ln -s ${binutils-raw.bintools.out}/bin/${targetPrefix}c++filt $out/bin/${targetPrefix}c++filt
ln -s ${binutils-unwrapped.out}/bin/${targetPrefix}c++filt $out/bin/${targetPrefix}c++filt
# We specifically need:
# - ld: binutils doesn't provide it on darwin
@@ -38,15 +38,15 @@ stdenv.mkDerivation {
ln -sf "${cctools}/bin/$i" "$out/bin/$i"
done
ln -s ${binutils-raw.bintools.out}/share $out/share
ln -s ${binutils-unwrapped.out}/share $out/share
ln -s ${cctools}/libexec $out/libexec
mkdir -p "$info/nix-support" "$man/nix-support"
printWords ${binutils-raw.bintools.info} \
printWords ${binutils-unwrapped.info} \
>> $info/nix-support/propagated-build-inputs
# FIXME: cctools missing man pages
printWords ${binutils-raw.bintools.man} \
printWords ${binutils-unwrapped.man} \
>> $man/nix-support/propagated-build-inputs
'';