diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2017-12-29 14:23:05 -0500 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2017-12-29 14:23:05 -0500 |
commit | 2365e2ffcd1ecd95bda8a81fe7de32edc1073b35 (patch) | |
tree | 6671ba9c8e2a043f79745436beb05f74eec0f564 /pkgs/development/compilers | |
parent | 771bae04e8ebcef3f11a0be55c28a571181aa231 (diff) | |
parent | 51948eab9415fde1825dea5c7d31b99b2e1a0fdb (diff) | |
download | nixlib-2365e2ffcd1ecd95bda8a81fe7de32edc1073b35.tar nixlib-2365e2ffcd1ecd95bda8a81fe7de32edc1073b35.tar.gz nixlib-2365e2ffcd1ecd95bda8a81fe7de32edc1073b35.tar.bz2 nixlib-2365e2ffcd1ecd95bda8a81fe7de32edc1073b35.tar.lz nixlib-2365e2ffcd1ecd95bda8a81fe7de32edc1073b35.tar.xz nixlib-2365e2ffcd1ecd95bda8a81fe7de32edc1073b35.tar.zst nixlib-2365e2ffcd1ecd95bda8a81fe7de32edc1073b35.zip |
Merge commit '51948eab9415fde1825dea5c7d31b99b2e1a0fdb' into mingw32-w64-fix
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r-- | pkgs/development/compilers/gcc/4.5/default.nix | 6 | ||||
-rw-r--r-- | pkgs/development/compilers/gcc/4.8/default.nix | 6 | ||||
-rw-r--r-- | pkgs/development/compilers/gcc/4.9/default.nix | 6 | ||||
-rw-r--r-- | pkgs/development/compilers/gcc/5/default.nix | 12 | ||||
-rw-r--r-- | pkgs/development/compilers/gcc/6/default.nix | 6 | ||||
-rw-r--r-- | pkgs/development/compilers/gcc/7/default.nix | 6 | ||||
-rw-r--r-- | pkgs/development/compilers/gcc/builder.sh | 5 | ||||
-rw-r--r-- | pkgs/development/compilers/gcc/snapshot/default.nix | 6 | ||||
-rw-r--r-- | pkgs/development/compilers/ghc/head.nix | 18 | ||||
-rw-r--r-- | pkgs/development/compilers/rust/rustc.nix | 4 |
10 files changed, 38 insertions, 37 deletions
diff --git a/pkgs/development/compilers/gcc/4.5/default.nix b/pkgs/development/compilers/gcc/4.5/default.nix index e7cf6b1f1f1d..fa4563136cad 100644 --- a/pkgs/development/compilers/gcc/4.5/default.nix +++ b/pkgs/development/compilers/gcc/4.5/default.nix @@ -25,6 +25,7 @@ , libpthread ? null, libpthreadCross ? null # required for GNU/Hurd , stripped ? true , buildPlatform, hostPlatform, targetPlatform +, buildPackages }: assert langJava -> zip != null && unzip != null @@ -275,7 +276,7 @@ stdenv.mkDerivation ({ ) } ${optionalString (!(crossMingw && crossStageStatic)) - "--with-native-system-header-dir=${getDev (stdenv.ccCross or stdenv.cc).libc}/include"} + "--with-native-system-header-dir=${getDev stdenv.cc.libc}/include"} ${ # Trick that should be taken out once we have a mips64el-linux not loongson2f if targetPlatform == hostPlatform && stdenv.system == "mips64el-linux" then "--with-arch=loongson2f" else ""} ${if langAda then " --enable-libada" else ""} @@ -331,8 +332,7 @@ stdenv.mkDerivation ({ dontStrip = true; }; - NIX_BUILD_CC = stdenv.cc; - NIX_CC_CROSS = stdenv.ccCross or null; + NIX_BUILD_CC = buildPackages.stdenv.cc; # Needed for the cross compilation to work AR = "ar"; diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index f7674bb11845..e4d24d6d3ed7 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -33,6 +33,7 @@ , gnused ? null , darwin ? null , buildPlatform, hostPlatform, targetPlatform +, buildPackages }: assert langJava -> zip != null && unzip != null @@ -335,7 +336,7 @@ stdenv.mkDerivation ({ ) } ${optionalString (!(crossMingw && crossStageStatic)) - "--with-native-system-header-dir=${getDev (stdenv.ccCross or stdenv.cc).libc}/include"} + "--with-native-system-header-dir=${getDev stdenv.cc.libc}/include"} ${if langAda then " --enable-libada" else ""} ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""} ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} @@ -400,8 +401,7 @@ stdenv.mkDerivation ({ buildFlags = ""; }; - NIX_BUILD_CC = stdenv.cc; - NIX_CC_CROSS = stdenv.ccCross or null; + NIX_BUILD_CC = buildPackages.stdenv.cc; # Needed for the cross compilation to work AR = "ar"; diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index 05b5ea3a725c..a3c59dec08e6 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -33,6 +33,7 @@ , gnused ? null , darwin ? null , buildPlatform, hostPlatform, targetPlatform +, buildPackages }: assert langJava -> zip != null && unzip != null @@ -341,7 +342,7 @@ stdenv.mkDerivation ({ ) } ${optionalString (!(crossMingw && crossStageStatic)) - "--with-native-system-header-dir=${getDev (stdenv.ccCross or stdenv.cc).libc}/include"} + "--with-native-system-header-dir=${getDev stdenv.cc.libc}/include"} ${if langAda then " --enable-libada" else ""} ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""} ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} @@ -406,8 +407,7 @@ stdenv.mkDerivation ({ buildFlags = ""; }; - NIX_BUILD_CC = stdenv.cc; - NIX_CC_CROSS = stdenv.ccCross or null; + NIX_BUILD_CC = buildPackages.stdenv.cc; # Needed for the cross compilation to work AR = "ar"; diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index 10701f687dec..90ed05dff82b 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -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 @@ -356,7 +357,7 @@ stdenv.mkDerivation ({ ) } ${optionalString (!(crossMingw && crossStageStatic)) - "--with-native-system-header-dir=${getDev (stdenv.ccCross or stdenv.cc).libc}/include"} + "--with-native-system-header-dir=${getDev stdenv.cc.libc}/include"} ${if langAda then " --enable-libada" else ""} ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""} ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} @@ -364,7 +365,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; @@ -421,8 +426,7 @@ stdenv.mkDerivation ({ buildFlags = ""; }; - NIX_BUILD_CC = stdenv.cc; - NIX_CC_CROSS = stdenv.ccCross or null; + NIX_BUILD_CC = buildPackages.stdenv.cc; # Needed for the cross compilation to work AR = "ar"; diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index bcee4026c395..8180871f8190 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -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 @@ -338,7 +339,7 @@ stdenv.mkDerivation ({ ) } ${optionalString (!(crossMingw && crossStageStatic)) - "--with-native-system-header-dir=${getDev (stdenv.ccCross or stdenv.cc).libc}/include"} + "--with-native-system-header-dir=${getDev stdenv.cc.libc}/include"} ${if langAda then " --enable-libada" else ""} ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""} ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} @@ -403,8 +404,7 @@ stdenv.mkDerivation ({ buildFlags = ""; }; - NIX_BUILD_CC = stdenv.cc; - NIX_CC_CROSS = stdenv.ccCross or null; + NIX_BUILD_CC = buildPackages.stdenv.cc; # Needed for the cross compilation to work AR = "ar"; diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index ab56adf1a524..7cd9ecf35eab 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -36,6 +36,7 @@ , darwin ? null , flex ? null , buildPlatform, hostPlatform, targetPlatform +, buildPackages }: assert langJava -> zip != null && unzip != null @@ -339,7 +340,7 @@ stdenv.mkDerivation ({ ) } ${optionalString (!(crossMingw && crossStageStatic)) - "--with-native-system-header-dir=${getDev (stdenv.ccCross or stdenv.cc).libc}/include"} + "--with-native-system-header-dir=${getDev stdenv.cc.libc}/include"} ${if langAda then " --enable-libada" else ""} ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""} ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} @@ -404,8 +405,7 @@ stdenv.mkDerivation ({ buildFlags = ""; }; - NIX_BUILD_CC = stdenv.cc; - NIX_CC_CROSS = stdenv.ccCross or null; + NIX_BUILD_CC = buildPackages.stdenv.cc; # Needed for the cross compilation to work AR = "ar"; diff --git a/pkgs/development/compilers/gcc/builder.sh b/pkgs/development/compilers/gcc/builder.sh index 3bc1cb49eec7..d21755d7b1dc 100644 --- a/pkgs/development/compilers/gcc/builder.sh +++ b/pkgs/development/compilers/gcc/builder.sh @@ -5,11 +5,6 @@ oldOpts="$(shopt -po nounset)" || true set -euo pipefail -if test -n "${NIX_CC_CROSS-}"; then - export NIX_CC="$NIX_CC_CROSS" -fi - - export NIX_FIXINC_DUMMY="$NIX_BUILD_TOP/dummy" mkdir "$NIX_FIXINC_DUMMY" diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix index 09d4f8af869b..53217d4636c3 100644 --- a/pkgs/development/compilers/gcc/snapshot/default.nix +++ b/pkgs/development/compilers/gcc/snapshot/default.nix @@ -36,6 +36,7 @@ , darwin ? null , flex ? null , buildPlatform, hostPlatform, targetPlatform +, buildPackages }: assert langJava -> zip != null && unzip != null @@ -339,7 +340,7 @@ stdenv.mkDerivation ({ ) } ${optionalString (!(crossMingw && crossStageStatic)) - "--with-native-system-header-dir=${getDev (stdenv.ccCross or stdenv.cc).libc}/include"} + "--with-native-system-header-dir=${getDev stdenv.cc.libc}/include"} ${if langAda then " --enable-libada" else ""} ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""} ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} @@ -404,8 +405,7 @@ stdenv.mkDerivation ({ buildFlags = ""; }; - NIX_BUILD_CC = stdenv.cc; - NIX_CC_CROSS = stdenv.ccCross or null; + NIX_BUILD_CC = buildPackages.stdenv.cc; # Needed for the cross compilation to work AR = "ar"; diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix index 53069619ffb0..f199048353c0 100644 --- a/pkgs/development/compilers/ghc/head.nix +++ b/pkgs/development/compilers/ghc/head.nix @@ -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"; }; }) diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix index 4e0d0971cb66..717c0092c946 100644 --- a/pkgs/development/compilers/rust/rustc.nix +++ b/pkgs/development/compilers/rust/rustc.nix @@ -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 |