Merge commit 'c9ca54199409324101bdee38f5b16e7656a16a22' into gcc-modernize-builder

This commit is contained in:
John Ericson
2017-12-07 01:42:35 -05:00
57 changed files with 554 additions and 923 deletions

View File

@@ -35,6 +35,7 @@
, cloog # unused; just for compat with gcc4, as we override the parameter on some places
, darwin ? null
, buildPlatform, hostPlatform, targetPlatform
, buildPackages
}:
assert langJava -> zip != null && unzip != null
@@ -294,6 +295,7 @@ stdenv.mkDerivation ({
++ (optionals langJava [ boehmgc zip unzip ])
++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs))
++ (optionals (targetPlatform != hostPlatform) [binutils])
++ (optionals (buildPlatform != hostPlatform) [buildPackages.stdenv.cc])
++ (optionals langAda [gnatboot])
++ (optionals langVhdl [gnat])
@@ -368,7 +370,11 @@ stdenv.mkDerivation ({
${if targetPlatform == hostPlatform then platformFlags else ""}
" + optionalString
(hostPlatform != buildPlatform)
(platformFlags + " --target=${targetPlatform.config}");
(platformFlags + ''
--build=${buildPlatform.config}
--host=${hostPlatform.config}
--target=${targetPlatform.config}
'');
targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;

View File

@@ -101,26 +101,26 @@ in stdenv.mkDerivation (rec {
'';
configureFlags = [
"CC=${stdenv.ccCross}/bin/${cross.config}-cc"
"LD=${stdenv.binutils}/bin/${cross.config}-ld"
"AR=${stdenv.binutils}/bin/${cross.config}-ar"
"NM=${stdenv.binutils}/bin/${cross.config}-nm"
"RANLIB=${stdenv.binutils}/bin/${cross.config}-ranlib"
"CC=${stdenv.cc}/bin/${cross.config}-cc"
"LD=${stdenv.cc}/bin/${cross.config}-ld"
"AR=${stdenv.cc}/bin/${cross.config}-ar"
"NM=${stdenv.cc}/bin/${cross.config}-nm"
"RANLIB=${stdenv.cc}/bin/${cross.config}-ranlib"
"--target=${cross.config}"
"--enable-bootstrap-with-devel-snapshot"
] ++
# 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";
buildInputs = commonBuildInputs ++ [ stdenv.ccCross stdenv.binutils ];
buildInputs = commonBuildInputs;
dontSetConfigureCross = true;
configurePlatforms = [];
passthru = {
inherit bootPkgs cross;
cc = "${stdenv.ccCross}/bin/${cross.config}-cc";
cc = "${stdenv.cc}/bin/${cross.config}-cc";
ld = "${stdenv.binutils}/bin/${cross.config}-ld";
ld = "${stdenv.cc}/bin/${cross.config}-ld";
};
})

View File

@@ -10,6 +10,7 @@
, targetPatches
, targetToolchains
, doCheck ? true
, buildPlatform, hostPlatform
} @ args:
let
@@ -137,7 +138,8 @@ stdenv.mkDerivation {
inherit doCheck;
dontSetConfigureCross = true;
${if buildPlatform == hostPlatform then "dontSetConfigureCross" else null} = true;
${if buildPlatform != hostPlatform then "configurePlatforms" else null} = [];
# https://github.com/NixOS/nixpkgs/pull/21742#issuecomment-272305764
# https://github.com/rust-lang/rust/issues/30181