Merge branch 'master' into closure-size

Beware that stdenv doesn't build. It seems something more will be needed
than just resolution of merge conflicts.
This commit is contained in:
Vladimír Čunát
2016-04-01 10:06:01 +02:00
1108 changed files with 76254 additions and 11297 deletions
+4 -4
View File
@@ -1,12 +1,12 @@
{
busybox = import <nix/fetchurl.nix> {
url = "http://vicerveza.homeunix.net/~viric/tmp/nix/busybox";
sha256 = "1vfadk3d2v0bsvmbaz1pvpn4g1vm7p751hkdxya1lkn5n1a9px5m";
url = http://nixos-arm.dezgeg.me/bootstrap/armv5tel/busybox;
sha256 = "1jdwznkgbkmz0zy58idgrm6prpw8x8wis14dxkxwzbzk7g1l3a2x";
executable = true;
};
bootstrapTools = import <nix/fetchurl.nix> {
url = "http://vicerveza.homeunix.net/~viric/tmp/nix/bootstrap-tools.tar.xz";
sha256 = "39df65053bab50bc2975060c4da177266e263f30c2afba231a97d23f4c471eb8";
url = http://nixos-arm.dezgeg.me/bootstrap/armv5tel/bootstrap-tools.tar.xz;
sha256 = "10rjp7mv6cfh9n2wfifdlaak8wqcmcpmylhn8jn0430ap37qqhb0";
};
}
+4 -4
View File
@@ -1,12 +1,12 @@
{
busybox = import <nix/fetchurl.nix> {
url = https://dl.dropboxusercontent.com/s/4705ffxjrxxqnh2/busybox?dl=0;
sha256 = "032maafy4akcdgccpxdxrza29pkcpm81g8kh1hv8bj2rvssly3z2";
url = http://nixos-arm.dezgeg.me/bootstrap/armv6l/busybox;
sha256 = "12hij075qapim3jaqc8rb2rvjdradc4937i9mkfa27b6ly1injs0";
executable = true;
};
bootstrapTools = import <nix/fetchurl.nix> {
url = https://dl.dropboxusercontent.com/s/pen8ieymeqqdvqn/bootstrap-tools.tar.xz?dl=0;
sha256 = "0kjpjwi6qw82ca02ppsih3bnhc3y150q23k9d56xzscs0xf5d0dv";
url = http://nixos-arm.dezgeg.me/bootstrap/armv6l/bootstrap-tools.tar.xz;
sha256 = "14irgvw2wl2ljqbmdislhw3nakmx6wmlm1xki26rk20q2ciic2il";
};
}
+4 -4
View File
@@ -1,12 +1,12 @@
{
busybox = import <nix/fetchurl.nix> {
url = https://dl.dropboxusercontent.com/s/rowzme529tc5svq/busybox?dl=0;
sha256 = "18793riwv9r1bgz6zv03c84cd0v26gxsm8wd2c7gjrwwyfg46ls4";
url = http://nixos-arm.dezgeg.me/bootstrap/armv7l/busybox;
sha256 = "1279nlh3x93fqpcxi98zycmn3jhly40pab63fwq41ygkna14vw6b";
executable = true;
};
bootstrapTools = import <nix/fetchurl.nix> {
url = https://dl.dropboxusercontent.com/s/3jr4s5449t7zjlj/bootstrap-tools.tar.xz?dl=0;
sha256 = "1qyp871dajz5mi3yaw9sndwh4yrh1jj184wjjwaf6dpr3jir4kyd";
url = http://nixos-arm.dezgeg.me/bootstrap/armv7l/bootstrap-tools.tar.xz;
sha256 = "15sdnsk5dc3qz27p7c4iainziz8f3r7xpg69dpfwfdaq1drw6678";
};
}
+13 -66
View File
@@ -6,26 +6,24 @@
# The function defaults are for easy testing.
{ system ? builtins.currentSystem
, allPackages ? import ../../top-level/all-packages.nix
, allPackages ? import ../../..
, platform ? null, config ? {}, lib ? (import ../../../lib)
, customBootstrapFiles ? null }:
rec {
bootstrapFiles =
if customBootstrapFiles != null then customBootstrapFiles
else if system == "i686-linux" then import ./bootstrap/i686.nix
, bootstrapFiles ?
if system == "i686-linux" then import ./bootstrap/i686.nix
else if system == "x86_64-linux" then import ./bootstrap/x86_64.nix
else if system == "armv5tel-linux" then import ./bootstrap/armv5tel.nix
else if system == "armv6l-linux" then import ./bootstrap/armv6l.nix
else if system == "armv7l-linux" then import ./bootstrap/armv7l.nix
else if system == "mips64el-linux" then import ./bootstrap/loongson2f.nix
else abort "unsupported platform for the pure Linux stdenv";
else abort "unsupported platform for the pure Linux stdenv"
}:
rec {
commonPreHook =
''
export NIX_ENFORCE_PURITY=1
export NIX_ENFORCE_PURITY="''${NIX_ENFORCE_PURITY-1}"
export NIX_ENFORCE_NO_NATIVE="''${NIX_ENFORCE_NO_NATIVE-1}"
${if system == "x86_64-linux" then "NIX_LIB64_IN_SELF_RPATH=1" else ""}
${if system == "mips64el-linux" then "NIX_LIB32_IN_SELF_RPATH=1" else ""}
'';
@@ -190,7 +188,7 @@ rec {
name = "bootstrap-gcc-wrapper";
overrides = pkgs: {
inherit (stage1.pkgs) perl binutils paxctl;
inherit (stage1.pkgs) perl binutils paxctl gnum4 bison;
# This also contains the full, dynamically linked, final Glibc.
};
};
@@ -207,20 +205,16 @@ rec {
name = "bootstrap-gcc-wrapper";
overrides = pkgs: rec {
inherit (stage2.pkgs) binutils glibc perl patchelf linuxHeaders;
inherit (stage2.pkgs) binutils glibc perl patchelf linuxHeaders gnum4 bison;
# 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.
gmp = pkgs.gmp.override { stdenv = pkgs.makeStaticLibraries pkgs.stdenv; };
mpfr = pkgs.mpfr.override { stdenv = pkgs.makeStaticLibraries pkgs.stdenv; };
libmpc = pkgs.libmpc.override { stdenv = pkgs.makeStaticLibraries pkgs.stdenv; };
isl = pkgs.isl.override { stdenv = pkgs.makeStaticLibraries pkgs.stdenv; };
cloog = pkgs.cloog.override {
stdenv = pkgs.makeStaticLibraries pkgs.stdenv;
inherit isl;
};
isl_0_14 = pkgs.isl_0_14.override { stdenv = pkgs.makeStaticLibraries pkgs.stdenv; };
gccPlain = pkgs.gcc.cc.override {
inherit isl cloog;
isl = isl_0_14;
};
};
extraBuildInputs = [ stage2.pkgs.patchelf stage2.pkgs.paxctl ];
@@ -240,7 +234,7 @@ rec {
# 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 (stage3.pkgs) gettext gnum4 gmp perl glibc zlib linuxHeaders;
inherit (stage3.pkgs) gettext gnum4 bison gmp perl glibc zlib linuxHeaders;
gcc = lib.makeOverridable (import ../../build-support/cc-wrapper) {
nativeTools = false;
@@ -311,51 +305,4 @@ rec {
};
};
testBootstrapTools = let
defaultPkgs = allPackages { inherit system platform; };
in derivation {
name = "test-bootstrap-tools";
inherit system;
builder = bootstrapFiles.busybox;
args = [ "ash" "-e" "-c" "eval \"$buildCommand\"" ];
buildCommand = ''
export PATH=${bootstrapTools}/bin
ls -l
mkdir $out
mkdir $out/bin
sed --version
find --version
diff --version
patch --version
make --version
awk --version
grep --version
gcc --version
ldlinux=$(echo ${bootstrapTools}/lib/ld-linux*.so.?)
export CPP="cpp -idirafter ${bootstrapTools}/include-glibc -B${bootstrapTools}"
export CC="gcc -idirafter ${bootstrapTools}/include-glibc -B${bootstrapTools} -Wl,-dynamic-linker,$ldlinux -Wl,-rpath,${bootstrapTools}/lib"
export CXX="g++ -idirafter ${bootstrapTools}/include-glibc -B${bootstrapTools} -Wl,-dynamic-linker,$ldlinux -Wl,-rpath,${bootstrapTools}/lib"
echo '#include <stdio.h>' >> foo.c
echo '#include <limits.h>' >> foo.c
echo 'int main() { printf("Hello World\\n"); return 0; }' >> foo.c
$CC -o $out/bin/foo foo.c
$out/bin/foo
echo '#include <iostream>' >> bar.cc
echo 'int main() { std::cout << "Hello World\\n"; }' >> bar.cc
$CXX -v -o $out/bin/bar bar.cc
$out/bin/bar
tar xvf ${defaultPkgs.hello.src}
cd hello-*
./configure --prefix=$out
make
make install
'';
};
}
@@ -3,7 +3,7 @@
let buildFor = toolsArch: (
let
pkgsFun = import ../../top-level/all-packages.nix;
pkgsFun = import ../../..;
pkgsNoParams = pkgsFun {};
sheevaplugCrossSystem = {
+53 -8
View File
@@ -1,6 +1,6 @@
{ system ? builtins.currentSystem }:
with import ../../top-level/all-packages.nix {inherit system;};
with import ../../.. {inherit system;};
rec {
@@ -164,12 +164,57 @@ rec {
'';
};
test = ((import ./default.nix) {
inherit system;
bootstrapFiles = {
busybox = "${build}/on-server/busybox";
bootstrapTools = "${build}/on-server/bootstrap-tools.tar.xz";
};
customBootstrapFiles = {
busybox = "${build}/on-server/busybox";
bootstrapTools = "${build}/on-server/bootstrap-tools.tar.xz";
};
}).testBootstrapTools;
bootstrapTools = (import ./default.nix {
inherit system bootstrapFiles;
}).bootstrapTools;
test = derivation {
name = "test-bootstrap-tools";
inherit system;
builder = bootstrapFiles.busybox;
args = [ "ash" "-e" "-c" "eval \"$buildCommand\"" ];
buildCommand = ''
export PATH=${bootstrapTools}/bin
ls -l
mkdir $out
mkdir $out/bin
sed --version
find --version
diff --version
patch --version
make --version
awk --version
grep --version
gcc --version
ldlinux=$(echo ${bootstrapTools}/lib/ld-linux*.so.?)
export CPP="cpp -idirafter ${bootstrapTools}/include-glibc -B${bootstrapTools}"
export CC="gcc -idirafter ${bootstrapTools}/include-glibc -B${bootstrapTools} -Wl,-dynamic-linker,$ldlinux -Wl,-rpath,${bootstrapTools}/lib"
export CXX="g++ -idirafter ${bootstrapTools}/include-glibc -B${bootstrapTools} -Wl,-dynamic-linker,$ldlinux -Wl,-rpath,${bootstrapTools}/lib"
echo '#include <stdio.h>' >> foo.c
echo '#include <limits.h>' >> foo.c
echo 'int main() { printf("Hello World\\n"); return 0; }' >> foo.c
$CC -o $out/bin/foo foo.c
$out/bin/foo
echo '#include <iostream>' >> bar.cc
echo 'int main() { std::cout << "Hello World\\n"; }' >> bar.cc
$CXX -v -o $out/bin/bar bar.cc
$out/bin/bar
tar xvf ${hello.src}
cd hello-*
./configure --prefix=$out
make
make install
'';
};
}
@@ -23,7 +23,7 @@ for i in $out/bin/* $out/libexec/gcc/*/*/*; do
if [ -z "${i##*/liblto*}" ]; then continue; fi
echo patching "$i"
LD_LIBRARY_PATH=$out/lib $LD_BINARY \
$out/bin/patchelf --set-interpreter $LD_BINARY --set-rpath $out/lib --force-rpath "$i"
./patchelf --set-interpreter $LD_BINARY --set-rpath $out/lib --force-rpath "$i"
done
for i in $out/lib/librt-*.so $out/lib/libpcre*; do