Merge pull request #30549 from obsidiansystems/bintools

treewide: Introduce stdenv.cc.bintools
This commit is contained in:
John Ericson
2017-11-08 14:20:48 -05:00
committed by GitHub
29 changed files with 109 additions and 92 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;
@@ -145,8 +144,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" +
@@ -309,14 +308,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";