cc-wrapper: Remove stdenv.is*
for targetPlatform.is*
Modify bootstrapping stdenvs to make sure `targetPlatform` also passed.
This commit is contained in:
parent
8f970d09fe
commit
c4ba2e3ef6
@ -10,6 +10,7 @@
|
|||||||
, zlib ? null, extraPackages ? [], extraBuildCommands ? ""
|
, zlib ? null, extraPackages ? [], extraBuildCommands ? ""
|
||||||
, dyld ? null # TODO: should this be a setup-hook on dyld?
|
, dyld ? null # TODO: should this be a setup-hook on dyld?
|
||||||
, isGNU ? false, isClang ? cc.isClang or false, gnugrep ? null
|
, isGNU ? false, isClang ? cc.isClang or false, gnugrep ? null
|
||||||
|
, targetPlatform
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with stdenv.lib;
|
with stdenv.lib;
|
||||||
@ -35,7 +36,7 @@ let
|
|||||||
# The wrapper scripts use 'cat' and 'grep', so we may need coreutils.
|
# The wrapper scripts use 'cat' and 'grep', so we may need coreutils.
|
||||||
coreutils_bin = if nativeTools then "" else getBin coreutils;
|
coreutils_bin = if nativeTools then "" else getBin coreutils;
|
||||||
|
|
||||||
default_cxx_stdlib_compile=optionalString (stdenv.isLinux && !(cc.isGNU or false))
|
default_cxx_stdlib_compile=optionalString (targetPlatform.isLinux && !(cc.isGNU or false))
|
||||||
"-isystem $(echo -n ${cc.gcc}/include/c++/*) -isystem $(echo -n ${cc.gcc}/include/c++/*)/$(${cc.gcc}/bin/gcc -dumpmachine)";
|
"-isystem $(echo -n ${cc.gcc}/include/c++/*) -isystem $(echo -n ${cc.gcc}/include/c++/*)/$(${cc.gcc}/bin/gcc -dumpmachine)";
|
||||||
in
|
in
|
||||||
|
|
||||||
@ -78,7 +79,7 @@ stdenv.mkDerivation {
|
|||||||
}
|
}
|
||||||
''
|
''
|
||||||
|
|
||||||
+ optionalString (!nativeLibc) (if (!stdenv.isDarwin) then ''
|
+ optionalString (!nativeLibc) (if (!targetPlatform.isDarwin) then ''
|
||||||
dynamicLinker="${libc_lib}/lib/$dynamicLinker"
|
dynamicLinker="${libc_lib}/lib/$dynamicLinker"
|
||||||
echo $dynamicLinker > $out/nix-support/dynamic-linker
|
echo $dynamicLinker > $out/nix-support/dynamic-linker
|
||||||
|
|
||||||
@ -117,7 +118,7 @@ stdenv.mkDerivation {
|
|||||||
''
|
''
|
||||||
|
|
||||||
+ (if nativeTools then ''
|
+ (if nativeTools then ''
|
||||||
ccPath="${if stdenv.isDarwin then cc else nativePrefix}/bin"
|
ccPath="${if targetPlatform.isDarwin then cc else nativePrefix}/bin"
|
||||||
ldPath="${nativePrefix}/bin"
|
ldPath="${nativePrefix}/bin"
|
||||||
'' else ''
|
'' else ''
|
||||||
echo $cc > $out/nix-support/orig-cc
|
echo $cc > $out/nix-support/orig-cc
|
||||||
@ -166,7 +167,7 @@ stdenv.mkDerivation {
|
|||||||
echo ${toString extraPackages} > $out/nix-support/propagated-native-build-inputs
|
echo ${toString extraPackages} > $out/nix-support/propagated-native-build-inputs
|
||||||
''
|
''
|
||||||
|
|
||||||
+ optionalString (stdenv.isSunOS && nativePrefix != "") ''
|
+ optionalString (targetPlatform.isSunOS && nativePrefix != "") ''
|
||||||
# Solaris needs an additional ld wrapper.
|
# Solaris needs an additional ld wrapper.
|
||||||
ldPath="${nativePrefix}/bin"
|
ldPath="${nativePrefix}/bin"
|
||||||
exec="$ldPath/ld"
|
exec="$ldPath/ld"
|
||||||
@ -271,7 +272,7 @@ stdenv.mkDerivation {
|
|||||||
(if stdenv.system == "i686-linux" then "ld-linux.so.2" else
|
(if stdenv.system == "i686-linux" then "ld-linux.so.2" else
|
||||||
if stdenv.system == "x86_64-linux" then "ld-linux-x86-64.so.2" else
|
if stdenv.system == "x86_64-linux" then "ld-linux-x86-64.so.2" else
|
||||||
# ARM with a wildcard, which can be "" or "-armhf".
|
# ARM with a wildcard, which can be "" or "-armhf".
|
||||||
if stdenv.isArm then "ld-linux*.so.3" else
|
if targetPlatform.isArm32 then "ld-linux*.so.3" else
|
||||||
if stdenv.system == "aarch64-linux" then "ld-linux-aarch64.so.1" else
|
if stdenv.system == "aarch64-linux" then "ld-linux-aarch64.so.1" else
|
||||||
if stdenv.system == "powerpc-linux" then "ld.so.1" else
|
if stdenv.system == "powerpc-linux" then "ld.so.1" else
|
||||||
if stdenv.system == "mips64el-linux" then "ld.so.1" else
|
if stdenv.system == "mips64el-linux" then "ld.so.1" else
|
||||||
|
@ -73,6 +73,7 @@ in rec {
|
|||||||
nativeTools = true;
|
nativeTools = true;
|
||||||
nativePrefix = bootstrapTools;
|
nativePrefix = bootstrapTools;
|
||||||
nativeLibc = false;
|
nativeLibc = false;
|
||||||
|
targetPlatform = localSystem;
|
||||||
libc = last.pkgs.darwin.Libsystem;
|
libc = last.pkgs.darwin.Libsystem;
|
||||||
isClang = true;
|
isClang = true;
|
||||||
cc = { name = "clang-9.9.9"; outPath = bootstrapTools; };
|
cc = { name = "clang-9.9.9"; outPath = bootstrapTools; };
|
||||||
@ -295,6 +296,7 @@ in rec {
|
|||||||
inherit shell;
|
inherit shell;
|
||||||
nativeTools = false;
|
nativeTools = false;
|
||||||
nativeLibc = false;
|
nativeLibc = false;
|
||||||
|
targetPlatform = localSystem;
|
||||||
inherit (pkgs) coreutils binutils gnugrep;
|
inherit (pkgs) coreutils binutils gnugrep;
|
||||||
inherit (pkgs.darwin) dyld;
|
inherit (pkgs.darwin) dyld;
|
||||||
cc = pkgs.llvmPackages.clang-unwrapped;
|
cc = pkgs.llvmPackages.clang-unwrapped;
|
||||||
|
@ -77,6 +77,7 @@ let inherit (localSystem) system; in
|
|||||||
nativeTools = true;
|
nativeTools = true;
|
||||||
nativePrefix = "/usr";
|
nativePrefix = "/usr";
|
||||||
nativeLibc = true;
|
nativeLibc = true;
|
||||||
|
targetPlatform = localSystem;
|
||||||
inherit (prevStage) stdenv;
|
inherit (prevStage) stdenv;
|
||||||
cc = {
|
cc = {
|
||||||
name = "clang-9.9.9";
|
name = "clang-9.9.9";
|
||||||
|
@ -76,6 +76,7 @@ let
|
|||||||
else lib.makeOverridable (import ../../build-support/cc-wrapper) {
|
else lib.makeOverridable (import ../../build-support/cc-wrapper) {
|
||||||
nativeTools = false;
|
nativeTools = false;
|
||||||
nativeLibc = false;
|
nativeLibc = false;
|
||||||
|
targetPlatform = localSystem;
|
||||||
cc = prevStage.gcc-unwrapped;
|
cc = prevStage.gcc-unwrapped;
|
||||||
isGNU = true;
|
isGNU = true;
|
||||||
libc = prevStage.glibc;
|
libc = prevStage.glibc;
|
||||||
@ -239,6 +240,7 @@ in
|
|||||||
nativeTools = false;
|
nativeTools = false;
|
||||||
nativeLibc = false;
|
nativeLibc = false;
|
||||||
isGNU = true;
|
isGNU = true;
|
||||||
|
targetPlatform = localSystem;
|
||||||
cc = prevStage.gcc-unwrapped;
|
cc = prevStage.gcc-unwrapped;
|
||||||
libc = self.glibc;
|
libc = self.glibc;
|
||||||
inherit (self) stdenv binutils coreutils gnugrep;
|
inherit (self) stdenv binutils coreutils gnugrep;
|
||||||
|
@ -125,6 +125,7 @@ in
|
|||||||
"i686-solaris" = "/usr/gnu";
|
"i686-solaris" = "/usr/gnu";
|
||||||
"x86_64-solaris" = "/opt/local/gcc47";
|
"x86_64-solaris" = "/opt/local/gcc47";
|
||||||
}.${system} or "/usr";
|
}.${system} or "/usr";
|
||||||
|
targetPlatform = localSystem;
|
||||||
inherit stdenv;
|
inherit stdenv;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ bootStages ++ [
|
|||||||
nativeTools = false;
|
nativeTools = false;
|
||||||
nativePrefix = stdenv.lib.optionalString hostPlatform.isSunOS "/usr";
|
nativePrefix = stdenv.lib.optionalString hostPlatform.isSunOS "/usr";
|
||||||
nativeLibc = true;
|
nativeLibc = true;
|
||||||
|
targetPlatform = localSystem;
|
||||||
inherit stdenv;
|
inherit stdenv;
|
||||||
inherit (prevStage) binutils coreutils gnugrep;
|
inherit (prevStage) binutils coreutils gnugrep;
|
||||||
cc = prevStage.gcc.cc;
|
cc = prevStage.gcc.cc;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user