treewide: Depend on targetPackages.stdenv.cc.bintools instead of binutils directly

One should do this when needed executables at run time. It is more
honest and cross-friendly than refering to binutils directly, if one
neeeds the default binary tools for the target platform, rather than
binutils in particular.
This commit is contained in:
John Ericson
2017-11-05 17:10:53 -05:00
parent 70d91badf5
commit 4d4f94cde4
17 changed files with 81 additions and 71 deletions
+6 -7
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, noSysDirs
{ stdenv, targetPackages, fetchurl, noSysDirs
, langC ? true, langCC ? true, langFortran ? false
, langObjC ? targetPlatform.isDarwin
, langObjCpp ? targetPlatform.isDarwin
@@ -31,7 +31,6 @@
, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
, stripped ? true
, gnused ? null
, binutils ? null
, cloog # unused; just for compat with gcc4, as we override the parameter on some places
, darwin ? null
, buildPlatform, hostPlatform, targetPlatform
@@ -50,7 +49,7 @@ assert libelf != null -> zlib != null;
assert hostPlatform.isDarwin -> gnused != null;
# Need c++filt on darwin
assert hostPlatform.isDarwin -> binutils != null;
assert hostPlatform.isDarwin -> targetPackages.stdenv.cc.bintools or null != null;
# The go frontend is written in c++
assert langGo -> langCC;
@@ -143,8 +142,8 @@ let version = "6.4.0";
withFloat +
withMode +
# Ensure that -print-prog-name is able to find the correct programs.
" --with-as=${binutils}/bin/${targetPlatform.config}-as" +
" --with-ld=${binutils}/bin/${targetPlatform.config}-ld" +
" --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" +
" --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" +
(if crossMingw && crossStageStatic then
" --with-headers=${libcCross}/include" +
" --with-gcc" +
@@ -307,14 +306,14 @@ stdenv.mkDerivation ({
++ (optional (zlib != null) zlib)
++ (optionals langJava [ boehmgc zip unzip ])
++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs))
++ (optionals (targetPlatform != hostPlatform) [binutils])
++ (optionals (targetPlatform != hostPlatform) [targetPackages.stdenv.cc.bintools])
++ (optionals langAda [gnatboot])
++ (optionals langVhdl [gnat])
# The builder relies on GNU sed (for instance, Darwin's `sed' fails with
# "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
++ (optional hostPlatform.isDarwin gnused)
++ (optional hostPlatform.isDarwin binutils)
++ (optional hostPlatform.isDarwin targetPackages.stdenv.cc.bintools)
;
NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl";