diff --git a/pkgs/development/compilers/gcc-static-4.1/builder.sh b/pkgs/development/compilers/gcc-static-4.1/builder.sh index 7e20fcebff6e..1d220df26aca 100644 --- a/pkgs/development/compilers/gcc-static-4.1/builder.sh +++ b/pkgs/development/compilers/gcc-static-4.1/builder.sh @@ -14,7 +14,7 @@ if test "$noSysDirs" = "1"; then # Figure out what extra flags to pass to the gcc compilers being # generated to make sure that they use our glibc. - if test -n $glibc; then + if test -n "$glibc"; then # Ugh. Copied from gcc-wrapper/builder.sh. We can't just # source in $NIX_GCC/nix-support/add-flags, since that would @@ -22,7 +22,7 @@ if test "$noSysDirs" = "1"; then # Need some more modularity there. extraCFlags="-B$glibc/lib -isystem $glibc/include" extraLDFlags="-B$glibc/lib -L$glibc/lib -Wl,-s \ - -Wl,-dynamic-linker,$glibc/lib/ld-linux.so.2 -static" + -Wl,-dynamic-linker,$glibc/lib/ld-linux.so.2" # Oh, what a hack. I should be shot for this. In stage 1, we # should link against the previous GCC, but not afterwards. @@ -40,6 +40,11 @@ if test "$noSysDirs" = "1"; then # that does not include Glibc's limits.h (notably missing # SSIZE_MAX, which breaks the build). export NIX_FIXINC_DUMMY=$glibc/include + + else + extraCFlags="-isystem /usr/include" + extraLDFlags="-L/usr/lib64 -L/usr/lib" + export NIX_FIXINC_DUMMY=/usr/include fi export NIX_EXTRA_CFLAGS=$extraCFlags @@ -50,6 +55,9 @@ if test "$noSysDirs" = "1"; then fi +export makeFlags="LDFLAGS=-static" + + preConfigure=preConfigure preConfigure() { @@ -66,10 +74,9 @@ preConfigure() { mkdir ../build cd ../build - export LDFLFAGS="-static" configureScript=../$sourceRoot/configure configureFlags="--enable-languages=c --disable-libstdcxx-pch \ - --disable-shared --disable-libmudflap --disable-libssp" + --disable-libmudflap --disable-libssp" } diff --git a/pkgs/development/compilers/gcc-static-4.1/default.nix b/pkgs/development/compilers/gcc-static-4.1/default.nix index 3415caa799ef..9ac6f89d10aa 100644 --- a/pkgs/development/compilers/gcc-static-4.1/default.nix +++ b/pkgs/development/compilers/gcc-static-4.1/default.nix @@ -1,7 +1,6 @@ { stdenv, fetchurl , langC ? true, langCC ? true, langF77 ? false , profiledCompiler ? false -, glibc }: assert langC; @@ -13,7 +12,8 @@ stdenv.mkDerivation { url = http://nix.cs.uu.nl/dist/tarballs/gcc-4.1.1.tar.bz2; md5 = "ad9f97a4d04982ccf4fd67cb464879f3"; }; - patches = [./pass-cxxcpp.patch ./no-sys-dirs.patch]; - inherit langC langCC langF77 profiledCompiler glibc; + patches = [./no-sys-dirs.patch]; + inherit langC langCC langF77 profiledCompiler; noSysDirs = 1; + glibc = if stdenv ? glibc then stdenv.glibc else null; } diff --git a/pkgs/stdenv/linux/bootstrap/x86_64/default.nix b/pkgs/stdenv/linux/bootstrap/x86_64/default.nix index 88f0236d37a2..074a3313f5da 100644 --- a/pkgs/stdenv/linux/bootstrap/x86_64/default.nix +++ b/pkgs/stdenv/linux/bootstrap/x86_64/default.nix @@ -7,21 +7,21 @@ staticToolsURL = { url = file:///tmp/tarballs/static-tools.tar.bz2; - sha1 = "806f9644bf155069315bdd66138764b3d8619348"; + sha1 = "4c72845335b373966341f1d4ca0b4b06904d1214"; }; binutilsURL = { url = file:///tmp/tarballs/binutils.tar.bz2; - sha1 = "b55055c50cfcd2ab02e20f49ad8ca72315252a1c"; + sha1 = "5ad0bdf99a427ebb8e08ca90db952c3eeb5119a4"; }; gccURL = { url = file:///tmp/tarballs/gcc.tar.bz2; - sha1 = "a2ac17b6e7ce6d07c01e090b801c1622f56d8b39"; + sha1 = "7398e021fdd5d7c4b5a3bb158db6e7573fc1dc0f"; }; glibcURL = { url = file:///tmp/tarballs/glibc.tar.bz2; - sha1 = "59d4d5a25ecd8b2f741d80e80d172bd6e7e06d89"; + sha1 = "710b4a53425977858490f77188c7e2138b55a2dd"; }; } diff --git a/pkgs/stdenv/linux/make-bootstrap-tools.nix b/pkgs/stdenv/linux/make-bootstrap-tools.nix index f154b395bbb7..c3c76a8e2555 100644 --- a/pkgs/stdenv/linux/make-bootstrap-tools.nix +++ b/pkgs/stdenv/linux/make-bootstrap-tools.nix @@ -43,7 +43,7 @@ let binutils = pkgsDiet.binutils217; gcc = import ../../development/compilers/gcc-static-4.1 { - inherit (pkgs) fetchurl stdenv glibc; + inherit (pkgs) fetchurl stdenv; profiledCompiler = false; langCC = false; }; diff --git a/pkgs/stdenv/linux/make-bootstrap-tools.sh b/pkgs/stdenv/linux/make-bootstrap-tools.sh index 3b1ecbbceef4..7de85b724e21 100644 --- a/pkgs/stdenv/linux/make-bootstrap-tools.sh +++ b/pkgs/stdenv/linux/make-bootstrap-tools.sh @@ -84,9 +84,7 @@ chmod -R +w gcc nukeRefs gcc/libexec/gcc/*/*/cc1 nukeRefs gcc/libexec/gcc/*/*/collect2 rm -f gcc/lib/libmud* gcc/lib/libiberty* gcc/lib/libssp* -if test -e gcc/lib/libgcc_s.so.1; then - nukeRefs gcc/lib/libgcc_s.so.1 -fi +nukeRefs gcc/lib/libgcc_s.so.1 rm -rf gcc/lib/gcc/*/*/install-tools rm -rf gcc/lib/gcc/*/*/include/root rm -rf gcc/lib/gcc/*/*/include/linux