Merge remote-tracking branch 'upstream/staging' into gcc-7
Conflicts: pkgs/development/libraries/libidn/default.nix pkgs/top-level/all-packages.nix
This commit is contained in:
@@ -6,16 +6,28 @@
|
||||
{ lib
|
||||
, localSystem, crossSystem, config, overlays
|
||||
|
||||
, bootstrapFiles ? { # switch
|
||||
"i686-linux" = import ./bootstrap-files/i686.nix;
|
||||
"x86_64-linux" = import ./bootstrap-files/x86_64.nix;
|
||||
"armv5tel-linux" = import ./bootstrap-files/armv5tel.nix;
|
||||
"armv6l-linux" = import ./bootstrap-files/armv6l.nix;
|
||||
"armv7l-linux" = import ./bootstrap-files/armv7l.nix;
|
||||
"aarch64-linux" = import ./bootstrap-files/aarch64.nix;
|
||||
"mips64el-linux" = import ./bootstrap-files/loongson2f.nix;
|
||||
}.${localSystem.system}
|
||||
or (abort "unsupported platform for the pure Linux stdenv")
|
||||
, bootstrapFiles ?
|
||||
let table = {
|
||||
"glibc" = {
|
||||
"i686-linux" = import ./bootstrap-files/i686.nix;
|
||||
"x86_64-linux" = import ./bootstrap-files/x86_64.nix;
|
||||
"armv5tel-linux" = import ./bootstrap-files/armv5tel.nix;
|
||||
"armv6l-linux" = import ./bootstrap-files/armv6l.nix;
|
||||
"armv7l-linux" = import ./bootstrap-files/armv7l.nix;
|
||||
"aarch64-linux" = import ./bootstrap-files/aarch64.nix;
|
||||
"mips64el-linux" = import ./bootstrap-files/loongson2f.nix;
|
||||
};
|
||||
"musl" = {
|
||||
"aarch64-linux" = import ./bootstrap-files/aarch64-musl.nix;
|
||||
"armv6l-linux" = import ./bootstrap-files/armv6l-musl.nix;
|
||||
"x86_64-linux" = import ./bootstrap-files/x86_64-musl.nix;
|
||||
};
|
||||
};
|
||||
archLookupTable = table.${localSystem.libc}
|
||||
or (abort "unsupported libc for the pure Linux stdenv");
|
||||
files = archLookupTable.${localSystem.system}
|
||||
or (abort "unsupported platform for the pure Linux stdenv");
|
||||
in files
|
||||
}:
|
||||
|
||||
assert crossSystem == null;
|
||||
@@ -40,7 +52,9 @@ let
|
||||
|
||||
|
||||
# Download and unpack the bootstrap tools (coreutils, GCC, Glibc, ...).
|
||||
bootstrapTools = import ./bootstrap-tools { inherit system bootstrapFiles; };
|
||||
bootstrapTools = import (if localSystem.libc == "musl" then ./bootstrap-tools-musl else ./bootstrap-tools) { inherit system bootstrapFiles; };
|
||||
|
||||
getLibc = stage: stage.${localSystem.libc};
|
||||
|
||||
|
||||
# This function builds the various standard environments used during
|
||||
@@ -82,7 +96,7 @@ let
|
||||
cc = prevStage.gcc-unwrapped;
|
||||
bintools = prevStage.binutils;
|
||||
isGNU = true;
|
||||
libc = prevStage.glibc;
|
||||
libc = getLibc prevStage;
|
||||
inherit (prevStage) coreutils gnugrep;
|
||||
name = name;
|
||||
stdenvNoCC = prevStage.ccWrapperStdenv;
|
||||
@@ -95,6 +109,7 @@ let
|
||||
|
||||
# stdenv.glibc is used by GCC build to figure out the system-level
|
||||
# /usr/include directory.
|
||||
# TODO: Remove this!
|
||||
inherit (prevStage) glibc;
|
||||
};
|
||||
overrides = self: super: (overrides self super) // { fetchurl = thisStdenv.fetchurlBoot; };
|
||||
@@ -113,7 +128,8 @@ in
|
||||
__raw = true;
|
||||
|
||||
gcc-unwrapped = null;
|
||||
glibc = null;
|
||||
glibc = assert false; null;
|
||||
musl = assert false; null;
|
||||
binutils = null;
|
||||
coreutils = null;
|
||||
gnugrep = null;
|
||||
@@ -135,12 +151,15 @@ in
|
||||
# will search the Glibc headers before the GCC headers). So
|
||||
# create a dummy Glibc here, which will be used in the stdenv of
|
||||
# stage1.
|
||||
glibc = self.stdenv.mkDerivation {
|
||||
name = "bootstrap-glibc";
|
||||
${localSystem.libc} = self.stdenv.mkDerivation {
|
||||
name = "bootstrap-${localSystem.libc}";
|
||||
buildCommand = ''
|
||||
mkdir -p $out
|
||||
ln -s ${bootstrapTools}/lib $out/lib
|
||||
'' + lib.optionalString (localSystem.libc == "glibc") ''
|
||||
ln -s ${bootstrapTools}/include-glibc $out/include
|
||||
'' + lib.optionalString (localSystem.libc == "musl") ''
|
||||
ln -s ${bootstrapTools}/include-libc $out/include
|
||||
'';
|
||||
};
|
||||
gcc-unwrapped = bootstrapTools;
|
||||
@@ -148,7 +167,7 @@ in
|
||||
nativeTools = false;
|
||||
nativeLibc = false;
|
||||
buildPackages = { };
|
||||
libc = self.glibc;
|
||||
libc = getLibc self;
|
||||
inherit (self) stdenvNoCC coreutils gnugrep;
|
||||
bintools = bootstrapTools;
|
||||
name = "bootstrap-binutils-wrapper";
|
||||
@@ -177,7 +196,9 @@ in
|
||||
binutils = super.binutils_nogold;
|
||||
inherit (prevStage)
|
||||
ccWrapperStdenv
|
||||
glibc gcc-unwrapped coreutils gnugrep;
|
||||
gcc-unwrapped coreutils gnugrep;
|
||||
|
||||
${localSystem.libc} = getLibc prevStage;
|
||||
|
||||
# A threaded perl build needs glibc/libpthread_nonshared.a,
|
||||
# which is not included in bootstrapTools, so disable threading.
|
||||
@@ -203,7 +224,7 @@ in
|
||||
binutils = prevStage.binutils.override {
|
||||
# Rewrap the binutils with the new glibc, so both the next
|
||||
# stage's wrappers use it.
|
||||
libc = self.glibc;
|
||||
libc = getLibc self;
|
||||
};
|
||||
};
|
||||
})
|
||||
@@ -218,8 +239,9 @@ in
|
||||
overrides = self: super: rec {
|
||||
inherit (prevStage)
|
||||
ccWrapperStdenv
|
||||
binutils glibc coreutils gnugrep
|
||||
binutils coreutils gnugrep
|
||||
perl patchelf linuxHeaders gnum4 bison;
|
||||
${localSystem.libc} = getLibc prevStage;
|
||||
# Link GCC statically against GMP etc. This makes sense because
|
||||
# these builds of the libraries are only used by GCC, so it
|
||||
# reduces the size of the stdenv closure.
|
||||
@@ -247,8 +269,8 @@ in
|
||||
# because gcc (since JAR support) already depends on zlib, and
|
||||
# then if we already have a zlib we want to use that for the
|
||||
# other purposes (binutils and top-level pkgs) too.
|
||||
inherit (prevStage) gettext gnum4 bison gmp perl glibc zlib linuxHeaders;
|
||||
|
||||
inherit (prevStage) gettext gnum4 bison gmp perl zlib linuxHeaders;
|
||||
${localSystem.libc} = getLibc prevStage;
|
||||
binutils = super.binutils.override {
|
||||
# Don't use stdenv's shell but our own
|
||||
shell = self.bash + "/bin/bash";
|
||||
@@ -267,7 +289,7 @@ in
|
||||
};
|
||||
cc = prevStage.gcc-unwrapped;
|
||||
bintools = self.binutils;
|
||||
libc = self.glibc;
|
||||
libc = getLibc self;
|
||||
inherit (self) stdenvNoCC coreutils gnugrep;
|
||||
name = "";
|
||||
shell = self.bash + "/bin/bash";
|
||||
@@ -314,7 +336,9 @@ in
|
||||
inherit (prevStage.stdenv) fetchurlBoot;
|
||||
|
||||
extraAttrs = {
|
||||
# TODO: remove this!
|
||||
inherit (prevStage) glibc;
|
||||
|
||||
inherit platform bootstrapTools;
|
||||
shellPackage = prevStage.bash;
|
||||
};
|
||||
@@ -332,18 +356,20 @@ in
|
||||
++ lib.optional (gawk.libsigsegv != null) gawk.libsigsegv
|
||||
)
|
||||
# More complicated cases
|
||||
++ [
|
||||
glibc.out glibc.dev glibc.bin/*propagated from .dev*/ linuxHeaders
|
||||
++ (map (x: getOutput x (getLibc prevStage)) [ "out" "dev" "bin" ] )
|
||||
++ [ /*propagated from .dev*/ linuxHeaders
|
||||
binutils gcc gcc.cc gcc.cc.lib gcc.expand-response-params
|
||||
]
|
||||
++ lib.optional (localSystem.libc == "musl") libiconv
|
||||
++ lib.optionals localSystem.isAarch64
|
||||
[ prevStage.updateAutotoolsGnuConfigScriptsHook prevStage.gnu-config ];
|
||||
|
||||
overrides = self: super: {
|
||||
inherit (prevStage)
|
||||
gzip bzip2 xz bash coreutils diffutils findutils gawk
|
||||
glibc gnumake gnused gnutar gnugrep gnupatch patchelf
|
||||
gnumake gnused gnutar gnugrep gnupatch patchelf
|
||||
attr acl paxctl zlib pcre;
|
||||
${localSystem.libc} = getLibc prevStage;
|
||||
} // lib.optionalAttrs (super.targetPlatform == localSystem) {
|
||||
# Need to get rid of these when cross-compiling.
|
||||
inherit (prevStage) binutils binutils-raw;
|
||||
|
||||
Reference in New Issue
Block a user