Merge #29617: cc-wrapper: Use stdenvNoCC to build

This commit is contained in:
Vladimír Čunát 2017-09-26 21:01:05 +02:00
commit ef35406c09
No known key found for this signature in database
GPG Key ID: E747DF1F9575A3AA
7 changed files with 18 additions and 19 deletions

View File

@ -5,15 +5,15 @@
# script that sets up the right environment variables so that the # script that sets up the right environment variables so that the
# compiler and the linker just "work". # compiler and the linker just "work".
{ name ? "", stdenv, nativeTools, noLibc ? false, nativeLibc, nativePrefix ? "" { name ? "", stdenvNoCC, nativeTools, noLibc ? false, nativeLibc, nativePrefix ? ""
, cc ? null, libc ? null, binutils ? null, coreutils ? null, shell ? stdenv.shell , cc ? null, libc ? null, binutils ? null, coreutils ? null, shell ? stdenvNoCC.shell
, zlib ? null, extraPackages ? [], extraBuildCommands ? "" , zlib ? null, extraPackages ? [], extraBuildCommands ? ""
, isGNU ? false, isClang ? cc.isClang or false, gnugrep ? null , isGNU ? false, isClang ? cc.isClang or false, gnugrep ? null
, buildPackages ? {} , buildPackages ? {}
, useMacosReexportHack ? false , useMacosReexportHack ? false
}: }:
with stdenv.lib; with stdenvNoCC.lib;
assert nativeTools -> nativePrefix != ""; assert nativeTools -> nativePrefix != "";
assert !nativeTools -> assert !nativeTools ->
@ -25,6 +25,7 @@ assert (noLibc || nativeLibc) == (libc == null);
assert cc.langVhdl or false -> zlib != null; assert cc.langVhdl or false -> zlib != null;
let let
stdenv = stdenvNoCC;
inherit (stdenv) hostPlatform targetPlatform; inherit (stdenv) hostPlatform targetPlatform;
# Prefix for binaries. Customarily ends with a dash separator. # Prefix for binaries. Customarily ends with a dash separator.

View File

@ -77,7 +77,7 @@ in rec {
cc = if isNull last then "/dev/null" else import ../../build-support/cc-wrapper { cc = if isNull last then "/dev/null" else import ../../build-support/cc-wrapper {
inherit shell; inherit shell;
inherit (last) stdenv; inherit (last) stdenvNoCC;
nativeTools = false; nativeTools = false;
nativeLibc = false; nativeLibc = false;
@ -324,7 +324,7 @@ in rec {
shell = "${pkgs.bash}/bin/bash"; shell = "${pkgs.bash}/bin/bash";
cc = lib.callPackageWith {} ../../build-support/cc-wrapper { cc = lib.callPackageWith {} ../../build-support/cc-wrapper {
inherit (pkgs) stdenv; inherit (pkgs) stdenvNoCC;
inherit shell; inherit shell;
nativeTools = false; nativeTools = false;
nativeLibc = false; nativeLibc = false;

View File

@ -77,7 +77,7 @@ let inherit (localSystem) system; in
nativeTools = true; nativeTools = true;
nativePrefix = "/usr"; nativePrefix = "/usr";
nativeLibc = true; nativeLibc = true;
inherit (prevStage) stdenv; stdenvNoCC = prevStage.stdenv;
cc = { cc = {
name = "clang-9.9.9"; name = "clang-9.9.9";
cc = "/usr"; cc = "/usr";

View File

@ -84,7 +84,7 @@ let
libc = prevStage.glibc; libc = prevStage.glibc;
inherit (prevStage) binutils coreutils gnugrep; inherit (prevStage) binutils coreutils gnugrep;
name = name; name = name;
stdenv = prevStage.ccWrapperStdenv; stdenvNoCC = prevStage.ccWrapperStdenv;
}; };
extraAttrs = { extraAttrs = {
@ -244,7 +244,7 @@ in
}; };
cc = prevStage.gcc-unwrapped; cc = prevStage.gcc-unwrapped;
libc = self.glibc; libc = self.glibc;
inherit (self) stdenv binutils coreutils gnugrep; inherit (self) stdenvNoCC binutils coreutils gnugrep;
name = ""; name = "";
shell = self.bash + "/bin/bash"; shell = self.bash + "/bin/bash";
}; };

View File

@ -117,6 +117,7 @@ in
cc = null; cc = null;
fetchurl = null; fetchurl = null;
}; };
stdenvNoCC = stdenv;
cc = import ../../build-support/cc-wrapper { cc = import ../../build-support/cc-wrapper {
name = "cc-native"; name = "cc-native";
@ -126,7 +127,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";
inherit stdenv; inherit stdenvNoCC;
}; };
fetchurl = import ../../build-support/fetchurl { fetchurl = import ../../build-support/fetchurl {

View File

@ -1,5 +1,5 @@
{ lib { lib
, crossSystem, config , crossSystem, config, overlays
, bootStages , bootStages
, ... , ...
}: }:
@ -7,9 +7,7 @@
assert crossSystem == null; assert crossSystem == null;
bootStages ++ [ bootStages ++ [
(prevStage: let (prevStage: {
inherit (prevStage) stdenv;
in {
inherit config overlays; inherit config overlays;
stdenv = import ../generic rec { stdenv = import ../generic rec {
@ -27,10 +25,9 @@ bootStages ++ [
cc = import ../../build-support/cc-wrapper { cc = import ../../build-support/cc-wrapper {
nativeTools = false; nativeTools = false;
nativePrefix = stdenv.lib.optionalString hostPlatform.isSunOS "/usr"; nativePrefix = lib.optionalString hostPlatform.isSunOS "/usr";
nativeLibc = true; nativeLibc = true;
inherit stdenv; inherit (prevStage) stdenvNoCC binutils coreutils gnugrep;
inherit (prevStage) binutils coreutils gnugrep;
cc = prevStage.gcc.cc; cc = prevStage.gcc.cc;
isGNU = true; isGNU = true;
shell = prevStage.bash + "/bin/sh"; shell = prevStage.bash + "/bin/sh";
@ -38,7 +35,7 @@ bootStages ++ [
shell = prevStage.bash + "/bin/sh"; shell = prevStage.bash + "/bin/sh";
fetchurlBoot = stdenv.fetchurlBoot; fetchurlBoot = prevStage.stdenv.fetchurlBoot;
overrides = self: super: { overrides = self: super: {
inherit cc; inherit cc;

View File

@ -6236,11 +6236,11 @@ with pkgs;
wla-dx = callPackage ../development/compilers/wla-dx { }; wla-dx = callPackage ../development/compilers/wla-dx { };
wrapCCWith = { name ? "", cc, libc, extraBuildCommands ? "" }: ccWrapperFun { wrapCCWith = { name ? "", cc, libc, extraBuildCommands ? "" }: ccWrapperFun rec {
nativeTools = targetPlatform == hostPlatform && stdenv.cc.nativeTools or false; nativeTools = targetPlatform == hostPlatform && stdenv.cc.nativeTools or false;
nativeLibc = targetPlatform == hostPlatform && stdenv.cc.nativeLibc or false; nativeLibc = targetPlatform == hostPlatform && stdenv.cc.nativeLibc or false;
nativePrefix = stdenv.cc.nativePrefix or ""; nativePrefix = stdenv.cc.nativePrefix or "";
noLibc = (libc == null); noLibc = !nativeLibc && (libc == null);
isGNU = cc.isGNU or false; isGNU = cc.isGNU or false;
isClang = cc.isClang or false; isClang = cc.isClang or false;