diff --git a/pkgs/build-support/gcc-wrapper-new/builder.sh b/pkgs/build-support/gcc-wrapper-new/builder.sh index b68f241728ca..1a23294dd743 100644 --- a/pkgs/build-support/gcc-wrapper-new/builder.sh +++ b/pkgs/build-support/gcc-wrapper-new/builder.sh @@ -9,6 +9,10 @@ if test -z "$nativeLibc"; then dynamicLinker="$libc/lib/$dynamicLinker" echo $dynamicLinker > $out/nix-support/dynamic-linker + if test -e $libc/lib/32/ld-linux.so.2; then + echo $libc/lib/32/ld-linux.so.2 > $out/nix-support/dynamic-linker-m32 + fi + # The "-B$libc/lib/" flag is a quick hack to force gcc to link # against the crt1.o from our own glibc, rather than the one in # /usr/lib. (This is only an issue when using an `impure' diff --git a/pkgs/build-support/gcc-wrapper-new/gcc-wrapper.sh b/pkgs/build-support/gcc-wrapper-new/gcc-wrapper.sh index a76684806b88..8a49fcb9b06e 100644 --- a/pkgs/build-support/gcc-wrapper-new/gcc-wrapper.sh +++ b/pkgs/build-support/gcc-wrapper-new/gcc-wrapper.sh @@ -32,6 +32,10 @@ for i in "$@"; do dontLink=1 elif test "${i:0:1}" != "-"; then nonFlagArgs=1 + elif test "$i" = "-m32"; then + if test -e @out@/nix-support/dynamic-linker-m32; then + NIX_LDFLAGS="$NIX_LDFLAGS -dynamic-linker $(cat @out@/nix-support/dynamic-linker-m32)" + fi fi done diff --git a/pkgs/tools/misc/grub/default.nix b/pkgs/tools/misc/grub/default.nix index 44c2c02b0200..398b57e623eb 100644 --- a/pkgs/tools/misc/grub/default.nix +++ b/pkgs/tools/misc/grub/default.nix @@ -1,9 +1,5 @@ {stdenv, fetchurl, autoconf, automake}: -if stdenv.system == "x86_64-linux" then - abort "Grub doesn't build on x86_64-linux. You should use the build for i686-linux instead." -else - stdenv.mkDerivation { name = "grub-0.97-patch-1.7"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ae1973cf57b6..1647af51b540 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -267,6 +267,15 @@ let pkgs = rec { } else defaultStdenv; + # A stdenv capable of building 32-bit binaries. On x86_64-linux, + # it uses GCC compiled with multilib support; on i686-linux, it's + # just the plain stdenv. + stdenv_32bit = + if system == "x86_64-linux" then + overrideGCC stdenv gcc43multi + else + stdenv; + ### BUILD SUPPORT @@ -677,19 +686,16 @@ let pkgs = rec { inherit fetchurl stdenv; }; - grub = - if system == "x86_64-linux" then - (import ./all-packages.nix {system = "i686-linux";}).grub - else - import ../tools/misc/grub { - inherit fetchurl stdenv autoconf automake; - }; + grub = import ../tools/misc/grub { + inherit fetchurl autoconf automake; + stdenv = stdenv_32bit; + }; gssdp = import ../development/libraries/gssdp { - inherit fetchurl stdenv pkgconfig libxml2; - inherit (gtkLibs) glib; - inherit (gnome) libsoup; - }; + inherit fetchurl stdenv pkgconfig libxml2; + inherit (gtkLibs) glib; + inherit (gnome) libsoup; + }; gtkgnutella = import ../tools/networking/p2p/gtk-gnutella { inherit fetchurl stdenv pkgconfig libxml2; @@ -697,15 +703,15 @@ let pkgs = rec { }; gupnp = import ../development/libraries/gupnp { - inherit fetchurl stdenv pkgconfig libxml2 gssdp e2fsprogs; - inherit (gtkLibs) glib; - inherit (gnome) libsoup; - }; + inherit fetchurl stdenv pkgconfig libxml2 gssdp e2fsprogs; + inherit (gtkLibs) glib; + inherit (gnome) libsoup; + }; gupnptools = import ../tools/networking/gupnp-tools { - inherit fetchurl stdenv gssdp gupnp pkgconfig libxml2 e2fsprogs; - inherit (gtkLibs) gtk glib; - inherit (gnome) libsoup libglade gnomeicontheme; + inherit fetchurl stdenv gssdp gupnp pkgconfig libxml2 e2fsprogs; + inherit (gtkLibs) gtk glib; + inherit (gnome) libsoup libglade gnomeicontheme; }; gzip = useFromStdenv "gzip" @@ -2346,7 +2352,8 @@ let pkgs = rec { }); aterm242fixes = import ../development/libraries/aterm/2.4.2-fixes.nix { - inherit fetchurl stdenv; + inherit fetchurl; + stdenv = overrideGCC stdenv gcc43multi; }; aterm23x = import ../development/libraries/aterm/2.3.nix { diff --git a/pkgs/top-level/build-for-release.nix b/pkgs/top-level/build-for-release.nix index 6ace81c9b146..f0dfa744304e 100644 --- a/pkgs/top-level/build-for-release.nix +++ b/pkgs/top-level/build-for-release.nix @@ -54,6 +54,7 @@ let gawk gcc gcc34 + gcc43 gdb ghc ghostscript @@ -66,6 +67,7 @@ let gnutar gqview graphviz + grub gzip hal hello @@ -209,7 +211,6 @@ let batik ecj eclipsesdk - grub jakartaregexp jdkPlugin jetty @@ -243,6 +244,7 @@ let emacs firefox gcc + gcc43multi hello libtool nixUnstable