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-10-18 14:05:39 -04:00
parent 70d91badf5
commit 4d4f94cde4
17 changed files with 81 additions and 71 deletions

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, noSysDirs { stdenv, targetPackages, fetchurl, noSysDirs
, langC ? true, langCC ? true, langFortran ? false , langC ? true, langCC ? true, langFortran ? false
, langJava ? false , langJava ? false
, langAda ? false , langAda ? false
@ -77,8 +77,8 @@ let version = "4.5.4";
withCpu + withCpu +
withAbi + withAbi +
# Ensure that -print-prog-name is able to find the correct programs. # Ensure that -print-prog-name is able to find the correct programs.
" --with-as=${binutils}/bin/${targetPlatform.config}-as" + " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" +
" --with-ld=${binutils}/bin/${targetPlatform.config}-ld" + " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" +
(if crossMingw && crossStageStatic then (if crossMingw && crossStageStatic then
" --with-headers=${libcCross}/include" + " --with-headers=${libcCross}/include" +
" --with-gcc" + " --with-gcc" +
@ -228,7 +228,7 @@ stdenv.mkDerivation ({
++ (optional langJava boehmgc) ++ (optional langJava boehmgc)
++ (optionals langJava [zip unzip]) ++ (optionals langJava [zip unzip])
++ (optionals javaAwtGtk ([gtk2 pkgconfig libart_lgpl] ++ xlibs)) ++ (optionals javaAwtGtk ([gtk2 pkgconfig libart_lgpl] ++ xlibs))
++ (optionals (targetPlatform != hostPlatform) [binutils]) ++ (optionals (targetPlatform != hostPlatform) [targetPackages.stdenv.cc.bintools])
++ (optionals langAda [gnatboot]) ++ (optionals langAda [gnatboot])
++ (optionals langVhdl [gnat]) ++ (optionals langVhdl [gnat])
; ;

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, fetchpatch, noSysDirs { stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
, langC ? true, langCC ? true, langFortran ? false , langC ? true, langCC ? true, langFortran ? false
, langObjC ? targetPlatform.isDarwin , langObjC ? targetPlatform.isDarwin
, langObjCpp ? targetPlatform.isDarwin , langObjCpp ? targetPlatform.isDarwin
@ -149,8 +149,8 @@ let version = "4.8.5";
withFloat + withFloat +
withMode + withMode +
# Ensure that -print-prog-name is able to find the correct programs. # Ensure that -print-prog-name is able to find the correct programs.
" --with-as=${binutils}/bin/${targetPlatform.config}-as" + " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" +
" --with-ld=${binutils}/bin/${targetPlatform.config}-ld" + " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" +
(if crossMingw && crossStageStatic then (if crossMingw && crossStageStatic then
" --with-headers=${libcCross}/include" + " --with-headers=${libcCross}/include" +
" --with-gcc" + " --with-gcc" +
@ -299,7 +299,7 @@ stdenv.mkDerivation ({
++ (optional (zlib != null) zlib) ++ (optional (zlib != null) zlib)
++ (optionals langJava [ boehmgc zip unzip ]) ++ (optionals langJava [ boehmgc zip unzip ])
++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs)) ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs))
++ (optionals (targetPlatform != hostPlatform) [binutils]) ++ (optionals (targetPlatform != hostPlatform) [targetPackages.stdenv.cc.bintools])
++ (optionals langAda [gnatboot]) ++ (optionals langAda [gnatboot])
++ (optionals langVhdl [gnat]) ++ (optionals langVhdl [gnat])

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, noSysDirs { stdenv, targetPackages, fetchurl, noSysDirs
, langC ? true, langCC ? true, langFortran ? false , langC ? true, langCC ? true, langFortran ? false
, langObjC ? targetPlatform.isDarwin , langObjC ? targetPlatform.isDarwin
, langObjCpp ? targetPlatform.isDarwin , langObjCpp ? targetPlatform.isDarwin
@ -143,8 +143,8 @@ let version = "4.9.4";
withFloat + withFloat +
withMode + withMode +
# Ensure that -print-prog-name is able to find the correct programs. # Ensure that -print-prog-name is able to find the correct programs.
" --with-as=${binutils}/bin/${targetPlatform.config}-as" + " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" +
" --with-ld=${binutils}/bin/${targetPlatform.config}-ld" + " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" +
(if crossMingw && crossStageStatic then (if crossMingw && crossStageStatic then
" --with-headers=${libcCross}/include" + " --with-headers=${libcCross}/include" +
" --with-gcc" + " --with-gcc" +
@ -295,7 +295,7 @@ stdenv.mkDerivation ({
++ (optional (zlib != null) zlib) ++ (optional (zlib != null) zlib)
++ (optionals langJava [ boehmgc zip unzip ]) ++ (optionals langJava [ boehmgc zip unzip ])
++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs)) ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs))
++ (optionals (targetPlatform != hostPlatform) [binutils]) ++ (optionals (targetPlatform != hostPlatform) [targetPackages.stdenv.cc.bintools])
++ (optionals langAda [gnatboot]) ++ (optionals langAda [gnatboot])
++ (optionals langVhdl [gnat]) ++ (optionals langVhdl [gnat])

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, noSysDirs { stdenv, targetPackages, fetchurl, noSysDirs
, langC ? true, langCC ? true, langFortran ? false , langC ? true, langCC ? true, langFortran ? false
, langObjC ? targetPlatform.isDarwin , langObjC ? targetPlatform.isDarwin
, langObjCpp ? targetPlatform.isDarwin , langObjCpp ? targetPlatform.isDarwin
@ -31,7 +31,6 @@
, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd , libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
, stripped ? true , stripped ? true
, gnused ? null , gnused ? null
, binutils ? null
, cloog # unused; just for compat with gcc4, as we override the parameter on some places , cloog # unused; just for compat with gcc4, as we override the parameter on some places
, darwin ? null , darwin ? null
, buildPlatform, hostPlatform, targetPlatform , buildPlatform, hostPlatform, targetPlatform
@ -51,7 +50,7 @@ assert libelf != null -> zlib != null;
assert hostPlatform.isDarwin -> gnused != null; assert hostPlatform.isDarwin -> gnused != null;
# Need c++filt on darwin # 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++ # The go frontend is written in c++
assert langGo -> langCC; assert langGo -> langCC;
@ -149,8 +148,8 @@ let version = "5.5.0";
withFloat + withFloat +
withMode + withMode +
# Ensure that -print-prog-name is able to find the correct programs. # Ensure that -print-prog-name is able to find the correct programs.
" --with-as=${binutils}/bin/${targetPlatform.config}-as" + " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" +
" --with-ld=${binutils}/bin/${targetPlatform.config}-ld" + " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" +
(if crossMingw && crossStageStatic then (if crossMingw && crossStageStatic then
" --with-headers=${libcCross}/include" + " --with-headers=${libcCross}/include" +
" --with-gcc" + " --with-gcc" +
@ -312,7 +311,7 @@ stdenv.mkDerivation ({
++ (optional (zlib != null) zlib) ++ (optional (zlib != null) zlib)
++ (optionals langJava [ boehmgc zip unzip ]) ++ (optionals langJava [ boehmgc zip unzip ])
++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs)) ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs))
++ (optionals (targetPlatform != hostPlatform) [binutils]) ++ (optionals (targetPlatform != hostPlatform) [targetPackages.stdenv.cc.bintools])
++ (optionals (buildPlatform != hostPlatform) [buildPackages.stdenv.cc]) ++ (optionals (buildPlatform != hostPlatform) [buildPackages.stdenv.cc])
++ (optionals langAda [gnatboot]) ++ (optionals langAda [gnatboot])
++ (optionals langVhdl [gnat]) ++ (optionals langVhdl [gnat])
@ -320,7 +319,7 @@ stdenv.mkDerivation ({
# The builder relies on GNU sed (for instance, Darwin's `sed' fails with # 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. # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
++ (optional hostPlatform.isDarwin gnused) ++ (optional hostPlatform.isDarwin gnused)
++ (optional hostPlatform.isDarwin binutils) ++ (optional hostPlatform.isDarwin targetPackages.stdenv.cc.bintools)
; ;
NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl";

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, noSysDirs { stdenv, targetPackages, fetchurl, noSysDirs
, langC ? true, langCC ? true, langFortran ? false , langC ? true, langCC ? true, langFortran ? false
, langObjC ? targetPlatform.isDarwin , langObjC ? targetPlatform.isDarwin
, langObjCpp ? targetPlatform.isDarwin , langObjCpp ? targetPlatform.isDarwin
@ -31,7 +31,6 @@
, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd , libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
, stripped ? true , stripped ? true
, gnused ? null , gnused ? null
, binutils ? null
, cloog # unused; just for compat with gcc4, as we override the parameter on some places , cloog # unused; just for compat with gcc4, as we override the parameter on some places
, darwin ? null , darwin ? null
, buildPlatform, hostPlatform, targetPlatform , buildPlatform, hostPlatform, targetPlatform
@ -50,7 +49,7 @@ assert libelf != null -> zlib != null;
assert hostPlatform.isDarwin -> gnused != null; assert hostPlatform.isDarwin -> gnused != null;
# Need c++filt on darwin # 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++ # The go frontend is written in c++
assert langGo -> langCC; assert langGo -> langCC;
@ -143,8 +142,8 @@ let version = "6.4.0";
withFloat + withFloat +
withMode + withMode +
# Ensure that -print-prog-name is able to find the correct programs. # Ensure that -print-prog-name is able to find the correct programs.
" --with-as=${binutils}/bin/${targetPlatform.config}-as" + " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" +
" --with-ld=${binutils}/bin/${targetPlatform.config}-ld" + " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" +
(if crossMingw && crossStageStatic then (if crossMingw && crossStageStatic then
" --with-headers=${libcCross}/include" + " --with-headers=${libcCross}/include" +
" --with-gcc" + " --with-gcc" +
@ -307,14 +306,14 @@ stdenv.mkDerivation ({
++ (optional (zlib != null) zlib) ++ (optional (zlib != null) zlib)
++ (optionals langJava [ boehmgc zip unzip ]) ++ (optionals langJava [ boehmgc zip unzip ])
++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs)) ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs))
++ (optionals (targetPlatform != hostPlatform) [binutils]) ++ (optionals (targetPlatform != hostPlatform) [targetPackages.stdenv.cc.bintools])
++ (optionals langAda [gnatboot]) ++ (optionals langAda [gnatboot])
++ (optionals langVhdl [gnat]) ++ (optionals langVhdl [gnat])
# The builder relies on GNU sed (for instance, Darwin's `sed' fails with # 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. # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
++ (optional hostPlatform.isDarwin gnused) ++ (optional hostPlatform.isDarwin gnused)
++ (optional hostPlatform.isDarwin binutils) ++ (optional hostPlatform.isDarwin targetPackages.stdenv.cc.bintools)
; ;
NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl";

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, noSysDirs { stdenv, targetPackages, fetchurl, noSysDirs
, langC ? true, langCC ? true, langFortran ? false , langC ? true, langCC ? true, langFortran ? false
, langObjC ? targetPlatform.isDarwin , langObjC ? targetPlatform.isDarwin
, langObjCpp ? targetPlatform.isDarwin , langObjCpp ? targetPlatform.isDarwin
@ -31,7 +31,6 @@
, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd , libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
, stripped ? true , stripped ? true
, gnused ? null , gnused ? null
, binutils ? null
, cloog # unused; just for compat with gcc4, as we override the parameter on some places , cloog # unused; just for compat with gcc4, as we override the parameter on some places
, darwin ? null , darwin ? null
, flex ? null , flex ? null
@ -51,7 +50,7 @@ assert libelf != null -> zlib != null;
assert hostPlatform.isDarwin -> gnused != null; assert hostPlatform.isDarwin -> gnused != null;
# Need c++filt on darwin # 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++ # The go frontend is written in c++
assert langGo -> langCC; assert langGo -> langCC;
@ -144,8 +143,8 @@ let version = "7.2.0";
withFloat + withFloat +
withMode + withMode +
# Ensure that -print-prog-name is able to find the correct programs. # Ensure that -print-prog-name is able to find the correct programs.
" --with-as=${binutils}/bin/${targetPlatform.config}-as" + " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" +
" --with-ld=${binutils}/bin/${targetPlatform.config}-ld" + " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" +
(if crossMingw && crossStageStatic then (if crossMingw && crossStageStatic then
" --with-headers=${libcCross}/include" + " --with-headers=${libcCross}/include" +
" --with-gcc" + " --with-gcc" +
@ -308,14 +307,14 @@ stdenv.mkDerivation ({
++ (optional (zlib != null) zlib) ++ (optional (zlib != null) zlib)
++ (optionals langJava [ boehmgc zip unzip ]) ++ (optionals langJava [ boehmgc zip unzip ])
++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs)) ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs))
++ (optionals (targetPlatform != hostPlatform) [binutils]) ++ (optionals (targetPlatform != hostPlatform) [targetPackages.stdenv.cc.bintools])
++ (optionals langAda [gnatboot]) ++ (optionals langAda [gnatboot])
++ (optionals langVhdl [gnat]) ++ (optionals langVhdl [gnat])
# The builder relies on GNU sed (for instance, Darwin's `sed' fails with # 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. # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
++ (optional hostPlatform.isDarwin gnused) ++ (optional hostPlatform.isDarwin gnused)
++ (optional hostPlatform.isDarwin binutils) ++ (optional hostPlatform.isDarwin targetPackages.stdenv.cc.bintools)
; ;
NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl";

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, noSysDirs { stdenv, targetPackages, fetchurl, noSysDirs
, langC ? true, langCC ? true, langFortran ? false , langC ? true, langCC ? true, langFortran ? false
, langObjC ? targetPlatform.isDarwin , langObjC ? targetPlatform.isDarwin
, langObjCpp ? targetPlatform.isDarwin , langObjCpp ? targetPlatform.isDarwin
@ -31,7 +31,6 @@
, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd , libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
, stripped ? true , stripped ? true
, gnused ? null , gnused ? null
, binutils ? null
, cloog # unused; just for compat with gcc4, as we override the parameter on some places , cloog # unused; just for compat with gcc4, as we override the parameter on some places
, darwin ? null , darwin ? null
, flex ? null , flex ? null
@ -51,7 +50,7 @@ assert libelf != null -> zlib != null;
assert hostPlatform.isDarwin -> gnused != null; assert hostPlatform.isDarwin -> gnused != null;
# Need c++filt on darwin # 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++ # The go frontend is written in c++
assert langGo -> langCC; assert langGo -> langCC;
@ -144,8 +143,8 @@ let version = "7-20170409";
withFloat + withFloat +
withMode + withMode +
# Ensure that -print-prog-name is able to find the correct programs. # Ensure that -print-prog-name is able to find the correct programs.
" --with-as=${binutils}/bin/${targetPlatform.config}-as" + " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" +
" --with-ld=${binutils}/bin/${targetPlatform.config}-ld" + " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" +
(if crossMingw && crossStageStatic then (if crossMingw && crossStageStatic then
" --with-headers=${libcCross}/include" + " --with-headers=${libcCross}/include" +
" --with-gcc" + " --with-gcc" +
@ -295,14 +294,14 @@ stdenv.mkDerivation ({
++ (optional (zlib != null) zlib) ++ (optional (zlib != null) zlib)
++ (optionals langJava [ boehmgc zip unzip ]) ++ (optionals langJava [ boehmgc zip unzip ])
++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs)) ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs))
++ (optionals (targetPlatform != hostPlatform) [binutils]) ++ (optionals (targetPlatform != hostPlatform) [targetPackages.stdenv.cc.bintools])
++ (optionals langAda [gnatboot]) ++ (optionals langAda [gnatboot])
++ (optionals langVhdl [gnat]) ++ (optionals langVhdl [gnat])
# The builder relies on GNU sed (for instance, Darwin's `sed' fails with # 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. # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
++ (optional hostPlatform.isDarwin gnused) ++ (optional hostPlatform.isDarwin gnused)
++ (optional hostPlatform.isDarwin binutils) ++ (optional hostPlatform.isDarwin targetPackages.stdenv.cc.bintools)
; ;
NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl";

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, fetchpatch, bootPkgs, perl, ncurses, libiconv, binutils, coreutils { stdenv, fetchurl, fetchpatch, bootPkgs, perl, ncurses, libiconv, targetPackages, coreutils
, libxml2, libxslt, docbook_xsl, docbook_xml_dtd_45, docbook_xml_dtd_42, hscolour , libxml2, libxslt, docbook_xsl, docbook_xml_dtd_45, docbook_xml_dtd_42, hscolour
# If enabled GHC will be build with the GPL-free but slower integer-simple # If enabled GHC will be build with the GPL-free but slower integer-simple
@ -70,7 +70,7 @@ stdenv.mkDerivation rec {
for i in "$out/bin/"*; do for i in "$out/bin/"*; do
test ! -h $i || continue test ! -h $i || continue
egrep --quiet '^#!' <(head -n 1 $i) || continue egrep --quiet '^#!' <(head -n 1 $i) || continue
sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ binutils coreutils ]}"' $i sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
done done
''; '';

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, fetchpatch, bootPkgs, perl, ncurses, libiconv, binutils, coreutils { stdenv, fetchurl, fetchpatch, bootPkgs, perl, ncurses, libiconv, targetPackages, coreutils
, libxml2, libxslt, docbook_xsl, docbook_xml_dtd_45, docbook_xml_dtd_42, hscolour , libxml2, libxslt, docbook_xsl, docbook_xml_dtd_45, docbook_xml_dtd_42, hscolour
# If enabled GHC will be build with the GPL-free but slower integer-simple # If enabled GHC will be build with the GPL-free but slower integer-simple
@ -68,7 +68,7 @@ stdenv.mkDerivation rec {
for i in "$out/bin/"*; do for i in "$out/bin/"*; do
test ! -h $i || continue test ! -h $i || continue
egrep --quiet '^#!' <(head -n 1 $i) || continue egrep --quiet '^#!' <(head -n 1 $i) || continue
sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ binutils coreutils ]}"' $i sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
done done
''; '';

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, ghc, perl, ncurses, binutils, libiconv { stdenv, fetchurl, ghc, perl, ncurses, libiconv
# If enabled GHC will be build with the GPL-free but slower integer-simple # If enabled GHC will be build with the GPL-free but slower integer-simple
# library instead of the faster but GPLed integer-gmp library. # library instead of the faster but GPLed integer-gmp library.

View File

@ -1,4 +1,4 @@
{ stdenv, lib, fetchurl, fetchpatch, bootPkgs, perl, ncurses, libiconv, binutils, coreutils { stdenv, lib, fetchurl, fetchpatch, bootPkgs, perl, ncurses, libiconv, targetPackages, coreutils
, hscolour, patchutils, sphinx , hscolour, patchutils, sphinx
# If enabled GHC will be build with the GPL-free but slower integer-simple # If enabled GHC will be build with the GPL-free but slower integer-simple
@ -65,7 +65,7 @@ stdenv.mkDerivation rec {
for i in "$out/bin/"*; do for i in "$out/bin/"*; do
test ! -h $i || continue test ! -h $i || continue
egrep --quiet '^#!' <(head -n 1 $i) || continue egrep --quiet '^#!' <(head -n 1 $i) || continue
sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ binutils coreutils ]}"' $i sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
done done
''; '';

View File

@ -1,4 +1,4 @@
{ stdenv, lib, fetchurl, bootPkgs, perl, ncurses, libiconv, binutils, coreutils { stdenv, lib, fetchurl, bootPkgs, perl, ncurses, libiconv, targetPackages, coreutils
, autoconf, automake, happy, alex, python3, sphinx, hscolour , autoconf, automake, happy, alex, python3, sphinx, hscolour
, buildPlatform, targetPlatform , selfPkgs, cross ? null , buildPlatform, targetPlatform , selfPkgs, cross ? null
@ -66,7 +66,7 @@ in stdenv.mkDerivation (rec {
for i in "$out/bin/"*; do for i in "$out/bin/"*; do
test ! -h $i || continue test ! -h $i || continue
egrep --quiet '^#!' <(head -n 1 $i) || continue egrep --quiet '^#!' <(head -n 1 $i) || continue
sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ binutils coreutils ]}"' $i sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
done done
''; '';
@ -97,23 +97,23 @@ in stdenv.mkDerivation (rec {
configureFlags = [ configureFlags = [
"CC=${stdenv.ccCross}/bin/${cross.config}-cc" "CC=${stdenv.ccCross}/bin/${cross.config}-cc"
"LD=${stdenv.binutils}/bin/${cross.config}-ld" "LD=${targetPackages.stdenv.cc.bintools}/bin/${cross.config}-ld"
"AR=${stdenv.binutils}/bin/${cross.config}-ar" "AR=${targetPackages.stdenv.cc.bintools}/bin/${cross.config}-ar"
"NM=${stdenv.binutils}/bin/${cross.config}-nm" "NM=${targetPackages.stdenv.cc.bintools}/bin/${cross.config}-nm"
"RANLIB=${stdenv.binutils}/bin/${cross.config}-ranlib" "RANLIB=${targetPackages.stdenv.cc.bintools}/bin/${cross.config}-ranlib"
"--target=${cross.config}" "--target=${cross.config}"
"--enable-bootstrap-with-devel-snapshot" "--enable-bootstrap-with-devel-snapshot"
] ++ ] ++
# fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/ # fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space"; lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space";
buildInputs = commonBuildInputs ++ [ stdenv.ccCross stdenv.binutils ]; buildInputs = commonBuildInputs ++ [ stdenv.ccCross stdenv.targetPackages.stdenv.cc.bintools ];
dontSetConfigureCross = true; dontSetConfigureCross = true;
passthru = { passthru = {
inherit bootPkgs cross; inherit bootPkgs cross;
cc = "${stdenv.ccCross}/bin/${cross.config}-cc"; cc = "${stdenv.ccCross}/bin/${cross.config}-cc";
ld = "${stdenv.binutils}/bin/${cross.config}-ld"; ld = "${stdenv.targetPackages.stdenv.cc.bintools}/bin/${cross.config}-ld";
}; };
}) })

View File

@ -1,4 +1,4 @@
{ stdenv, lib, fetchgit, bootPkgs, perl, ncurses, libiconv, binutils, coreutils { stdenv, lib, fetchgit, bootPkgs, perl, ncurses, libiconv, targetPackages, coreutils
, autoconf, automake, happy, alex, python3, buildPlatform, targetPlatform , autoconf, automake, happy, alex, python3, buildPlatform, targetPlatform
, selfPkgs, cross ? null , selfPkgs, cross ? null
@ -71,7 +71,7 @@ in stdenv.mkDerivation (rec {
for i in "$out/bin/"*; do for i in "$out/bin/"*; do
test ! -h $i || continue test ! -h $i || continue
egrep --quiet '^#!' <(head -n 1 $i) || continue egrep --quiet '^#!' <(head -n 1 $i) || continue
sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ binutils coreutils ]}"' $i sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
done done
''; '';

View File

@ -1,4 +1,4 @@
{ stdenv, fetchgit, bootPkgs, perl, gmp, ncurses, binutils, autoconf, alex, happy, makeStaticLibraries { stdenv, fetchgit, bootPkgs, perl, gmp, ncurses, targetPackages, autoconf, alex, happy, makeStaticLibraries
, hscolour, xen, automake, gcc, git, zlib, libtool, enableIntegerSimple ? false , hscolour, xen, automake, gcc, git, zlib, libtool, enableIntegerSimple ? false
}: }:
@ -17,14 +17,14 @@ stdenv.mkDerivation rec {
sed -i '305 d' Makefile sed -i '305 d' Makefile
sed -i '309,439 d' Makefile # Removes RPM packaging sed -i '309,439 d' Makefile # Removes RPM packaging
sed -i '20 d' src/scripts/halvm-cabal.in sed -i '20 d' src/scripts/halvm-cabal.in
sed -ie 's|ld |${binutils}/bin/ld |g' src/scripts/ldkernel.in sed -ie 's|ld |${targetPackages.stdenv.cc.bintools}/bin/ld |g' src/scripts/ldkernel.in
''; '';
configureFlags = stdenv.lib.optional (!enableIntegerSimple) [ "--enable-gmp" ]; configureFlags = stdenv.lib.optional (!enableIntegerSimple) [ "--enable-gmp" ];
propagatedNativeBuildInputs = [ alex happy ]; propagatedNativeBuildInputs = [ alex happy ];
buildInputs = buildInputs =
let haskellPkgs = [ alex happy bootPkgs.hscolour bootPkgs.cabal-install bootPkgs.haddock bootPkgs.hpc let haskellPkgs = [ alex happy bootPkgs.hscolour bootPkgs.cabal-install bootPkgs.haddock bootPkgs.hpc
]; in [ bootPkgs.ghc ]; in [ bootPkgs.ghc
automake perl git binutils automake perl git targetPackages.stdenv.cc.bintools
autoconf xen zlib ncurses.dev autoconf xen zlib ncurses.dev
libtool gmp ] ++ haskellPkgs; libtool gmp ] ++ haskellPkgs;
preConfigure = '' preConfigure = ''
@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
inherit bootPkgs; inherit bootPkgs;
cross.config = "halvm"; cross.config = "halvm";
cc = "${gcc}/bin/gcc"; cc = "${gcc}/bin/gcc";
ld = "${binutils}/bin/ld"; ld = "${targetPackages.stdenv.cc.bintools}/bin/ld";
}; };
meta = { meta = {

View File

@ -1,5 +1,6 @@
{ stdenv, fetchurl, fetchgit, fetchzip, file, python2, tzdata, procps { stdenv, targetPackages
, llvm, jemalloc, ncurses, darwin, binutils, rustPlatform, git, cmake, curl , fetchurl, fetchgit, fetchzip, file, python2, tzdata, procps
, llvm, jemalloc, ncurses, darwin, rustPlatform, git, cmake, curl
, which, libffi, gdb , which, libffi, gdb
, version , version
, forceBundledLLVM ? false , forceBundledLLVM ? false
@ -49,7 +50,7 @@ stdenv.mkDerivation {
++ [ "--enable-local-rust" "--local-rust-root=${rustPlatform.rust.rustc}" "--enable-rpath" ] ++ [ "--enable-local-rust" "--local-rust-root=${rustPlatform.rust.rustc}" "--enable-rpath" ]
++ [ "--enable-vendor" "--disable-locked-deps" ] ++ [ "--enable-vendor" "--disable-locked-deps" ]
# ++ [ "--jemalloc-root=${jemalloc}/lib" # ++ [ "--jemalloc-root=${jemalloc}/lib"
++ [ "--default-linker=${stdenv.cc}/bin/cc" "--default-ar=${binutils.out}/bin/ar" ] ++ [ "--default-linker=${targetPackages.stdenv.cc}/bin/cc" "--default-ar=${targetPackages.stdenv.cc.bintools}/bin/ar" ]
++ optional (!forceBundledLLVM) [ "--enable-llvm-link-shared" ] ++ optional (!forceBundledLLVM) [ "--enable-llvm-link-shared" ]
++ optional (stdenv.cc.cc ? isClang) "--enable-clang" ++ optional (stdenv.cc.cc ? isClang) "--enable-clang"
++ optional (targets != []) "--target=${target}" ++ optional (targets != []) "--target=${target}"

View File

@ -1,4 +1,5 @@
{ stdenv { stdenv
, targetPackages
, cmake , cmake
, coreutils , coreutils
, glibc , glibc
@ -26,7 +27,6 @@
, rsync , rsync
, git , git
, libgit2 , libgit2
, binutils
, fetchFromGitHub , fetchFromGitHub
, paxctl , paxctl
, findutils , findutils
@ -250,7 +250,7 @@ stdenv.mkDerivation rec {
# TODO: Use wrappers to get these on the PATH for swift tools, instead # TODO: Use wrappers to get these on the PATH for swift tools, instead
ln -s ${clang}/bin/* $out/bin/ ln -s ${clang}/bin/* $out/bin/
ln -s ${binutils}/bin/ar $out/bin/ar ln -s ${targetPackages.stdenv.cc.bintools}/bin/ar $out/bin/ar
''; '';
# Hack to avoid TMPDIR in RPATHs. # Hack to avoid TMPDIR in RPATHs.

View File

@ -47,13 +47,13 @@ stageFuns: let
same as same as
let let
f_-1 = lnul; f_-1 = lnul f_0;
f_0 = op f_-1 x_0 f_1; f_0 = op f_-1 x_0 f_1;
f_1 = op f_0 x_1 f_2; f_1 = op f_0 x_1 f_2;
f_2 = op f_1 x_2 f_3; f_2 = op f_1 x_2 f_3;
... ...
f_n = op f_n-1 x_n f_n+1; f_n = op f_n-1 x_n f_n+1;
f_n+1 = rnul; f_n+1 = rnul f_n;
in in
f_0 f_0
*/ */
@ -62,13 +62,15 @@ stageFuns: let
len = builtins.length list; len = builtins.length list;
go = pred: n: go = pred: n:
if n == len if n == len
then rnul then rnul pred
else let else let
# Note the cycle -- call-by-need ensures finite fold. # Note the cycle -- call-by-need ensures finite fold.
cur = op pred (builtins.elemAt list n) succ; cur = op pred (builtins.elemAt list n) succ;
succ = go cur (n + 1); succ = go cur (n + 1);
in cur; in cur;
in go lnul 0; lapp = lnul cur;
cur = go lapp 0;
in cur;
# Take the list and disallow custom overrides in all but the final stage, # Take the list and disallow custom overrides in all but the final stage,
# and allow it in the final flag. Only defaults this boolean field if it # and allow it in the final flag. Only defaults this boolean field if it
@ -101,4 +103,15 @@ stageFuns: let
targetPackages = if args.selfBuild or true then null else nextStage; targetPackages = if args.selfBuild or true then null else nextStage;
}); });
in dfold folder {} {} withAllowCustomOverrides # This is a hack for resolving cross-compiled compilers' run-time
# deps. (That is, compilers that are themselves cross-compiled, as
# opposed to used to cross-compile packages.)
postStage = buildPackages: {
__raw = true;
stdenv.cc =
if buildPackages.stdenv.cc.isClang or false
then buildPackages.clang
else buildPackages.gcc;
};
in dfold folder postStage (_: {}) withAllowCustomOverrides