Merge commit '198dceccbe5414a5fd72ca83624c0cc715db1aad' into gcc-simplify-flags
This commit is contained in:
@@ -326,7 +326,7 @@ stdenv.mkDerivation ({
|
||||
CC_FOR_TARGET = "${targetPlatform.config}-gcc";
|
||||
CXX_FOR_TARGET = "${targetPlatform.config}-g++";
|
||||
# If we are making a cross compiler, cross != null
|
||||
NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else "";
|
||||
NIX_CC_CROSS = optionalString (targetPlatform == hostPlatform) builtins.toString stdenv.cc;
|
||||
dontStrip = true;
|
||||
};
|
||||
|
||||
|
||||
@@ -403,7 +403,7 @@ stdenv.mkDerivation ({
|
||||
CC_FOR_TARGET = "${targetPlatform.config}-gcc";
|
||||
CXX_FOR_TARGET = "${targetPlatform.config}-g++";
|
||||
# If we are making a cross compiler, cross != null
|
||||
NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else "";
|
||||
NIX_CC_CROSS = optionalString (targetPlatform == hostPlatform) builtins.toString stdenv.cc;
|
||||
dontStrip = true;
|
||||
buildFlags = "";
|
||||
};
|
||||
|
||||
@@ -409,7 +409,7 @@ stdenv.mkDerivation ({
|
||||
CC_FOR_TARGET = "${targetPlatform.config}-gcc";
|
||||
CXX_FOR_TARGET = "${targetPlatform.config}-g++";
|
||||
# If we are making a cross compiler, cross != null
|
||||
NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else "";
|
||||
NIX_CC_CROSS = optionalString (targetPlatform == hostPlatform) builtins.toString stdenv.cc;
|
||||
dontStrip = true;
|
||||
buildFlags = "";
|
||||
};
|
||||
|
||||
@@ -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])
|
||||
|
||||
@@ -371,7 +373,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;
|
||||
|
||||
@@ -424,7 +430,7 @@ stdenv.mkDerivation ({
|
||||
CC_FOR_TARGET = "${targetPlatform.config}-gcc";
|
||||
CXX_FOR_TARGET = "${targetPlatform.config}-g++";
|
||||
# If we are making a cross compiler, cross != null
|
||||
NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else "";
|
||||
NIX_CC_CROSS = optionalString (targetPlatform == hostPlatform) builtins.toString stdenv.cc;
|
||||
dontStrip = true;
|
||||
buildFlags = "";
|
||||
};
|
||||
|
||||
@@ -406,7 +406,7 @@ stdenv.mkDerivation ({
|
||||
CC_FOR_TARGET = "${targetPlatform.config}-gcc";
|
||||
CXX_FOR_TARGET = "${targetPlatform.config}-g++";
|
||||
# If we are making a cross compiler, cross != null
|
||||
NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else "";
|
||||
NIX_CC_CROSS = optionalString (targetPlatform == hostPlatform) builtins.toString stdenv.cc;
|
||||
dontStrip = true;
|
||||
buildFlags = "";
|
||||
};
|
||||
|
||||
@@ -407,7 +407,7 @@ stdenv.mkDerivation ({
|
||||
CC_FOR_TARGET = "${targetPlatform.config}-gcc";
|
||||
CXX_FOR_TARGET = "${targetPlatform.config}-g++";
|
||||
# If we are making a cross compiler, cross != null
|
||||
NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else "";
|
||||
NIX_CC_CROSS = optionalString (targetPlatform == hostPlatform) builtins.toString stdenv.cc;
|
||||
dontStrip = true;
|
||||
buildFlags = "";
|
||||
};
|
||||
|
||||
@@ -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";
|
||||
};
|
||||
})
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user