* Streamline the stdenv bootstrap and resulting closure by removing

some redundant builds (e.g., GMP was built three times).
* Updated GMP to 5.0.2.
* Updated PPL to 0.11.2.
* Remove ad hoc flags to build GCC's dependencies statically.
  Instead, use the ‘makeStaticLibraries’ stdenv adapter.
* Build GMP with C++ support by default.

svn path=/nixpkgs/branches/stdenv-updates/; revision=30891
This commit is contained in:
Eelco Dolstra 2011-12-14 14:31:56 +00:00
parent 9eb4c4ddef
commit cfde88976b
13 changed files with 94 additions and 198 deletions

View File

@ -220,11 +220,6 @@ stdenv.mkDerivation ({
++ (optionals langVhdl [gnat])
;
configureFlagsArray = stdenv.lib.optionals
(ppl != null && ppl.dontDisableStatic == true)
[ "--with-host-libstdcxx=-lstdc++ -lgcc_s"
"--with-stage1-libs=-lstdc++ -lgcc_s" ];
configureFlags = "
${if enableMultilib then "" else "--disable-multilib"}
${if enableShared then "" else "--disable-shared"}

View File

@ -1,15 +1,4 @@
{ fetchurl, stdenv, ppl, static ? false }:
let
# --with-host-libstdcxx helps when *ppl* is built statically.
# But I will suppose that this is statically built only when ppl is also
# statically built.
staticFlags =
assert static -> ppl.dontDisableStatic == true;
if static then " --enable-static --disable-shared --with-host-libstdcxx=-lstdc++" else "";
in
{ fetchurl, stdenv, ppl }:
stdenv.mkDerivation rec {
name = "cloog-ppl-0.15.11";
@ -21,11 +10,10 @@ stdenv.mkDerivation rec {
propagatedBuildInputs = [ ppl ];
configureFlags = "--with-ppl=${ppl}" + staticFlags;
dontDisableStatic = if static then true else false;
configureFlags = "--with-ppl=${ppl}";
crossAttrs = {
configureFlags = "--with-ppl=${ppl.hostDrv}" + staticFlags;
configureFlags = "--with-ppl=${ppl.hostDrv}";
};
doCheck = true;

View File

@ -1,6 +1,4 @@
{ fetchurl, stdenv, gmp, isl, static ? false }:
assert static -> isl.dontDisableStatic;
{ fetchurl, stdenv, gmp, isl }:
stdenv.mkDerivation rec {
name = "cloog-0.16.3";
@ -14,10 +12,7 @@ stdenv.mkDerivation rec {
propagatedBuildInputs = [ isl ];
configureFlags = [ "--with-isl=system" ]
++ (stdenv.lib.optionals static [ "--enable-static" "--disable-shared" ]);
dontDisableStatic = static;
configureFlags = [ "--with-isl=system" ];
doCheck = true;

View File

@ -1,28 +1,19 @@
{stdenv, fetchurl, m4, cxx ? true, static ? false}:
let
staticFlags = stdenv.lib.optionals static
[ "--enable-static" "--disable-shared" ];
in
{ stdenv, fetchurl, m4, cxx ? true }:
stdenv.mkDerivation rec {
name = "gmp-5.0.1";
name = "gmp-5.0.2";
src = fetchurl {
url = "mirror://gnu/gmp/${name}.tar.bz2";
sha256 = "1yrr14l6vvhm1g27y8nb3c75j0i4ii4k1gw7ik08safk3zq119m2";
sha256 = "0a2ch2kpbzrsf3c1pfc6sph87hk2xmwa6np3sn2rzsflzmvdphnv";
};
buildNativeInputs = [m4];
buildNativeInputs = [ m4 ];
configureFlags =
# Build a "fat binary", with routines for several sub-architectures (x86).
[ "--enable-fat" ]
++ (if cxx then [ "--enable-cxx" ] else [ "--disable-cxx" ])
++ staticFlags;
dontDisableStatic = if static then true else false;
++ (if cxx then [ "--enable-cxx" ] else [ "--disable-cxx" ]);
doCheck = true;

View File

@ -1,7 +1,7 @@
{stdenv, fetchurl, gmp, static ? false}:
{ stdenv, fetchurl, gmp }:
stdenv.mkDerivation rec {
name = "isl-0.07"; # CLooG 0.16.3 fails to build with ISL 0.08.
name = "isl-0.07"; # CLooG 0.16.3 fails to build with ISL 0.08.
src = fetchurl {
url = "http://www.kotnet.org/~skimo/isl/${name}.tar.bz2";
@ -10,10 +10,6 @@ stdenv.mkDerivation rec {
buildInputs = [ gmp ];
dontDisableStatic = static;
configureFlags =
stdenv.lib.optionals static [ " --enable-static" "--disable-shared" ];
meta = {
homepage = http://www.kotnet.org/~skimo/isl/;
license = "LGPLv2.1";

View File

@ -1,50 +0,0 @@
{ fetchurl, stdenv, gmpxx, perl, gnum4, static ? false }:
let
version = "0.11";
staticFlags = if static then " --enable-static --disable-shared --disable-watchdog" else "";
in
stdenv.mkDerivation rec {
name = "ppl-${version}";
src = fetchurl {
url = "mirror://gcc/infrastructure/ppl-${version}.tar.gz";
sha256 = "0xqwyaj232gi0pgm6z2rihk6p8l1rngbbibnhmcrbq4jq550clrl";
};
buildNativeInputs = [ perl gnum4 ];
propagatedBuildInputs = [ gmpxx ];
dontDisableStatic = if static then true else false;
configureFlags = staticFlags;
# Beware! It took ~6 hours to compile PPL and run its tests on a 1.2 GHz
# x86_64 box. Nevertheless, being a dependency of GCC, it probably ought
# to be tested.
doCheck = false;
meta = {
description = "PPL: The Parma Polyhedra Library";
longDescription = ''
The Parma Polyhedra Library (PPL) provides numerical abstractions
especially targeted at applications in the field of analysis and
verification of complex systems. These abstractions include convex
polyhedra, defined as the intersection of a finite number of (open or
closed) halfspaces, each described by a linear inequality (strict or
non-strict) with rational coefficients; some special classes of
polyhedra shapes that offer interesting complexity/precision tradeoffs;
and grids which represent regularly spaced points that satisfy a set of
linear congruence relations. The library also supports finite
powersets and products of (any kind of) polyhedra and grids and a mixed
integer linear programming problem solver using an exact-arithmetic
version of the simplex algorithm.
'';
homepage = http://www.cs.unipr.it/ppl/;
license = "GPLv3+";
maintainers = [ stdenv.lib.maintainers.ludo ];
};
}

View File

@ -1,50 +1,49 @@
{ fetchurl, stdenv, gmpxx, perl, gnum4, static ? false }:
{ fetchurl, stdenv, gmpxx, perl, gnum4 }:
let
version = "0.11";
staticFlags = if static then " --enable-static --disable-shared --disable-watchdog" else "";
in
stdenv.mkDerivation rec {
name = "ppl-${version}";
let version = "0.11.2"; in
src = fetchurl {
url = "mirror://gcc/infrastructure/ppl-${version}.tar.gz";
sha256 = "0xqwyaj232gi0pgm6z2rihk6p8l1rngbbibnhmcrbq4jq550clrl";
};
stdenv.mkDerivation rec {
name = "ppl-${version}";
buildNativeInputs = [ perl gnum4 ];
propagatedBuildInputs = [ gmpxx ];
src = fetchurl {
url = "http://bugseng.com/products/ppl/download/ftp/releases/${version}/ppl-${version}.tar.bz2";
sha256 = "1sxviip4yk6gp453pid5scy1ba66dzdpr02i1416yk7lkv0x3yz3";
};
dontDisableStatic = if static then true else false;
configureFlags = staticFlags;
buildNativeInputs = [ perl gnum4 ];
propagatedBuildInputs = [ gmpxx ];
# Beware! It took ~6 hours to compile PPL and run its tests on a 1.2 GHz
# x86_64 box. Nevertheless, being a dependency of GCC, it probably ought
# to be tested.
doCheck = false;
configureFlags = "--disable-watchdog";
meta = {
description = "PPL: The Parma Polyhedra Library";
# Beware! It took ~6 hours to compile PPL and run its tests on a 1.2 GHz
# x86_64 box. Nevertheless, being a dependency of GCC, it probably ought
# to be tested.
doCheck = false;
longDescription = ''
The Parma Polyhedra Library (PPL) provides numerical abstractions
especially targeted at applications in the field of analysis and
verification of complex systems. These abstractions include convex
polyhedra, defined as the intersection of a finite number of (open or
closed) halfspaces, each described by a linear inequality (strict or
non-strict) with rational coefficients; some special classes of
polyhedra shapes that offer interesting complexity/precision tradeoffs;
and grids which represent regularly spaced points that satisfy a set of
linear congruence relations. The library also supports finite
powersets and products of (any kind of) polyhedra and grids and a mixed
integer linear programming problem solver using an exact-arithmetic
version of the simplex algorithm.
'';
enableParallelBuilding = true;
homepage = http://www.cs.unipr.it/ppl/;
meta = {
description = "PPL: The Parma Polyhedra Library";
license = "GPLv3+";
longDescription = ''
The Parma Polyhedra Library (PPL) provides numerical abstractions
especially targeted at applications in the field of analysis and
verification of complex systems. These abstractions include convex
polyhedra, defined as the intersection of a finite number of (open or
closed) halfspaces, each described by a linear inequality (strict or
non-strict) with rational coefficients; some special classes of
polyhedra shapes that offer interesting complexity/precision tradeoffs;
and grids which represent regularly spaced points that satisfy a set of
linear congruence relations. The library also supports finite
powersets and products of (any kind of) polyhedra and grids and a mixed
integer linear programming problem solver using an exact-arithmetic
version of the simplex algorithm.
'';
maintainers = [ stdenv.lib.maintainers.ludo ];
};
}
homepage = http://www.cs.unipr.it/ppl/;
license = "GPLv3+";
maintainers = [ stdenv.lib.maintainers.ludo ];
};
}

View File

@ -45,6 +45,8 @@ stdenv.mkDerivation rec {
+ stdenv.lib.optionalString (cross != null) " --target=${cross.config}"
+ stdenv.lib.optionalString gold " --enable-gold";
enableParallelBuilding = true;
meta = {
description = "GNU Binutils, tools for manipulating binaries (linker, assembler, etc.)";

View File

@ -4,7 +4,7 @@ assert cross == null -> stdenv.isLinux;
let
version = "2.6.35.14";
kernelHeadersBaseConfig = if (cross == null) then
kernelHeadersBaseConfig = if cross == null then
stdenv.platform.kernelHeadersBaseConfig
else
cross.platform.kernelHeadersBaseConfig;

View File

@ -109,13 +109,14 @@ rec {
} // {inherit fetchurl;};
# Return a modified stdenv that enables building static libraries.
enableStaticLibraries = stdenv: stdenv //
# Return a modified stdenv that builds static libraries instead of
# shared libraries.
makeStaticLibraries = stdenv: stdenv //
{ mkDerivation = args: stdenv.mkDerivation (args // {
dontDisableStatic = true;
configureFlags =
(if args ? configureFlags then args.configureFlags else "")
+ " --enable-static";
(if args ? configureFlags then toString args.configureFlags else "")
+ " --enable-static --disable-shared";
});
} // {inherit fetchurl;};

View File

@ -1,6 +1,6 @@
{ system, name, preHook ? null, postHook ? null, initialPath, gcc, shell
, param1 ? "", param2 ? "", param3 ? "", param4 ? "", param5 ? ""
, extraAttrs ? {}, overrides ? {}
, extraAttrs ? {}, overrides ? (pkgs: {})
, # The `fetchurl' to use for downloading curl and its dependencies
# (see all-packages.nix).

View File

@ -5,7 +5,7 @@
# ensuring purity of components produced by it.
# The function defaults are for easy testing.
{ system ? "i686-linux"
{ system ? builtins.currentSystem
, allPackages ? import ../../top-level/all-packages.nix
, platform ? null }:
@ -77,7 +77,7 @@ rec {
# This function builds the various standard environments used during
# the bootstrap.
stdenvBootFun =
{gcc, extraAttrs ? {}, overrides ? {}, extraPath ? [], fetchurl}:
{gcc, extraAttrs ? {}, overrides ? (pkgs: {}), extraPath ? [], fetchurl}:
import ../generic {
inherit system;
@ -97,7 +97,7 @@ rec {
# Having the proper 'platform' in all the stdenvs allows getting proper
# linuxHeaders for example.
extraAttrs = extraAttrs // { inherit platform; };
overrides = overrides // {
overrides = pkgs: (overrides pkgs) // {
inherit fetchurl;
};
};
@ -156,23 +156,25 @@ rec {
# 2) These are the packages that we can build with the first
# stdenv. We only need binutils, because recent glibcs
# require recent binutils, and those in bootstrap-tools may
# be too old. (in step 3).
# stdenv. We only need binutils, because recent Glibcs
# require recent Binutils, and those in bootstrap-tools may
# be too old.
stdenvLinuxBoot1Pkgs = allPackages {
inherit system platform;
bootStdenv = stdenvLinuxBoot1;
};
firstBinutils = stdenvLinuxBoot1Pkgs.binutils;
# 3) 2nd stdenv that we will use to build only the glibc.
stdenvLinuxBoot2 = stdenvBootFun {
gcc = wrapGCC {
libc = bootstrapGlibc;
binutils = firstBinutils;
binutils = stdenvLinuxBoot1Pkgs.binutils;
coreutils = bootstrapTools;
};
overrides = pkgs: {
inherit (stdenvLinuxBoot1Pkgs) perl;
};
inherit fetchurl;
};
@ -199,9 +201,18 @@ rec {
coreutils = bootstrapTools;
libc = stdenvLinuxGlibc;
};
overrides = {
overrides = pkgs: {
glibc = stdenvLinuxGlibc;
inherit (stdenvLinuxBoot1Pkgs) perl;
# 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; };
mpc = pkgs.mpc.override { stdenv = pkgs.makeStaticLibraries pkgs.stdenv; };
isl = pkgs.isl.override { stdenv = pkgs.makeStaticLibraries pkgs.stdenv; };
cloog = pkgs.cloog.override { stdenv = pkgs.makeStaticLibraries pkgs.stdenv; };
ppl = pkgs.ppl.override { stdenv = pkgs.makeStaticLibraries pkgs.stdenv; };
};
inherit fetchurl;
};
@ -213,22 +224,7 @@ rec {
bootStdenv = stdenvLinuxBoot3;
};
gccWithStaticLibs = stdenvLinuxBoot3Pkgs.gcc.gcc.override (rec {
ppl = stdenvLinuxBoot3Pkgs.ppl.override {
static = true;
gmpxx = stdenvLinuxBoot3Pkgs.gmpxx.override {
static = true;
};
};
cloog = stdenvLinuxBoot3Pkgs.cloog.override {
isl = stdenvLinuxBoot3Pkgs.isl.override {
static = true;
};
static = true;
};
cloogppl = null;
});
# 8) Construct a fourth stdenv identical to the second, except that
# this one uses the dynamically linked GCC and Binutils from step
# 5. The other tools (e.g. coreutils) are still from the
@ -238,11 +234,12 @@ rec {
inherit (stdenvLinuxBoot3Pkgs) binutils;
coreutils = bootstrapTools;
libc = stdenvLinuxGlibc;
gcc = gccWithStaticLibs;
gcc = stdenvLinuxBoot3Pkgs.gcc.gcc;
name = "";
};
overrides = {
overrides = pkgs: {
inherit (stdenvLinuxBoot1Pkgs) perl;
inherit (stdenvLinuxBoot3Pkgs) gettext gnum4 xz gmp;
};
inherit fetchurl;
};
@ -277,7 +274,7 @@ rec {
inherit (stdenvLinuxBoot3Pkgs) binutils;
inherit (stdenvLinuxBoot4Pkgs) coreutils;
libc = stdenvLinuxGlibc;
gcc = gccWithStaticLibs;
gcc = stdenvLinuxBoot3Pkgs.gcc.gcc;
shell = stdenvLinuxBoot4Pkgs.bash + "/bin/bash";
name = "";
};
@ -291,7 +288,7 @@ rec {
inherit platform;
};
overrides = {
overrides = pkgs: {
inherit gcc;
inherit (stdenvLinuxBoot3Pkgs) binutils glibc;
inherit (stdenvLinuxBoot4Pkgs)

View File

@ -108,7 +108,7 @@ let
# overrided packages will not be built with the crossStdenv
# adapter.
overrides = overrider pkgsOrig //
(lib.optionalAttrs (pkgsOrig.stdenv ? overrides && crossSystem == null) pkgsOrig.stdenv.overrides);
(lib.optionalAttrs (pkgsOrig.stdenv ? overrides && crossSystem == null) (pkgsOrig.stdenv.overrides pkgsOrig));
# The un-overriden packages, passed to `overrider'.
pkgsOrig = pkgsFun pkgs {};
@ -1208,11 +1208,8 @@ let
ppl = callPackage ../development/libraries/ppl { };
ppl0_11 = callPackage ../development/libraries/ppl/0.11.nix { };
/* WARNING: this version is unsuitable for using with a setuid wrapper */
ppp = builderDefsPackage (import ../tools/networking/ppp) {
};
ppp = builderDefsPackage (import ../tools/networking/ppp) { };
pptp = callPackage ../tools/networking/pptp {};
@ -1777,8 +1774,7 @@ let
gcc46_realCross = lib.addMetaAttrs { platforms = []; }
(makeOverridable (import ../development/compilers/gcc-4.6) {
inherit fetchurl stdenv texinfo gmp mpfr mpc libelf zlib
cloog gettext which noSysDirs;
ppl = ppl0_11;
cloog ppl gettext which noSysDirs;
binutilsCross = binutilsCross;
libcCross = libcCross;
profiledCompiler = false;
@ -1878,9 +1874,6 @@ let
libcCross = null;
binutilsCross = null;
ppl = ppl0_11;
cloogppl = null;
# bootstrapping a profiled compiler does not work in the sheevaplug:
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43944
profiledCompiler = if stdenv.system == "armv5tel-linux" then false else true;
@ -1894,9 +1887,6 @@ let
cross = null;
libcCross = null;
binutilsCross = null;
ppl = ppl0_11;
cloogppl = null;
}));
gccApple =
@ -2047,7 +2037,6 @@ let
gnatboot = gnat45;
# We can't use the ppl stuff, because we would have
# libstdc++ problems.
cloogppl = null;
ppl = null;
cloog = null;
});
@ -2547,7 +2536,8 @@ let
# compatibility issues in 2.47 - at list 2.44.1 is known good
# for sbcl bootstrap
clisp_2_44_1 = callPackage ../development/interpreters/clisp/2.44.1.nix {
libsigsegv = libsigsegv_25; };
libsigsegv = libsigsegv_25;
};
clojure = callPackage ../development/interpreters/clojure { };
@ -3555,17 +3545,9 @@ let
gmp =
if stdenv.system == "i686-darwin" then
# GMP 4.3.2 is broken on Darwin, so use 4.3.1.
makeOverridable (import ../development/libraries/gmp/4.3.1.nix) {
inherit stdenv fetchurl m4;
cxx = false;
}
callPackage ../development/libraries/gmp/4.3.1.nix { }
else
# We temporarily leave gmp 4 here, waiting for a new ppl/cloog-ppl that
# would build well with gmp 5.
makeOverridable (import ../development/libraries/gmp/4.nix) {
inherit stdenv fetchurl m4;
cxx = false;
};
callPackage ../development/libraries/gmp { };
gmpxx = gmp.override { cxx = true; };