From 1b62c9c06173f4d5e6b090e5ae0c68fa5f478faf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Sat, 4 Dec 2010 21:45:37 +0000 Subject: [PATCH] I made changes to achieve a working cross-built gcc wrapper. Now, "gcc45.hostDrv" works in the host system, together with libc, binutils, dynamic linker, ... svn path=/nixpkgs/branches/stdenv-updates/; revision=24971 --- pkgs/build-support/gcc-wrapper/default.nix | 16 ++++++++++++++++ pkgs/development/libraries/glibc-2.12/common.nix | 4 +++- pkgs/shells/bash/default.nix | 4 ++++ pkgs/top-level/all-packages.nix | 5 +++-- 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/pkgs/build-support/gcc-wrapper/default.nix b/pkgs/build-support/gcc-wrapper/default.nix index 56069ec17b3..d30bf874506 100644 --- a/pkgs/build-support/gcc-wrapper/default.nix +++ b/pkgs/build-support/gcc-wrapper/default.nix @@ -51,6 +51,22 @@ stdenv.mkDerivation { langVhdl = if nativeTools then false else gcc ? langVhdl && gcc.langVhdl; zlib = if (gcc != null && gcc ? langVhdl) then zlib else null; shell = if shell == "" then stdenv.shell else shell; + + crossAttrs = { + shell = shell.hostDrv + "${shell.hostDrv.shellPath}"; + libc = libc.hostDrv; + coreutils = coreutils.hostDrv; + binutils = binutils.hostDrv; + gcc = gcc.hostDrv; + # + # This is not the best way to do this. I think the reference should be + # the style in the gcc-cross-wrapper, but to keep a stable stdenv now I + # do this sufficient if/else. + dynamicLinker = + (if stdenv.cross.arch == "arm" then "ld-linux.so.3" else + if stdenv.cross.arch == "mips" then "ld.so.1" else + abort "don't know the name of the dynamic linker for this platform"); + }; meta = let gcc_ = if gcc != null then gcc else {}; in diff --git a/pkgs/development/libraries/glibc-2.12/common.nix b/pkgs/development/libraries/glibc-2.12/common.nix index 9ad0358e5cc..f9d9e8f81a7 100644 --- a/pkgs/development/libraries/glibc-2.12/common.nix +++ b/pkgs/development/libraries/glibc-2.12/common.nix @@ -15,7 +15,9 @@ let needsPortsNative = stdenv.isMips || stdenv.isArm; needsPortsCross = cross.arch == "mips" || cross.arch == "arm"; - needsPorts = if cross == null then needsPortsNative else needsPortsCross; + needsPorts = if (stdenv ? cross) && stdenv.cross != null then true + else if cross == null then needsPortsNative + else needsPortsCross; srcPorts = fetchurl { # A tarball I manually made from a git clone, for the tag "glibc-2.12.1". diff --git a/pkgs/shells/bash/default.nix b/pkgs/shells/bash/default.nix index 60eaf4d4dab..f29d4354a06 100644 --- a/pkgs/shells/bash/default.nix +++ b/pkgs/shells/bash/default.nix @@ -81,4 +81,8 @@ stdenv.mkDerivation rec { maintainers = [ stdenv.lib.maintainers.ludo ]; }; + + passthru = { + shellPath = "/bin/bash"; + }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 77c8993f4e3..cf1547064a2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2052,6 +2052,7 @@ let nativePrefix = if stdenv ? gcc then stdenv.gcc.nativePrefix else ""; gcc = baseGCC; libc = glibc; + shell = bash; inherit stdenv binutils coreutils zlib; }; @@ -2917,13 +2918,13 @@ let installLocales = getPkgConfig "glibc" "locales" false; }); - glibc212 = callPackage ../development/libraries/glibc-2.12 { + glibc212 = (callPackage ../development/libraries/glibc-2.12 { kernelHeaders = linuxHeaders; installLocales = getPkgConfig "glibc" "locales" false; machHeaders = null; hurdHeaders = null; gccCross = null; - }; + }) // { hostDrv = glibc212Cross; }; glibc212Cross = forceBuildDrv (makeOverridable (import ../development/libraries/glibc-2.12) (let crossGNU = (crossSystem != null && crossSystem.config == "i586-pc-gnu");