summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/applications/editors/ed/default.nix4
-rw-r--r--pkgs/build-support/gcc-cross-wrapper/builder.sh25
-rw-r--r--pkgs/development/compilers/gcc-4.4/builder.sh35
-rw-r--r--pkgs/development/compilers/gcc-4.4/default.nix48
-rw-r--r--pkgs/development/libraries/acl/default.nix3
-rw-r--r--pkgs/development/libraries/attr/default.nix3
-rw-r--r--pkgs/development/libraries/gettext/default.nix5
-rw-r--r--pkgs/development/libraries/glibc-2.11/common.nix4
-rw-r--r--pkgs/development/libraries/glibc-2.11/locale-override.patch72
-rw-r--r--pkgs/development/libraries/gmp/default.nix35
-rw-r--r--pkgs/development/tools/misc/binutils/as-pr10856.patch83
-rw-r--r--pkgs/development/tools/misc/binutils/default.nix6
-rw-r--r--pkgs/development/tools/misc/gnum4/default.nix6
-rw-r--r--pkgs/os-specific/linux/klibc/default.nix34
-rw-r--r--pkgs/os-specific/linux/uclibc/default.nix9
-rw-r--r--pkgs/stdenv/adapters.nix4
-rw-r--r--pkgs/tools/archivers/gnutar/default.nix6
-rw-r--r--pkgs/tools/compression/bzip2/default.nix10
-rw-r--r--pkgs/tools/misc/coreutils/default.nix14
-rw-r--r--pkgs/tools/misc/findutils/default.nix11
-rw-r--r--pkgs/tools/text/diffutils/default.nix2
-rw-r--r--pkgs/tools/text/gnugrep/default.nix6
-rw-r--r--pkgs/tools/text/gnupatch/default.nix4
-rw-r--r--pkgs/tools/text/gnused/default.nix16
-rw-r--r--pkgs/tools/text/gnused/gettext-fix.patch32
-rw-r--r--pkgs/tools/text/replace/default.nix4
-rw-r--r--pkgs/top-level/all-packages.nix8
-rw-r--r--pkgs/top-level/release-lib.nix4
28 files changed, 249 insertions, 244 deletions
diff --git a/pkgs/applications/editors/ed/default.nix b/pkgs/applications/editors/ed/default.nix
index 9f26c0a2886..905cde880ed 100644
--- a/pkgs/applications/editors/ed/default.nix
+++ b/pkgs/applications/editors/ed/default.nix
@@ -10,6 +10,10 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
+  crossAttrs = {
+    compileFlags = [ "CC=${stdenv.cross.config}-gcc" ];
+  };
+
   meta = {
     description = "GNU ed, an implementation of the standard Unix editor";
 
diff --git a/pkgs/build-support/gcc-cross-wrapper/builder.sh b/pkgs/build-support/gcc-cross-wrapper/builder.sh
index e71e1742720..b4ff8cf2434 100644
--- a/pkgs/build-support/gcc-cross-wrapper/builder.sh
+++ b/pkgs/build-support/gcc-cross-wrapper/builder.sh
@@ -1,5 +1,8 @@
 source $stdenv/setup
 
+mkdir $out
+mkdir $out/bin
+mkdir $out/nix-support
 
 # Force gcc to use ld-wrapper.sh when calling ld.
 cflagsCompile="-B$out/bin/"
@@ -12,6 +15,23 @@ if test -z "$nativeLibc"; then
     if [ -n "$dlinker" ]; then
       ldflagsBefore="-dynamic-linker $dlinker"
     fi
+
+    # The same as above, but put into files, useful for the gcc builder.
+    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
+
+    echo "$cflagsCompile -B$libc/lib/ -idirafter $libc/include -idirafter $gcc/lib/gcc/*/*/include-fixed" > $out/nix-support/libc-cflags
+
+    echo "-L$libc/lib" > $out/nix-support/libc-ldflags
+
+    # The dynamic linker is passed in `ldflagsBefore' to allow
+    # explicit overrides of the dynamic linker by callers to gcc/ld
+    # (the *last* value counts, so ours should come first).
+    echo "-dynamic-linker $dynamicLinker" > $out/nix-support/libc-ldflags-before
 fi
 
 if test -n "$nativeTools"; then
@@ -24,11 +44,6 @@ else
 fi
 
 
-mkdir $out
-mkdir $out/bin
-mkdir $out/nix-support
-
-
 doSubstitute() {
     local src=$1
     local dst=$2
diff --git a/pkgs/development/compilers/gcc-4.4/builder.sh b/pkgs/development/compilers/gcc-4.4/builder.sh
index b9724e7ad50..abe14b457ab 100644
--- a/pkgs/development/compilers/gcc-4.4/builder.sh
+++ b/pkgs/development/compilers/gcc-4.4/builder.sh
@@ -61,10 +61,39 @@ if test "$noSysDirs" = "1"; then
             EXTRA_LDFLAGS_TARGET="-Wl,-L${libcCross}/lib"
         fi
     else
-        EXTRA_FLAGS_TARGET="$EXTRA_FLAGS"
-        EXTRA_LDFLAGS_TARGET="$EXTRA_LDFLAGS"
+        if test -z "$NIX_GCC_CROSS"; then
+            EXTRA_FLAGS_TARGET="$EXTRA_FLAGS"
+            EXTRA_LDFLAGS_TARGET="$EXTRA_LDFLAGS"
+        else
+            # This the case of cross-building the gcc.
+            # We need special flags for the target, different than those of the build
+            # Assertion:
+            test -e $NIX_GCC_CROSS/nix-support/orig-libc
+
+            # Figure out what extra flags to pass to the gcc compilers
+            # being generated to make sure that they use our glibc.
+            extraFlags="$(cat $NIX_GCC_CROSS/nix-support/libc-cflags)"
+            extraLDFlags="$(cat $NIX_GCC_CROSS/nix-support/libc-ldflags) $(cat $NIX_GCC_CROSS/nix-support/libc-ldflags-before)"
+
+            # Use *real* header files, otherwise a limits.h is generated
+            # that does not include Glibc's limits.h (notably missing
+            # SSIZE_MAX, which breaks the build).
+            NIX_FIXINC_DUMMY_CROSS=$(cat $NIX_GCC_CROSS/nix-support/orig-libc)/include
+
+            # The path to the Glibc binaries such as `crti.o'.
+            glibc_libdir="$(cat $NIX_GCC_CROSS/nix-support/orig-libc)/lib"
+
+            extraFlags="-g0 -O2 -I$NIX_FIXINC_DUMMY_CROSS $extraFlags"
+            extraLDFlags="--strip-debug -L$glibc_libdir -rpath $glibc_libdir $extraLDFlags"
+
+            EXTRA_FLAGS_TARGET="$extraFlags"
+            for i in $extraLDFlags; do
+                EXTRA_LDFLAGS_TARGET="$EXTRA_LDFLAGS_TARGET -Wl,$i"
+            done
+        fi
     fi
 
+
     # CFLAGS_FOR_TARGET are needed for the libstdc++ configure script to find
     # the startfiles.
     # FLAGS_FOR_TARGET are needed for the target libraries to receive the -Bxxx
@@ -160,7 +189,7 @@ postInstall() {
 }
 
 
-if test -z "$targetConfig"; then
+if test -z "$targetConfig" && test -z "$crossConfig"; then
     if test -z "$profiledCompiler"; then
         buildFlags="bootstrap $buildFlags"
     else    
diff --git a/pkgs/development/compilers/gcc-4.4/default.nix b/pkgs/development/compilers/gcc-4.4/default.nix
index b1b7aaa3360..d2ba75624db 100644
--- a/pkgs/development/compilers/gcc-4.4/default.nix
+++ b/pkgs/development/compilers/gcc-4.4/default.nix
@@ -126,7 +126,9 @@ stdenv.mkDerivation ({
   inherit noSysDirs profiledCompiler staticCompiler langJava crossStageStatic
     libcCross;
 
-  buildInputs = [ texinfo gmp mpfr gettext which ]
+  buildNativeInputs = [ texinfo which ];
+
+  buildInputs = [ gmp mpfr gettext ]
     ++ (optional (ppl != null) ppl)
     ++ (optional (cloogppl != null) cloogppl)
     ++ (optionals langTreelang [bison flex])
@@ -176,6 +178,50 @@ stdenv.mkDerivation ({
   LD = "ld";
   CC = "gcc";
 
+  crossAttrs = {
+    AR = "${stdenv.cross.config}-ar";
+    LD = "${stdenv.cross.config}-ld";
+    CC = "${stdenv.cross.config}-gcc";
+    CXX = "${stdenv.cross.config}-gcc";
+    AR_FOR_TARGET = "${stdenv.cross.config}-ar";
+    LD_FOR_TARGET = "${stdenv.cross.config}-ld";
+    CC_FOR_TARGET = "${stdenv.cross.config}-gcc";
+    NM_FOR_TARGET = "${stdenv.cross.config}-nm";
+    CXX_FOR_TARGET = "${stdenv.cross.config}-g++";
+    # If we are making a cross compiler, cross != null
+    NIX_GCC_CROSS = if cross == null then "${stdenv.gccCross}" else "";
+    configureFlags = "
+      ${if enableMultilib then "" else "--disable-multilib"}
+      ${if enableShared then "" else "--disable-shared"}
+      ${if ppl != null then "--with-ppl=${ppl.hostDrv}" else ""}
+      ${if cloogppl != null then "--with-cloog=${cloogppl.hostDrv}" else ""}
+      ${if langJava then "--with-ecj-jar=${javaEcj.hostDrv}" else ""}
+      ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
+      ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.hostDrv}" else ""}
+      --with-gmp=${gmp.hostDrv}
+      --with-mpfr=${mpfr.hostDrv}
+      --disable-libstdcxx-pch
+      --without-included-gettext
+      --with-system-zlib
+      --enable-languages=${
+        concatStrings (intersperse ","
+          (  optional langC        "c"
+          ++ optional langCC       "c++"
+          ++ optional langFortran  "fortran"
+          ++ optional langJava     "java"
+          ++ optional langTreelang "treelang"
+          ++ optional langAda      "ada"
+          ++ optional langVhdl     "vhdl"
+          )
+        )
+      }
+      ${if langAda then " --enable-libada" else ""}
+      ${if (cross == null && stdenv.isi686) then "--with-arch=i686" else ""}
+      ${if cross != null then crossConfigureFlags else ""}
+      --target=${stdenv.cross.config}
+    ";
+  };
+
   # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find
   # the library headers and binaries, regarless of the language being
   # compiled.
diff --git a/pkgs/development/libraries/acl/default.nix b/pkgs/development/libraries/acl/default.nix
index 06dd8cb2fb9..9bf407d61ff 100644
--- a/pkgs/development/libraries/acl/default.nix
+++ b/pkgs/development/libraries/acl/default.nix
@@ -8,7 +8,8 @@ stdenv.mkDerivation {
     sha256 = "1j39g62fki0iyji9s62slgwdfskpkqy7rmjlqcnmsvsnxbxhc294";
   };
 
-  buildInputs = [gettext attr libtool];
+  buildNativeInputs = [gettext];
+  buildInputs = [attr libtool];
 
   configureFlags = "MAKE=make LIBTOOL=libtool MSGFMT=msgfmt MSGMERGE=msgmerge XGETTEXT=xgettext ZIP=gzip ECHO=echo SED=sed AWK=gawk";
 
diff --git a/pkgs/development/libraries/attr/default.nix b/pkgs/development/libraries/attr/default.nix
index 532f97a9fdf..0f38cb27c0d 100644
--- a/pkgs/development/libraries/attr/default.nix
+++ b/pkgs/development/libraries/attr/default.nix
@@ -9,7 +9,8 @@ stdenv.mkDerivation {
     sha256 = "1gy5zspj8ynxv6q29r24d18cfvq06zirg1pxcdg27bg2ncrv4n6k";
   };
 
-  buildInputs = [libtool gettext];
+  buildNativeInputs = [gettext];
+  buildInputs = [libtool];
 
   configureFlags = "MAKE=make LIBTOOL=libtool MSGFMT=msgfmt MSGMERGE=msgmerge XGETTEXT=xgettext ECHO=echo SED=sed AWK=gawk";
 
diff --git a/pkgs/development/libraries/gettext/default.nix b/pkgs/development/libraries/gettext/default.nix
index 6b094fdc839..826dae2d314 100644
--- a/pkgs/development/libraries/gettext/default.nix
+++ b/pkgs/development/libraries/gettext/default.nix
@@ -21,6 +21,11 @@ stdenv.mkDerivation (rec {
     fi
   '';
 
+  crossAttrs = {
+    buildInputs = stdenv.lib.optional (stdenv.gccCross.libc ? libiconv)
+      stdenv.gccCross.libc.libiconv.hostDrv;
+  };
+
   meta = {
     description = "GNU gettext, a well integrated set of translation tools and documentation";
 
diff --git a/pkgs/development/libraries/glibc-2.11/common.nix b/pkgs/development/libraries/glibc-2.11/common.nix
index fcdccd90f2e..4fe261c7fdc 100644
--- a/pkgs/development/libraries/glibc-2.11/common.nix
+++ b/pkgs/development/libraries/glibc-2.11/common.nix
@@ -44,9 +44,6 @@ stdenv.mkDerivation ({
        failure to find mdns4_minimal. */
     ./nss-skip-unavail.patch
 
-    /* Make it possible to override the locale-archive in NixOS. */
-    ./locale-override.patch
-
     /* Have rpcgen(1) look for cpp(1) in $PATH.  */
     ./rpcgen-path.patch
 
@@ -60,6 +57,7 @@ stdenv.mkDerivation ({
   configureFlags = [
     "-C"
     "--enable-add-ons"
+    "--localedir=/var/run/current-system/sw/lib/locale"
     (if kernelHeaders != null
      then "--with-headers=${kernelHeaders}/include"
      else "--without-headers")
diff --git a/pkgs/development/libraries/glibc-2.11/locale-override.patch b/pkgs/development/libraries/glibc-2.11/locale-override.patch
deleted file mode 100644
index 108d0e35dac..00000000000
--- a/pkgs/development/libraries/glibc-2.11/locale-override.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-diff -rc glibc-2.9-20081208-orig/locale/loadarchive.c glibc-2.9-20081208/locale/loadarchive.c
-*** glibc-2.9-20081208-orig/locale/loadarchive.c	2005-09-09 18:56:52.000000000 +0200
---- glibc-2.9-20081208/locale/loadarchive.c	2009-04-19 13:54:26.000000000 +0200
-***************
-*** 124,129 ****
---- 124,142 ----
-  }
-  
-  
-+ static int
-+ open_locale_archive ()
-+ {
-+   int fd = -1;
-+   char *path = getenv ("LOCALE_ARCHIVE");
-+   if (path)
-+     fd = open_not_cancel_2 (path, O_RDONLY|O_LARGEFILE);
-+   if (fd < 0)
-+     fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
-+   return fd;
-+ }
-+ 
-+ 
-  /* Find the locale *NAMEP in the locale archive, and return the
-     internalized data structure for its CATEGORY data.  If this locale has
-     already been loaded from the archive, just returns the existing data
-***************
-*** 203,209 ****
-        archmapped = &headmap;
-  
-        /* The archive has never been opened.  */
-!       fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
-        if (fd < 0)
-  	/* Cannot open the archive, for whatever reason.  */
-  	return NULL;
---- 216,222 ----
-        archmapped = &headmap;
-  
-        /* The archive has never been opened.  */
-!       fd = open_locale_archive ();
-        if (fd < 0)
-  	/* Cannot open the archive, for whatever reason.  */
-  	return NULL;
-***************
-*** 394,400 ****
-  	  if (fd == -1)
-  	    {
-  	      struct stat64 st;
-! 	      fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
-  	      if (fd == -1)
-  		/* Cannot open the archive, for whatever reason.  */
-  		return NULL;
---- 407,413 ----
-  	  if (fd == -1)
-  	    {
-  	      struct stat64 st;
-! 	      fd = open_locale_archive ();
-  	      if (fd == -1)
-  		/* Cannot open the archive, for whatever reason.  */
-  		return NULL;
-diff -rc glibc-2.9-20081208-orig/sysdeps/generic/unsecvars.h glibc-2.9-20081208/sysdeps/generic/unsecvars.h
-*** glibc-2.9-20081208-orig/sysdeps/generic/unsecvars.h	2006-10-11 18:24:05.000000000 +0200
---- glibc-2.9-20081208/sysdeps/generic/unsecvars.h	2009-04-19 13:55:34.000000000 +0200
-***************
-*** 16,21 ****
---- 16,22 ----
-    "LD_SHOW_AUXV\0"							      \
-    "LD_USE_LOAD_BIAS\0"							      \
-    "LOCALDOMAIN\0"							      \
-+   "LOCALE_ARCHIVE\0"							      \
-    "LOCPATH\0"								      \
-    "MALLOC_TRACE\0"							      \
-    "NIS_PATH\0"								      \
diff --git a/pkgs/development/libraries/gmp/default.nix b/pkgs/development/libraries/gmp/default.nix
index 0b608fb4aad..e414a5f2a73 100644
--- a/pkgs/development/libraries/gmp/default.nix
+++ b/pkgs/development/libraries/gmp/default.nix
@@ -1,15 +1,17 @@
 {stdenv, fetchurl, m4, cxx ? true}:
 
 stdenv.mkDerivation rec {
-  name = "gmp-4.3.2";
+  name = "gmp-5.0.0";
 
   src = fetchurl {
     url = "mirror://gnu/gmp/${name}.tar.bz2";
-    sha256 = "0x8prpqi9amfcmi7r4zrza609ai9529pjaq0h4aw51i867064qck";
+    sha256 = "0kwqhyvw48yzxjp29c721m9v498115dh6li9adk7b84mbh7gv2gh";
   };
 
   buildNativeInputs = [m4];
 
+  # Prevent the build system from using sub-architecture-specific
+  # instructions (e.g., SSE2 on i686).
   preConfigure = "ln -sf configfsf.guess config.guess";
 
   configureFlags = if cxx then "--enable-cxx" else "--disable-cxx";
@@ -17,9 +19,34 @@ stdenv.mkDerivation rec {
   doCheck = true;
 
   meta = {
-    description = "A free library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating point numbers";
+    description = "GMP, the GNU multiple precision arithmetic library";
+
+    longDescription =
+      '' GMP is a free library for arbitrary precision arithmetic, operating
+         on signed integers, rational numbers, and floating point numbers.
+         There is no practical limit to the precision except the ones implied
+         by the available memory in the machine GMP runs on.  GMP has a rich
+         set of functions, and the functions have a regular interface.
+
+         The main target applications for GMP are cryptography applications
+         and research, Internet security applications, algebra systems,
+         computational algebra research, etc.
+
+         GMP is carefully designed to be as fast as possible, both for small
+         operands and for huge operands.  The speed is achieved by using
+         fullwords as the basic arithmetic type, by using fast algorithms,
+         with highly optimised assembly code for the most common inner loops
+         for a lot of CPUs, and by a general emphasis on speed.
+
+         GMP is faster than any other bignum library.  The advantage for GMP
+         increases with the operand sizes for many operations, since GMP uses
+         asymptotically faster algorithms.
+      '';
+
     homepage = http://gmplib.org/;
-    license = "LGPL";
+    license = "LGPLv3+";
+
+    maintainers = [ stdenv.lib.maintainers.ludo ];
     platforms = stdenv.lib.platforms.all;
   };
 }
diff --git a/pkgs/development/tools/misc/binutils/as-pr10856.patch b/pkgs/development/tools/misc/binutils/as-pr10856.patch
deleted file mode 100644
index 695d3e35670..00000000000
--- a/pkgs/development/tools/misc/binutils/as-pr10856.patch
+++ /dev/null
@@ -1,83 +0,0 @@
-Fix a regression in GNU as:
-http://sourceware.org/bugzilla/show_bug.cgi?id=10856 .
-
-The bug appears to be responsible for invalid code generated for
-Crypto++:
-http://groups.google.com/group/cryptopp-users/browse_thread/thread/7ce734e479586640/29c6649b7c7adee2?#29c6649b7c7adee2 .
-
-diff -u -r1.77.2.1 -r1.77.2.2
---- a/gas/expr.c	2009/09/11 15:28:43	1.77.2.1
-+++ b/gas/expr.c	2009/10/28 08:23:48	1.77.2.2
-@@ -1997,6 +1997,7 @@
-   /* Help out with CSE.  */
-   valueT final_val = expressionP->X_add_number;
-   symbolS *add_symbol = expressionP->X_add_symbol;
-+  symbolS *orig_add_symbol = add_symbol;
-   symbolS *op_symbol = expressionP->X_op_symbol;
-   operatorT op = expressionP->X_op;
-   valueT left, right;
-@@ -2078,6 +2079,7 @@
- 	      left = right;
- 	      seg_left = seg_right;
- 	      add_symbol = op_symbol;
-+	      orig_add_symbol = expressionP->X_op_symbol;
- 	      op = O_symbol;
- 	      break;
- 	    }
-@@ -2122,18 +2124,19 @@
- 	    {
- 	      if (op == O_bit_exclusive_or || op == O_bit_inclusive_or)
- 		{
--		  if (seg_right != absolute_section || right != 0)
-+		  if (!(seg_right == absolute_section && right == 0))
- 		    {
- 		      seg_left = seg_right;
- 		      left = right;
- 		      add_symbol = op_symbol;
-+		      orig_add_symbol = expressionP->X_op_symbol;
- 		    }
- 		  op = O_symbol;
- 		  break;
- 		}
- 	      else if (op == O_left_shift || op == O_right_shift)
- 		{
--		  if (seg_left != absolute_section || left != 0)
-+		  if (!(seg_left == absolute_section && left == 0))
- 		    {
- 		      op = O_symbol;
- 		      break;
-@@ -2149,6 +2152,7 @@
- 	      seg_left = seg_right;
- 	      left = right;
- 	      add_symbol = op_symbol;
-+	      orig_add_symbol = expressionP->X_op_symbol;
- 	      op = O_symbol;
- 	      break;
- 	    }
-@@ -2158,11 +2162,11 @@
- 	      op = O_symbol;
- 	      break;
- 	    }
--	  else if (left != right
--		   || ((seg_left != reg_section || seg_right != reg_section)
--		       && (seg_left != undefined_section
--			   || seg_right != undefined_section
--			   || add_symbol != op_symbol)))
-+	  else if (!(left == right
-+		     && ((seg_left == reg_section && seg_right == reg_section)
-+			 || (seg_left == undefined_section
-+			     && seg_right == undefined_section
-+			     && add_symbol == op_symbol))))
- 	    return 0;
- 	  else if (op == O_bit_and || op == O_bit_inclusive_or)
- 	    {
-@@ -2233,7 +2237,8 @@
- 	op = O_constant;
-       else if (seg_left == reg_section && final_val == 0)
- 	op = O_register;
--      else if (add_symbol != expressionP->X_add_symbol)
-+      else if (seg_left == undefined_section
-+	       && add_symbol != orig_add_symbol)
- 	final_val += left;
-       expressionP->X_add_symbol = add_symbol;
-     }
diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix
index 1bb110e35fd..3e3dedd1e83 100644
--- a/pkgs/development/tools/misc/binutils/default.nix
+++ b/pkgs/development/tools/misc/binutils/default.nix
@@ -1,14 +1,14 @@
 {stdenv, fetchurl, noSysDirs, cross ? null}:
 
 let
-    basename = "binutils-2.20";
+    basename = "binutils-2.20.1";
 in
 stdenv.mkDerivation rec {
   name = basename + stdenv.lib.optionalString (cross != null) "-${cross.config}";
 
   src = fetchurl {
     url = "mirror://gnu/binutils/${basename}.tar.bz2";
-    sha256 = "1c3m789p5rwmmnck5ms4zcnc40axss3gxzivz571al1vmbq0kpz1";
+    sha256 = "1y7nwsprhr4hvx9ps2l0l0ivb6k41rcrx1invmzqxs475mr892r2";
   };
 
   patches = [
@@ -16,8 +16,6 @@ stdenv.mkDerivation rec {
     # RUNPATH instead of RPATH on binaries.  This is important because
     # RUNPATH can be overriden using LD_LIBRARY_PATH at runtime.
     ./new-dtags.patch
-
-    ./as-pr10856.patch
   ];
 
   inherit noSysDirs;
diff --git a/pkgs/development/tools/misc/gnum4/default.nix b/pkgs/development/tools/misc/gnum4/default.nix
index 0c73ba1f738..717a48f11e6 100644
--- a/pkgs/development/tools/misc/gnum4/default.nix
+++ b/pkgs/development/tools/misc/gnum4/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl}:
 
 stdenv.mkDerivation {
-  name = "gnum4-1.4.13";
+  name = "gnum4-1.4.14";
 
   src = fetchurl {
-    url = mirror://gnu/m4/m4-1.4.13.tar.bz2;
-    sha256 = "01pcrajrk2rqhxbrij3j07ywyxlq7ih43a8pzvhdlxhlwfazxipw";
+    url = mirror://gnu/m4/m4-1.4.14.tar.bz2;
+    sha256 = "1ljddxjqw1642b26qzk87fahkv9rsv2cn2ygn6b3ldan6alzz188";
   };
 
   doCheck = !stdenv.isDarwin;
diff --git a/pkgs/os-specific/linux/klibc/default.nix b/pkgs/os-specific/linux/klibc/default.nix
index 8bd911ee080..0a2747eb165 100644
--- a/pkgs/os-specific/linux/klibc/default.nix
+++ b/pkgs/os-specific/linux/klibc/default.nix
@@ -1,8 +1,11 @@
-{stdenv, fetchurl, perl, bison, mktemp, linuxHeaders}:
+{stdenv, fetchurl, perl, bison, mktemp, linuxHeaders, linuxHeadersCross}:
 
 assert stdenv.isLinux;
 
-let version = "1.5.15"; in
+let
+  version = "1.5.15";
+  baseMakeFlags = ["V=1" "prefix=$out" "SHLIBDIR=$out/lib"];
+in
 
 stdenv.mkDerivation {
   name = "klibc-${version}";
@@ -12,15 +15,36 @@ stdenv.mkDerivation {
     sha256 = "1x401wmjca6zkyikf9xz45b3wb1hnj0m2s9in1sg6xdhi3pk8lwb";
   };
   
-  makeFlags = ["V=1" "prefix=$out" "SHLIBDIR=$out/lib"];
+  makeFlags = baseMakeFlags;
+
+  inherit linuxHeaders;
+
+  crossAttrs = {
+    name = "klibc-1.5.17";
+    src = fetchurl {
+      url = "mirror://kernel/linux/libs/klibc/Testing/klibc-1.5.17.tar.bz2";
+      sha256 = "1jmiszf9pdlzj9f72nkv50d7aqrzz12hrmw792xnd2lmn5nrfyx6";
+    };
+
+    makeFlags = baseMakeFlags ++ [ "CROSS_COMPILE=${stdenv.cross.config}-"
+        "KLIBCARCH=${stdenv.cross.arch}" ];
+
+    patchPhase = ''
+      sed -i /KLIBCKERNELSRC/d scripts/Kbuild.install
+    '';
+
+    linuxHeaders = linuxHeadersCross;
+  };
   
+  # The AEABI option concerns only arm systems, and does not affect the build for
+  # other systems.
   preBuild = ''
     sed -i /CONFIG_AEABI/d defconfig
     echo "CONFIG_AEABI=y" >> defconfig
     makeFlags=$(eval "echo $makeFlags")
 
     mkdir linux
-    cp -prsd ${linuxHeaders}/include linux/
+    cp -prsd $linuxHeaders/include linux/
     chmod -R u+w linux/include/
   ''; # */
   
@@ -32,5 +56,5 @@ stdenv.mkDerivation {
     cp usr/dash/sh $dir/
   '';
   
-  buildInputs = [perl bison mktemp];
+  buildNativeInputs = [ perl bison mktemp ];
 }
diff --git a/pkgs/os-specific/linux/uclibc/default.nix b/pkgs/os-specific/linux/uclibc/default.nix
index 83de2ae38ef..445a7f90fb6 100644
--- a/pkgs/os-specific/linux/uclibc/default.nix
+++ b/pkgs/os-specific/linux/uclibc/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, linuxHeaders, cross ? null, gccCross ? null}:
+{stdenv, fetchurl, linuxHeaders, libiconv, cross ? null, gccCross ? null}:
 
 assert stdenv.isLinux;
 assert cross != null -> gccCross != null;
@@ -31,12 +31,14 @@ stdenv.mkDerivation {
     sha256 = "0f1fpdwampbw7pf79i64ipj0azk4kbc9wl81ynlp19p92k4klz0h";
   };
 
+  # 'ftw' needed to build acl, a coreutils dependency
   configurePhase = ''
     make defconfig ${archMakeFlag}
     sed -e s@/usr/include@${linuxHeaders}/include@ \
       -e 's@^RUNTIME_PREFIX.*@RUNTIME_PREFIX="/"@' \
       -e 's@^DEVEL_PREFIX.*@DEVEL_PREFIX="/"@' \
       -e 's@.*UCLIBC_HAS_WCHAR.*@UCLIBC_HAS_WCHAR=y@' \
+      -e 's@.*UCLIBC_HAS_FTW.*@UCLIBC_HAS_FTW=y@' \
       -e 's@.*UCLIBC_HAS_RPC.*@UCLIBC_HAS_RPC=y@' \
       -e 's@.*DO_C99_MATH.*@DO_C99_MATH=y@' \
       -e 's@.*UCLIBC_HAS_PROGRAM_INVOCATION_NAME.*@UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y@' \
@@ -59,6 +61,11 @@ stdenv.mkDerivation {
     (cd $out/include && ln -s $(ls -d ${linuxHeaders}/include/* | grep -v "scsi$") .)
     sed -i s@/lib/@$out/lib/@g $out/lib/libc.so
   '';
+
+  passthru = {
+    # Derivations may check for the existance of this attribute, to know what to link to.
+    inherit libiconv;
+  };
   
   meta = {
     homepage = http://www.uclibc.org/;
diff --git a/pkgs/stdenv/adapters.nix b/pkgs/stdenv/adapters.nix
index 5282e30e315..67a09a9cc45 100644
--- a/pkgs/stdenv/adapters.nix
+++ b/pkgs/stdenv/adapters.nix
@@ -179,7 +179,9 @@ rec {
         in buildDrv // {
             inherit hostDrv buildDrv;
         };
-    } // { inherit cross; };
+    } // {
+      inherit cross gccCross binutilsCross;
+    };
 
     
   /* Modify a stdenv so that the specified attributes are added to
diff --git a/pkgs/tools/archivers/gnutar/default.nix b/pkgs/tools/archivers/gnutar/default.nix
index a49b4de52b0..437f9666388 100644
--- a/pkgs/tools/archivers/gnutar/default.nix
+++ b/pkgs/tools/archivers/gnutar/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl}:
 
 stdenv.mkDerivation rec {
-  name = "gnutar-1.22";
+  name = "gnutar-1.23";
   
   src = fetchurl {
-    url = "mirror://gnu/tar/tar-1.22.tar.bz2";
-    sha256 = "0kdaadflxa6wznbbrp0xlxk9926hrr4yg7wr6m98ygvs35zvdvrw";
+    url = "mirror://gnu/tar/tar-1.23.tar.bz2";
+    sha256 = "0dmyxsh0171m6nv8aw74dps1l4b1r7pkqkly9kcv3yv2vdr86cn9";
   };
   
   patches = [./implausible.patch];
diff --git a/pkgs/tools/compression/bzip2/default.nix b/pkgs/tools/compression/bzip2/default.nix
index 0523067cbad..e8ac6c6418c 100644
--- a/pkgs/tools/compression/bzip2/default.nix
+++ b/pkgs/tools/compression/bzip2/default.nix
@@ -10,6 +10,16 @@ stdenv.mkDerivation {
     sha256 = "08py2s9vw6dgw457lbklh1vsr3b8x8dlv7d8ygdfaxlx61l57gzp";
   };
 
+  crossAttrs = {
+    patchPhase = ''
+      sed -i -e 's/CC=gcc/CC=${stdenv.cross.config}-gcc/' \
+        -e 's/AR=ar/AR=${stdenv.cross.config}-ar/' \
+        -e 's/RANLIB=ranlib/RANLIB=${stdenv.cross.config}-ranlib/' \
+        -e 's/bzip2recover test/bzip2recover/' \
+        Makefile*
+    '';
+  };
+
   sharedLibrary =
     !stdenv.isDarwin && !(stdenv ? isDietLibC) && !(stdenv ? isStatic) && stdenv.system != "i686-cygwin" && !linkStatic;
 
diff --git a/pkgs/tools/misc/coreutils/default.nix b/pkgs/tools/misc/coreutils/default.nix
index d588c49e5c3..6f7c0923d99 100644
--- a/pkgs/tools/misc/coreutils/default.nix
+++ b/pkgs/tools/misc/coreutils/default.nix
@@ -8,7 +8,19 @@ stdenv.mkDerivation rec {
     sha256 = "0zq11lykc7hfs9nsdnb8gqk354l82hswqj38607mvwj3b0zqvc4b";
   };
 
-  buildInputs = [ perl gmp ] ++ stdenv.lib.optional aclSupport acl;
+  buildNativeInputs = [ perl ];
+  buildInputs = [ gmp ] ++ stdenv.lib.optional aclSupport acl;
+
+  crossAttrs = {
+    buildInputs = [ gmp ]
+      ++ stdenv.lib.optional aclSupport acl.hostDrv
+      ++ stdenv.lib.optional (stdenv.gccCross.libc ? libiconv)
+        stdenv.gccCross.libc.libiconv.hostDrv;
+
+    # Needed for fstatfs()
+    # I don't know why it is not properly detected cross building with glibc.
+    configureFlags = [ "fu_cv_sys_stat_statfs2_bsize=yes" ];
+  };
 
   # The tests are known broken on Cygwin
   # (http://thread.gmane.org/gmane.comp.gnu.core-utils.bugs/19025),
diff --git a/pkgs/tools/misc/findutils/default.nix b/pkgs/tools/misc/findutils/default.nix
index 2350ab26049..11ed1cf07b5 100644
--- a/pkgs/tools/misc/findutils/default.nix
+++ b/pkgs/tools/misc/findutils/default.nix
@@ -1,14 +1,14 @@
 {stdenv, fetchurl, coreutils}:
 
 stdenv.mkDerivation rec {
-  name = "findutils-4.4.1";
+  name = "findutils-4.4.2";
 
   src = fetchurl {
     url = "mirror://gnu/findutils/${name}.tar.gz";
-    sha256 = "0f61phan4q8w5i1lz768q973c1spfqgvc470jc89rpg0gxfvi9bp";
+    sha256 = "0amn0bbwqvsvvsh6drfwz20ydc2czk374lzw5kksbh6bf78k4ks3";
   };
 
-  buildInputs = [coreutils];
+  buildNativeInputs = [coreutils];
 
   patches = [ ./findutils-path.patch ./change_echo_path.patch ]
     # Note: the dietlibc patch is just to get findutils to compile.
@@ -17,6 +17,11 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
+  crossAttrs = {
+    # http://osdir.com/ml/bug-findutils-gnu/2009-08/msg00026.html
+    configureFlags = [ "gl_cv_func_wcwidth_works=yes" ];
+  };
+
   meta = {
     homepage = http://www.gnu.org/software/findutils/;
     description = "GNU Find Utilities, the basic directory searching utilities of the GNU operating system";
diff --git a/pkgs/tools/text/diffutils/default.nix b/pkgs/tools/text/diffutils/default.nix
index 44b7715607c..d75485cf047 100644
--- a/pkgs/tools/text/diffutils/default.nix
+++ b/pkgs/tools/text/diffutils/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation {
   };
   
   /* If no explicit coreutils is given, use the one from stdenv. */
-  buildInputs = [coreutils];
+  buildNativeInputs = [coreutils];
 
   meta = {
     homepage = http://www.gnu.org/software/diffutils/diffutils.html;
diff --git a/pkgs/tools/text/gnugrep/default.nix b/pkgs/tools/text/gnugrep/default.nix
index 609213aaa67..17d69404e0c 100644
--- a/pkgs/tools/text/gnugrep/default.nix
+++ b/pkgs/tools/text/gnugrep/default.nix
@@ -1,13 +1,13 @@
 {stdenv, fetchurl, pcre}:
 
-let version = "2.5.4"; in
+let version = "2.6.3"; in
 
 stdenv.mkDerivation {
   name = "gnugrep-${version}";
   
   src = fetchurl {
-    url = "mirror://gnu/grep/grep-${version}.tar.bz2";
-    sha256 = "0800lj1ywf43x5jnjyga56araak0f601sd9k5q1vv3s5057cdgha";
+    url = "mirror://gnu/grep/grep-${version}.tar.gz";
+    sha256 = "0rnnljzcpb2sl5zabww7gbzk9r6kp8kycsqrf909d6jdak8yah53";
   };
   
   buildInputs = [pcre];
diff --git a/pkgs/tools/text/gnupatch/default.nix b/pkgs/tools/text/gnupatch/default.nix
index cd2a67f6993..e6383f40a7c 100644
--- a/pkgs/tools/text/gnupatch/default.nix
+++ b/pkgs/tools/text/gnupatch/default.nix
@@ -17,6 +17,10 @@ stdenv.mkDerivation rec {
 
   buildInputs = (stdenv.lib.optional doCheck ed);
 
+  crossAttrs = {
+    configureFlags = [ "ac_cv_func_strnlen_working=yes" ];
+  };
+
   doCheck = true;
 
   meta = {
diff --git a/pkgs/tools/text/gnused/default.nix b/pkgs/tools/text/gnused/default.nix
index cea26999be0..6bfea5f103f 100644
--- a/pkgs/tools/text/gnused/default.nix
+++ b/pkgs/tools/text/gnused/default.nix
@@ -1,15 +1,12 @@
 {stdenv, fetchurl}:
 
 stdenv.mkDerivation {
-  name = "gnused-4.1.5";
-  
+  name = "gnused-4.2.1";
+
   src = fetchurl {
-    url = mirror://gnu/sed/sed-4.1.5.tar.gz;
-    md5 = "7a1cbbbb3341287308e140bd4834c3ba";
+    url = mirror://gnu/sed/sed-4.2.1.tar.gz;
+    md5 = "0q1hzjvr6pzhaagidg7pj76k1fzz5nl15np7p72w9zcpw0f58ww7";
   };
-  
-  # !!! hack: this should go away in gnused > 4.1.5
-  patches = [./gettext-fix.patch];
 
   meta = {
     homepage = http://www.gnu.org/software/sed/;
@@ -24,6 +21,9 @@ stdenv.mkDerivation {
       multiple occurrences of a string within a file.
     '';
 
-    license = "GPLv2+";
+    license = "GPLv3+";
+
+    platforms = stdenv.lib.platforms.all;
+    maintainers = [ stdenv.lib.maintainers.ludo ];
   };
 }
diff --git a/pkgs/tools/text/gnused/gettext-fix.patch b/pkgs/tools/text/gnused/gettext-fix.patch
deleted file mode 100644
index 8ef7e8b5ce4..00000000000
--- a/pkgs/tools/text/gnused/gettext-fix.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-diff -rc sed-4.1.5-orig/configure sed-4.1.5/configure
-*** sed-4.1.5-orig/configure	Fri Feb  3 10:24:40 2006
---- sed-4.1.5/configure	Fri Jul 14 12:50:13 2006
-***************
-*** 11265,11277 ****
-        esac
-      done ;;
-      gettext-fix )
-!   sed -e '/^mkinstalldirs *=/a\' \
-!       -e "install_sh=$install_sh" \
-        -e 's/^mkinstalldirs *=.*/mkinstalldirs=$(MKINSTALLDIRS)/' \
-        intl/Makefile > intl/Makefile.tmp
-    mv intl/Makefile.tmp intl/Makefile
-!   sed -e '/^mkinstalldirs *=/a\' \
-!       -e "install_sh=$install_sh" \
-        -e 's/^mkinstalldirs *=.*/mkinstalldirs=$(MKINSTALLDIRS)/' \
-        po/Makefile > po/Makefile.tmp
-    mv po/Makefile.tmp po/Makefile ;;
---- 11265,11277 ----
-        esac
-      done ;;
-      gettext-fix )
-!   sed -e "/^mkinstalldirs *=/a\\
-! install_sh=$install_sh" \
-        -e 's/^mkinstalldirs *=.*/mkinstalldirs=$(MKINSTALLDIRS)/' \
-        intl/Makefile > intl/Makefile.tmp
-    mv intl/Makefile.tmp intl/Makefile
-!   sed -e "/^mkinstalldirs *=/a\\
-! install_sh=$install_sh" \
-        -e 's/^mkinstalldirs *=.*/mkinstalldirs=$(MKINSTALLDIRS)/' \
-        po/Makefile > po/Makefile.tmp
-    mv po/Makefile.tmp po/Makefile ;;
diff --git a/pkgs/tools/text/replace/default.nix b/pkgs/tools/text/replace/default.nix
index 0182a3bb48d..339bf510c4b 100644
--- a/pkgs/tools/text/replace/default.nix
+++ b/pkgs/tools/text/replace/default.nix
@@ -10,6 +10,10 @@ stdenv.mkDerivation {
 
   makeFlags = ["TREE=\$(out)"];
 
+  crossAttrs = {
+    makeFlags = [ "TREE=\$(out)" "CC=${stdenv.cross.config}-gcc" ];
+  };
+
   postInstall = "mv \$out/bin/replace \$out/bin/replace-literal";
 
   patches = [./malloc.patch];
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index f34cb0c8218..b4010ada3f7 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -2011,7 +2011,7 @@ let
 
   gcc44_realCross = lib.addMetaAttrs { platforms = []; }
     (makeOverridable (import ../development/compilers/gcc-4.4) {
-      inherit stdenv fetchurl texinfo gmp mpfr ppl cloogppl noSysDirs
+      inherit stdenv fetchurl texinfo gmp mpfr /* ppl cloogppl */ noSysDirs
           gettext which;
       binutilsCross = binutilsCross;
       libcCross = libcCross;
@@ -3841,7 +3841,7 @@ let
   };
 
   gmp =
-    if stdenv.system == "i686-darwin" then
+    if false then # XXX: stdenv.system == "i686-darwin" then
       # GMP 4.3.2 is broken on Darwin, so use 4.3.1.
       makeOverridable (import ../development/libraries/gmp/4.3.1.nix) {
         inherit stdenv fetchurl m4;
@@ -6196,7 +6196,7 @@ let
   };
 
   klibc = makeOverridable (import ../os-specific/linux/klibc) {
-    inherit fetchurl stdenv perl bison mktemp;
+    inherit fetchurl stdenv perl bison mktemp linuxHeadersCross;
     linuxHeaders = glibc.kernelHeaders;
   };
 
@@ -6458,7 +6458,7 @@ let
 */
 
   uclibcCross = import ../os-specific/linux/uclibc {
-    inherit fetchurl stdenv;
+    inherit fetchurl stdenv libiconv;
     linuxHeaders = linuxHeadersCross;
     gccCross = gccCrossStageStatic;
     cross = assert crossSystem != null; crossSystem;
diff --git a/pkgs/top-level/release-lib.nix b/pkgs/top-level/release-lib.nix
index 7350c4cc1b6..64530930ee5 100644
--- a/pkgs/top-level/release-lib.nix
+++ b/pkgs/top-level/release-lib.nix
@@ -9,14 +9,14 @@ rec {
   crossMaintainers = with pkgs.lib.maintainers; [ viric ];
 
   /* Set the Hydra scheduling priority for a job.  The default
-     priority (100) should be used for most jobs.  A different
+     priority (10) should be used for most jobs.  A different
      priority should only be used for a few particularly interesting
      jobs (in terms of giving feedback to developers), such as stdenv.
   */
   prio = level: job: toJob job // { schedulingPriority = level; };
 
   toJob = x: if builtins.isAttrs x then x else
-    { type = "job"; systems = x; schedulingPriority = 10; };
+    { type = "job"; systems = x; schedulingPriority = 5; };
 
   /* Perform a job on the given set of platforms.  The function `f' is
      called by Hydra for each platform, and should return some job