Author: viric
Date: Sat Dec  4 21:45:37 2010
New Revision: 24971
URL: https://svn.nixos.org/websvn/nix/?rev=24971&sc=1

Log:
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, ...

Modified:
   nixpkgs/branches/stdenv-updates/pkgs/build-support/gcc-wrapper/default.nix
   
nixpkgs/branches/stdenv-updates/pkgs/development/libraries/glibc-2.12/common.nix
   nixpkgs/branches/stdenv-updates/pkgs/shells/bash/default.nix
   nixpkgs/branches/stdenv-updates/pkgs/top-level/all-packages.nix

Modified: 
nixpkgs/branches/stdenv-updates/pkgs/build-support/gcc-wrapper/default.nix
==============================================================================
--- nixpkgs/branches/stdenv-updates/pkgs/build-support/gcc-wrapper/default.nix  
Sat Dec  4 21:43:24 2010        (r24970)
+++ nixpkgs/branches/stdenv-updates/pkgs/build-support/gcc-wrapper/default.nix  
Sat Dec  4 21:45:37 2010        (r24971)
@@ -51,6 +51,22 @@
   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

Modified: 
nixpkgs/branches/stdenv-updates/pkgs/development/libraries/glibc-2.12/common.nix
==============================================================================
--- 
nixpkgs/branches/stdenv-updates/pkgs/development/libraries/glibc-2.12/common.nix
    Sat Dec  4 21:43:24 2010        (r24970)
+++ 
nixpkgs/branches/stdenv-updates/pkgs/development/libraries/glibc-2.12/common.nix
    Sat Dec  4 21:45:37 2010        (r24971)
@@ -15,7 +15,9 @@
 
   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".

Modified: nixpkgs/branches/stdenv-updates/pkgs/shells/bash/default.nix
==============================================================================
--- nixpkgs/branches/stdenv-updates/pkgs/shells/bash/default.nix        Sat Dec 
 4 21:43:24 2010        (r24970)
+++ nixpkgs/branches/stdenv-updates/pkgs/shells/bash/default.nix        Sat Dec 
 4 21:45:37 2010        (r24971)
@@ -81,4 +81,8 @@
 
     maintainers = [ stdenv.lib.maintainers.ludo ];
   };
+
+  passthru = {
+    shellPath = "/bin/bash";
+  };
 }

Modified: nixpkgs/branches/stdenv-updates/pkgs/top-level/all-packages.nix
==============================================================================
--- nixpkgs/branches/stdenv-updates/pkgs/top-level/all-packages.nix     Sat Dec 
 4 21:43:24 2010        (r24970)
+++ nixpkgs/branches/stdenv-updates/pkgs/top-level/all-packages.nix     Sat Dec 
 4 21:45:37 2010        (r24971)
@@ -2052,6 +2052,7 @@
     nativePrefix = if stdenv ? gcc then stdenv.gcc.nativePrefix else "";
     gcc = baseGCC;
     libc = glibc;
+    shell = bash;
     inherit stdenv binutils coreutils zlib;
   };
 
@@ -2917,13 +2918,13 @@
     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");
_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to