From a5fee3325a61b9ae33a0132a653d19079710002e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Fri, 20 Nov 2009 22:56:58 +0000 Subject: [PATCH] Fixing some things on the gcc-cross-wrapper (libc was not properly added to the linking path), and with this achieved bash being cross-compilable. I fixed the few expressions involved in bash building, so they have well stated native and non-native inputs. I also tried to cross-build guile, and with this I found a problem in the actual cross-gcc: it calls the binutils ld, instead of the ld wrapper. This way, the programs/shared_libraries don't get the proper -rpath. svn path=/nixpkgs/branches/stdenv-updates/; revision=18497 --- pkgs/build-support/gcc-cross-wrapper/setup-hook.sh | 7 +++++-- pkgs/development/interpreters/guile/default.nix | 5 +++-- pkgs/development/tools/misc/libtool/libtool2.nix | 2 +- pkgs/shells/bash/default.nix | 4 ++-- pkgs/top-level/all-packages.nix | 3 ++- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/pkgs/build-support/gcc-cross-wrapper/setup-hook.sh b/pkgs/build-support/gcc-cross-wrapper/setup-hook.sh index 8edfa1ac92b1..81735a4feffe 100644 --- a/pkgs/build-support/gcc-cross-wrapper/setup-hook.sh +++ b/pkgs/build-support/gcc-cross-wrapper/setup-hook.sh @@ -20,8 +20,11 @@ if test -n "@binutils@"; then PATH=$PATH:@binutils@/bin fi -if test -n "@glibc@"; then - PATH=$PATH:@glibc@/bin +if test -n "@libc@"; then + PATH=$PATH:@libc@/bin + addCVars @libc@ fi configureFlags="$configureFlags --build=$system --host=$crossConfig" +dontPatchELF=1 +dontStrip=1 diff --git a/pkgs/development/interpreters/guile/default.nix b/pkgs/development/interpreters/guile/default.nix index 7e2de8c942ee..f81f8ab1e828 100644 --- a/pkgs/development/interpreters/guile/default.nix +++ b/pkgs/development/interpreters/guile/default.nix @@ -8,8 +8,9 @@ stdenv.mkDerivation rec { sha256 = "1czhcrn6l63xhsw3fjmv88djflqxbdpxjhgmwwvscm8rv4wn7vmz"; }; - buildInputs = [ makeWrapper ]; - propagatedBuildInputs = [readline libtool gmp gawk]; + buildNativeInputs = [ makeWrapper ]; + propagatedBuildInputs = [ libtool ]; + propagatedBuildNativeInputs = [readline gmp gawk]; postInstall = '' wrapProgram $out/bin/guile-snarf --prefix PATH : "${gawk}/bin" diff --git a/pkgs/development/tools/misc/libtool/libtool2.nix b/pkgs/development/tools/misc/libtool/libtool2.nix index 0119515740dc..84921daf810c 100644 --- a/pkgs/development/tools/misc/libtool/libtool2.nix +++ b/pkgs/development/tools/misc/libtool/libtool2.nix @@ -8,7 +8,7 @@ stdenv.mkDerivation rec { sha256 = "1bmpp31sfjl3nzj8psvnsqrrv4gwnqzii8dxpxr6djz508yavsv6"; }; - buildInputs = [ lzma m4 perl ]; + buildNativeInputs = [ lzma m4 perl ]; unpackCmd = "lzma -d < $src | tar xv"; diff --git a/pkgs/shells/bash/default.nix b/pkgs/shells/bash/default.nix index 02736dec2855..59b3ef73275a 100644 --- a/pkgs/shells/bash/default.nix +++ b/pkgs/shells/bash/default.nix @@ -32,8 +32,8 @@ stdenv.mkDerivation rec { import ./bash-patches.nix patch; # Note: Bison is needed because the patches above modify parse.y. - buildInputs = [bison] - ++ stdenv.lib.optional (texinfo != null) texinfo + buildNativeInputs = [bison]; + buildInputs = stdenv.lib.optional (texinfo != null) texinfo ++ stdenv.lib.optional interactive readline; configureFlags = "--with-installed-readline"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 922511e41ba1..629d3fe89d70 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -132,7 +132,8 @@ let # inside the set for derivations. recurseIntoAttrs = attrs: attrs // {recurseForDerivations = true;}; - useFromStdenv = it : alternative : if (builtins.hasAttr it stdenv) then + useFromStdenv = it : alternative : if ((bootStdenv != null || + crossSystem == null) && builtins.hasAttr it stdenv) then (builtins.getAttr it stdenv) else alternative; # Return the first available value in the order: pkg.val, val, or default.