about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/audio/clementine/default.nix6
-rw-r--r--pkgs/applications/editors/codeblocks/default.nix9
-rw-r--r--pkgs/applications/graphics/hugin/default.nix4
-rw-r--r--pkgs/applications/graphics/leocad/default.nix5
-rw-r--r--pkgs/applications/misc/abook/default.nix18
-rw-r--r--pkgs/applications/networking/mailreaders/thunderbird/default.nix2
-rw-r--r--pkgs/applications/version-management/rcs/default.nix2
-rw-r--r--pkgs/build-support/cc-wrapper/cc-wrapper.sh58
-rw-r--r--pkgs/build-support/cc-wrapper/gnat-wrapper.sh16
-rw-r--r--pkgs/build-support/cc-wrapper/ld-wrapper.sh17
-rw-r--r--pkgs/build-support/cc-wrapper/setup-hook.sh12
-rw-r--r--pkgs/build-support/grsecurity/default.nix10
-rw-r--r--pkgs/build-support/setup-hooks/make-wrapper.sh6
-rw-r--r--pkgs/build-support/setup-hooks/separate-debug-info.sh15
-rw-r--r--pkgs/desktops/kde-4.14/kdebindings/pykde4-gcc-5.patch27
-rw-r--r--pkgs/desktops/kde-4.14/kdebindings/pykde4.nix2
-rw-r--r--pkgs/development/compilers/gcc/4.3/builder.sh144
-rw-r--r--pkgs/development/compilers/gcc/4.3/default.nix184
-rw-r--r--pkgs/development/compilers/gcc/4.3/ghdl-ortho-cflags.patch36
-rw-r--r--pkgs/development/compilers/gcc/4.3/ghdl-runtime-o2.patch13
-rw-r--r--pkgs/development/compilers/gcc/4.3/java-jvgenmain-link.patch17
-rw-r--r--pkgs/development/compilers/gcc/4.3/libmudflap-cpp.patch12
-rw-r--r--pkgs/development/compilers/gcc/4.3/no-sys-dirs-fortran.patch15
-rw-r--r--pkgs/development/compilers/gcc/4.3/no-sys-dirs.patch132
-rw-r--r--pkgs/development/compilers/gcc/4.3/pass-cxxcpp.patch21
-rw-r--r--pkgs/development/compilers/gcc/4.3/siginfo_t_fix.patch174
-rw-r--r--pkgs/development/compilers/gcc/4.4/builder.sh200
-rw-r--r--pkgs/development/compilers/gcc/4.4/default.nix310
-rw-r--r--pkgs/development/compilers/gcc/4.4/ghdl-ortho-cflags.patch111
-rw-r--r--pkgs/development/compilers/gcc/4.4/gnat-cflags.patch33
-rw-r--r--pkgs/development/compilers/gcc/4.4/libstdc++-target.patch15
-rw-r--r--pkgs/development/compilers/gcc/4.4/no-sys-dirs.patch66
-rw-r--r--pkgs/development/compilers/gcc/4.4/pass-cxxcpp.patch21
-rw-r--r--pkgs/development/compilers/gcc/4.4/pr41818.patch26
-rw-r--r--pkgs/development/compilers/gcc/4.4/siginfo_t_fix.patch174
-rw-r--r--pkgs/development/compilers/gcc/4.4/sources.nix26
-rw-r--r--pkgs/development/compilers/gcc/4.4/target-cpp.patch12
-rwxr-xr-xpkgs/development/compilers/gcc/4.4/update-gcc.sh64
-rw-r--r--pkgs/development/compilers/gcc/5/default.nix2
-rw-r--r--pkgs/development/compilers/gcc/5/use-old-abi.sh1
-rw-r--r--pkgs/development/compilers/gcl/default.nix7
-rw-r--r--pkgs/development/compilers/go/1.4.nix1
-rw-r--r--pkgs/development/compilers/go/new-binutils.patch194
-rw-r--r--pkgs/development/interpreters/clisp/2.44.1.nix2
-rw-r--r--pkgs/development/interpreters/clisp/default.nix2
-rw-r--r--pkgs/development/interpreters/hugs/default.nix21
-rw-r--r--pkgs/development/interpreters/io/default.nix3
-rw-r--r--pkgs/development/interpreters/perl/default.nix2
-rw-r--r--pkgs/development/interpreters/self/default.nix8
-rw-r--r--pkgs/development/libraries/aterm/2.5.nix1
-rw-r--r--pkgs/development/libraries/crypto++/default.nix1
-rw-r--r--pkgs/development/libraries/ffmpeg/generic.nix31
-rw-r--r--pkgs/development/libraries/glibc/builder.sh4
-rw-r--r--pkgs/development/libraries/glibc/default.nix19
-rw-r--r--pkgs/development/libraries/gsl/default.nix2
-rw-r--r--pkgs/development/libraries/libcli/default.nix9
-rw-r--r--pkgs/development/libraries/librdf/redland.nix3
-rw-r--r--pkgs/development/libraries/nghttp2/default.nix6
-rw-r--r--pkgs/development/libraries/openbabel/default.nix1
-rw-r--r--pkgs/development/libraries/openssl/default.nix14
-rw-r--r--pkgs/development/libraries/telepathy/qt/default.nix3
-rw-r--r--pkgs/development/libraries/vxl/default.nix2
-rw-r--r--pkgs/development/libraries/vxl/gcc5.patch15
-rw-r--r--pkgs/development/tools/misc/avarice/default.nix4
-rw-r--r--pkgs/development/tools/misc/binutils/default.nix13
-rw-r--r--pkgs/development/tools/misc/binutils/fix-bsymbolic.patch47
-rw-r--r--pkgs/development/tools/misc/binutils/pt-pax-flags-20121023.patch1786
-rw-r--r--pkgs/development/tools/misc/binutils/pt-pax-flags.patch233
-rw-r--r--pkgs/development/tools/misc/patchelf/default.nix4
-rw-r--r--pkgs/games/gsb/default.nix1
-rw-r--r--pkgs/games/zoom/default.nix15
-rw-r--r--pkgs/misc/emulators/higan/0001-change-flags.diff9
-rw-r--r--pkgs/os-specific/linux/kernel/linux-rpi.nix8
-rw-r--r--pkgs/os-specific/linux/kernel/perf.nix2
-rw-r--r--pkgs/os-specific/linux/kexectools/default.nix4
-rw-r--r--pkgs/servers/nosql/arangodb/default.nix2
-rw-r--r--pkgs/servers/sql/mariadb/default.nix2
-rw-r--r--pkgs/stdenv/darwin/default.nix15
-rw-r--r--pkgs/stdenv/generic/setup.sh16
-rw-r--r--pkgs/stdenv/linux/default.nix78
-rw-r--r--pkgs/stdenv/linux/make-bootstrap-tools.nix57
-rw-r--r--pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh2
-rw-r--r--pkgs/stdenv/native/default.nix1
-rw-r--r--pkgs/stdenv/nix/default.nix3
-rw-r--r--pkgs/tools/filesystems/mtdutils/default.nix11
-rw-r--r--pkgs/tools/filesystems/udftools/default.nix6
-rw-r--r--pkgs/tools/graphics/netpbm/default.nix2
-rw-r--r--pkgs/tools/misc/findutils/change_echo_path.patch12
-rw-r--r--pkgs/tools/misc/findutils/default.nix16
-rw-r--r--pkgs/tools/misc/findutils/disable-test-canonicalize.patch12
-rw-r--r--pkgs/tools/misc/findutils/findutils-path.patch12
-rw-r--r--pkgs/tools/misc/ipxe/default.nix2
-rw-r--r--pkgs/tools/misc/yad/default.nix8
-rw-r--r--pkgs/tools/networking/atftp/default.nix4
-rw-r--r--pkgs/tools/networking/cadaver/default.nix17
-rw-r--r--pkgs/tools/networking/curl/7.15.nix1
-rw-r--r--pkgs/tools/networking/eggdrop/b34a33255f56bbd2317c26da12d702796d67ed50.patch36
-rw-r--r--pkgs/tools/networking/eggdrop/default.nix5
-rw-r--r--pkgs/tools/networking/pingtcp/default.nix5
-rw-r--r--pkgs/tools/security/crackxls/default.nix6
-rw-r--r--pkgs/tools/security/haka/default.nix2
-rw-r--r--pkgs/tools/security/tpm-tools/03-fix-bool-error-parseStringWithValues.patch30
-rw-r--r--pkgs/tools/security/tpm-tools/default.nix2
-rw-r--r--pkgs/top-level/all-packages.nix53
-rw-r--r--pkgs/top-level/perl-packages.nix137
-rw-r--r--pkgs/top-level/release.nix1
106 files changed, 1064 insertions, 3987 deletions
diff --git a/pkgs/applications/audio/clementine/default.nix b/pkgs/applications/audio/clementine/default.nix
index c9b16b65267d..cf58dffef02c 100644
--- a/pkgs/applications/audio/clementine/default.nix
+++ b/pkgs/applications/audio/clementine/default.nix
@@ -50,6 +50,12 @@ let
     name = "clementine-free-${version}";
     inherit patches src buildInputs;
     enableParallelBuilding = true;
+    postPatch = ''
+      sed -i src/CMakeLists.txt \
+        -e 's,-Werror,,g' \
+        -e 's,-Wno-unknown-warning-option,,g' \
+        -e 's,-Wno-unused-private-field,,g'
+    '';
     meta = with stdenv.lib; {
       homepage = "http://www.clementine-player.org";
       description = "A multiplatform music player";
diff --git a/pkgs/applications/editors/codeblocks/default.nix b/pkgs/applications/editors/codeblocks/default.nix
index 3243dbf9f504..f11a8b5cc3a3 100644
--- a/pkgs/applications/editors/codeblocks/default.nix
+++ b/pkgs/applications/editors/codeblocks/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, autoconf, automake, libtool, pkgconfig, file, zip, wxGTK, gtk
-, contribPlugins ? false, hunspell, gamin, boost, libX11
+, contribPlugins ? false, hunspell, gamin, boost, libX11, cairo
 }:
 
 with { inherit (stdenv.lib) optionalString optional optionals; };
@@ -14,7 +14,9 @@ stdenv.mkDerivation rec {
     sha256 = "044njhps4cm1ijfdyr5f9wjyd0vblhrz9b4603ma52wcdq25093p";
   };
 
-  buildInputs = [ automake autoconf libtool pkgconfig file zip wxGTK gtk libX11 ]
+  nativeBuildInputs = [ automake autoconf libtool pkgconfig ];
+
+  buildInputs = [ file zip wxGTK gtk libX11 cairo ]
     ++ optionals contribPlugins [ hunspell gamin boost ];
   enableParallelBuilding = true;
   patches = [ ./writable-projects.patch ];
@@ -23,6 +25,9 @@ stdenv.mkDerivation rec {
   configureFlags = [ "--enable-pch=no" ]
     ++ optional contribPlugins "--with-contrib-plugins";
 
+  # for whatever reason, the build config does not set these flag ...
+  NIX_CFLAGS_COMPILE = "-lX11 -lcairo";
+
   # Fix boost 1.59 compat
   # Try removing in the next version
   CPPFLAGS = "-DBOOST_ERROR_CODE_HEADER_ONLY -DBOOST_SYSTEM_NO_DEPRECATED";
diff --git a/pkgs/applications/graphics/hugin/default.nix b/pkgs/applications/graphics/hugin/default.nix
index 97181cb0d1bf..338b3cf0f97e 100644
--- a/pkgs/applications/graphics/hugin/default.nix
+++ b/pkgs/applications/graphics/hugin/default.nix
@@ -1,6 +1,6 @@
 { stdenv, cmake, fetchurl, gnumake, pkgconfig, makeWrapper
 , boost, gettext, tclap, wxGTK
-, freeglut, glew, libXi, libXmu, mesa
+, freeglut, glew, libX11, libXi, libXmu, mesa, cairo
 , autopanosiftc, enblend-enfuse, exiv2, fftw, ilmbase, lensfun, libpng, libtiff
 , openexr, panotools, perlPackages, sqlite, vigra
 }:
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   NIX_CFLAGS_COMPILE = "-I${ilmbase}/include/OpenEXR";
 
   buildInputs = [ boost gettext tclap wxGTK
-                  freeglut glew libXi libXmu mesa
+                  freeglut glew libX11 libXi libXmu mesa cairo
                   exiv2 fftw ilmbase lensfun libtiff libpng openexr panotools
                   sqlite vigra
                   perlPackages.ImageExifTool makeWrapper
diff --git a/pkgs/applications/graphics/leocad/default.nix b/pkgs/applications/graphics/leocad/default.nix
index eaaf047c9bb3..9ca9c5921028 100644
--- a/pkgs/applications/graphics/leocad/default.nix
+++ b/pkgs/applications/graphics/leocad/default.nix
@@ -16,8 +16,11 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ qt4 zlib ];
 
-  prefixKey="INSTALL_PREFIX=";
+  prefixKey = "INSTALL_PREFIX=";
   configureScript = "qmake leocad.pro";
+  postPatch = ''
+    substituteInPlace common/camera.cpp --replace "isnan(" "std::isnan("
+  '';
 
   meta = with stdenv.lib; {
     description = "CAD program for creating virtual LEGO models";
diff --git a/pkgs/applications/misc/abook/default.nix b/pkgs/applications/misc/abook/default.nix
index 77e48e49dd89..2c4bc0f21284 100644
--- a/pkgs/applications/misc/abook/default.nix
+++ b/pkgs/applications/misc/abook/default.nix
@@ -1,15 +1,23 @@
-{ stdenv, fetchurl, pkgconfig, ncurses, readline }:
+{ stdenv, fetchurl, fetchpatch, pkgconfig, ncurses, readline }:
 
-let version = "0.6.0pre2"; in
 stdenv.mkDerivation rec {
-  name = "abook-${version}";
+  name = "abook-0.6.0pre2";
 
   src = fetchurl {
     url = "http://abook.sourceforge.net/devel/${name}.tar.gz";
-    sha256 = "59d444504109dd96816e003b3023175981ae179af479349c34fa70bc12f6d385";
+    sha256 = "11fkyq9bqw7s6jf38yglk8bsx0ar2wik0fq0ds0rdp8985849m2r";
   };
 
-  buildInputs = [ pkgconfig ncurses readline ];
+  patches = [
+    (fetchpatch {
+       url = "https://projects.archlinux.org/svntogit/packages.git/plain/trunk/gcc5.patch?h=packages/abook";
+       name = "gcc5.patch";
+       sha256 = "13n3qd6yy45i5n8ppjn9hj6y63ymjrq96280683xk7f7rjavw5nn";
+     })
+  ];
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ ncurses readline ];
 
   meta = {
     homepage = "http://abook.sourceforge.net/";
diff --git a/pkgs/applications/networking/mailreaders/thunderbird/default.nix b/pkgs/applications/networking/mailreaders/thunderbird/default.nix
index c1bee05c93b7..ef9ec03ecd9f 100644
--- a/pkgs/applications/networking/mailreaders/thunderbird/default.nix
+++ b/pkgs/applications/networking/mailreaders/thunderbird/default.nix
@@ -67,7 +67,7 @@ stdenv.mkDerivation rec {
                                "--enable-optimize" "--enable-strip" ])
     ++ [
       "--disable-javaxpcom"
-      "--enable-stdcxx-compat" # Avoid dependency on libstdc++ 4.7
+      #"--enable-stdcxx-compat" # Avoid dependency on libstdc++ 4.7
     ]
     ++ stdenv.lib.optional enableOfficialBranding "--enable-official-branding";
   in ''
diff --git a/pkgs/applications/version-management/rcs/default.nix b/pkgs/applications/version-management/rcs/default.nix
index a829af8aa235..44f72c3f0fe7 100644
--- a/pkgs/applications/version-management/rcs/default.nix
+++ b/pkgs/applications/version-management/rcs/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  NIX_CFLAGS_COMPILE = if stdenv.isDarwin then "-std=gnu99" else null;
+  NIX_CFLAGS_COMPILE = [ "-std=c99" ];
 
   meta = {
     homepage = http://www.gnu.org/software/rcs/;
diff --git a/pkgs/build-support/cc-wrapper/cc-wrapper.sh b/pkgs/build-support/cc-wrapper/cc-wrapper.sh
index 6e12a0d8bc8f..3c3dbc03d413 100644
--- a/pkgs/build-support/cc-wrapper/cc-wrapper.sh
+++ b/pkgs/build-support/cc-wrapper/cc-wrapper.sh
@@ -15,29 +15,37 @@ fi
 source @out@/nix-support/utils.sh
 
 
-# Figure out if linker flags should be passed.  GCC prints annoying
-# warnings when they are not needed.
+# Parse command line options and set several variables.
+# For instance, figure out if linker flags should be passed.
+# GCC prints annoying warnings when they are not needed.
 dontLink=0
 getVersion=0
 nonFlagArgs=0
+[[ "@prog@" = *++ ]] && isCpp=1 || isCpp=0
 
-for i in "$@"; do
-    if [ "$i" = -c ]; then
+params=("$@")
+n=0
+while [ $n -lt ${#params[*]} ]; do
+    p=${params[n]}
+    p2=${params[$((n+1))]}
+    if [ "$p" = -c ]; then
         dontLink=1
-    elif [ "$i" = -S ]; then
+    elif [ "$p" = -S ]; then
         dontLink=1
-    elif [ "$i" = -E ]; then
+    elif [ "$p" = -E ]; then
         dontLink=1
-    elif [ "$i" = -E ]; then
+    elif [ "$p" = -E ]; then
         dontLink=1
-    elif [ "$i" = -M ]; then
+    elif [ "$p" = -M ]; then
         dontLink=1
-    elif [ "$i" = -MM ]; then
+    elif [ "$p" = -MM ]; then
         dontLink=1
-    elif [ "$i" = -x ]; then
-        # At least for the cases c-header or c++-header we should set dontLink.
-        # I expect no one use -x other than making precompiled headers.
+    elif [[ "$p" = -x && "$p2" = *-header ]]; then
         dontLink=1
+    elif [[ "$p" = -x && "$p2" = c++* && "$isCpp" = 0 ]]; then
+        isCpp=1
+    elif [ "$p" = -nostdlib ]; then
+        isCpp=-1
     elif [ "${i:0:1}" != - ]; then
         nonFlagArgs=1
     elif [ "$i" = -m32 ]; then
@@ -45,6 +53,7 @@ for i in "$@"; do
             NIX_LDFLAGS="$NIX_LDFLAGS -dynamic-linker $(cat @out@/nix-support/dynamic-linker-m32)"
         fi
     fi
+    n=$((n + 1))
 done
 
 # If we pass a flag like -Wl, then gcc will call the linker unless it
@@ -58,7 +67,6 @@ fi
 
 
 # Optionally filter out paths not refering to the store.
-params=("$@")
 if [ "$NIX_ENFORCE_PURITY" = 1 -a -n "$NIX_STORE" ]; then
     rest=()
     n=0
@@ -76,18 +84,30 @@ if [ "$NIX_ENFORCE_PURITY" = 1 -a -n "$NIX_STORE" ]; then
         elif [ "$p" = -isystem ] && badPath "$p2"; then
             n=$((n + 1)); skip $p2
         else
-            rest=("${rest[@]}" "$p")
+            rest+=("$p")
         fi
         n=$((n + 1))
     done
     params=("${rest[@]}")
 fi
 
-if [[ "@prog@" = *++ ]]; then
-    if  echo "$@" | grep -qv -- -nostdlib; then
-        NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE ${NIX_CXXSTDLIB_COMPILE-@default_cxx_stdlib_compile@}"
-        NIX_CFLAGS_LINK="$NIX_CFLAGS_LINK $NIX_CXXSTDLIB_LINK"
-    fi
+
+# Clear march/mtune=native -- they bring impurity.
+if [ "$NIX_ENFORCE_NO_NATIVE" = 1 ]; then
+    rest=()
+    for i in "${params[@]}"; do
+        if [[ "$i" = -m*=native ]]; then
+            skip $i
+        else
+            rest+=("$i")
+        fi
+    done
+    params=("${rest[@]}")
+fi
+
+if [[ "$isCpp" = 1 ]]; then
+    NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE ${NIX_CXXSTDLIB_COMPILE-@default_cxx_stdlib_compile@}"
+    NIX_CFLAGS_LINK="$NIX_CFLAGS_LINK $NIX_CXXSTDLIB_LINK"
 fi
 
 # Add the flags for the C compiler proper.
diff --git a/pkgs/build-support/cc-wrapper/gnat-wrapper.sh b/pkgs/build-support/cc-wrapper/gnat-wrapper.sh
index ae46b40ac631..012f826a111e 100644
--- a/pkgs/build-support/cc-wrapper/gnat-wrapper.sh
+++ b/pkgs/build-support/cc-wrapper/gnat-wrapper.sh
@@ -62,7 +62,7 @@ if [ "$NIX_ENFORCE_PURITY" = 1 -a -n "$NIX_STORE" ]; then
         elif [ "${p:0:4}" = -aO/ ] && badPath "${p:3}"; then
             skip $p
         else
-            rest=("${rest[@]}" "$p")
+            rest+=("$p")
         fi
         n=$((n + 1))
     done
@@ -70,6 +70,20 @@ if [ "$NIX_ENFORCE_PURITY" = 1 -a -n "$NIX_STORE" ]; then
 fi
 
 
+# Clear march/mtune=native -- they bring impurity.
+if [ "$NIX_ENFORCE_NO_NATIVE" = 1 ]; then
+    rest=()
+    for i in "${params[@]}"; do
+        if [[ "$i" = -m*=native ]]; then
+            skip $i
+        else
+            rest+=("$i")
+        fi
+    done
+    params=("${rest[@]}")
+fi
+
+
 # Add the flags for the GNAT compiler proper.
 extraAfter=($NIX_GNATFLAGS_COMPILE)
 extraBefore=()
diff --git a/pkgs/build-support/cc-wrapper/ld-wrapper.sh b/pkgs/build-support/cc-wrapper/ld-wrapper.sh
index 6ef06eb70348..449a86459045 100644
--- a/pkgs/build-support/cc-wrapper/ld-wrapper.sh
+++ b/pkgs/build-support/cc-wrapper/ld-wrapper.sh
@@ -146,11 +146,26 @@ if [ "$NIX_DONT_SET_RPATH" != 1 ]; then
 
     # Finally, add `-rpath' switches.
     for i in $rpath; do
-        extra=(${extra[@]} -rpath $i)
+        extra+=(-rpath $i)
     done
 fi
 
 
+# Only add --build-id if this is a final link. FIXME: should build gcc
+# with --enable-linker-build-id instead?
+if [ "$NIX_SET_BUILD_ID" = 1 ]; then
+    for p in "${params[@]}"; do
+        if [ "$p" = "-r" -o "$p" = "--relocatable" -o "$p" = "-i" ]; then
+            relocatable=1
+            break
+        fi
+    done
+    if [ -z "$relocatable" ]; then
+        extra+=(--build-id)
+    fi
+fi
+
+
 # Optionally print debug info.
 if [ -n "$NIX_DEBUG" ]; then
   echo "original flags to @prog@:" >&2
diff --git a/pkgs/build-support/cc-wrapper/setup-hook.sh b/pkgs/build-support/cc-wrapper/setup-hook.sh
index 3d0b2fdfe8ae..35620483d2bc 100644
--- a/pkgs/build-support/cc-wrapper/setup-hook.sh
+++ b/pkgs/build-support/cc-wrapper/setup-hook.sh
@@ -22,20 +22,20 @@ envHooks+=(addCVars)
 
 # Note: these come *after* $out in the PATH (see setup.sh).
 
-if [ -n "@cc@" ]; then
-    addToSearchPath PATH @cc@/bin
+if [ -n "@binutils@" ]; then
+    addToSearchPath _PATH @binutils@/bin
 fi
 
-if [ -n "@binutils@" ]; then
-    addToSearchPath PATH @binutils@/bin
+if [ -n "@cc@" ]; then
+    addToSearchPath _PATH @cc@/bin
 fi
 
 if [ -n "@libc@" ]; then
-    addToSearchPath PATH @libc@/bin
+    addToSearchPath _PATH @libc@/bin
 fi
 
 if [ -n "@coreutils@" ]; then
-    addToSearchPath PATH @coreutils@/bin
+    addToSearchPath _PATH @coreutils@/bin
 fi
 
 if [ -z "$crossConfig" ]; then
diff --git a/pkgs/build-support/grsecurity/default.nix b/pkgs/build-support/grsecurity/default.nix
index 64cce3dbad52..18719e6e22ba 100644
--- a/pkgs/build-support/grsecurity/default.nix
+++ b/pkgs/build-support/grsecurity/default.nix
@@ -116,12 +116,14 @@ let
     grsecurityOverrider = args: grkern: {
       # Apparently as of gcc 4.6, gcc-plugin headers (which are needed by PaX plugins)
       # include libgmp headers, so we need these extra tweaks
-      buildInputs = args.buildInputs ++ [ pkgs.gmp ];
+      # As of gcc5 we also need libmpc
+      buildInputs = args.buildInputs ++ [ pkgs.gmp pkgs.libmpc pkgs.mpfr ];
       preConfigure = ''
+        extraIncludes="-I${pkgs.gmp}/include -I${pkgs.libmpc}/include -I${pkgs.mpfr}/include"
         ${args.preConfigure or ""}
-        sed -i 's|-I|-I${pkgs.gmp}/include -I|' scripts/gcc-plugin.sh
-        sed -i 's|HOST_EXTRACFLAGS +=|HOST_EXTRACFLAGS += -I${pkgs.gmp}/include|' tools/gcc/Makefile
-        sed -i 's|HOST_EXTRACXXFLAGS +=|HOST_EXTRACXXFLAGS += -I${pkgs.gmp}/include|' tools/gcc/Makefile
+        sed -i "s|-I|$extraIncludes -I|" scripts/gcc-plugin.sh
+        sed -i "s|HOST_EXTRACFLAGS +=|HOST_EXTRACFLAGS += $extraIncludes|" tools/gcc/Makefile
+        sed -i "s|HOST_EXTRACXXFLAGS +=|HOST_EXTRACXXFLAGS += $extraIncludes|" tools/gcc/Makefile
         rm localversion-grsec
         echo ${localver grkern} > localversion-grsec
       '';
diff --git a/pkgs/build-support/setup-hooks/make-wrapper.sh b/pkgs/build-support/setup-hooks/make-wrapper.sh
index 5150b4f0218a..7d0f88abb855 100644
--- a/pkgs/build-support/setup-hooks/make-wrapper.sh
+++ b/pkgs/build-support/setup-hooks/make-wrapper.sh
@@ -19,6 +19,12 @@ makeWrapper() {
             echo "export $varName=$value" >> $wrapper
         fi
 
+        if test "$p" = "--unset"; then
+            varName=${params[$((n + 1))]}
+            n=$((n + 1))
+            echo "unset $varName" >> "$wrapper"
+        fi
+
         if test "$p" = "--run"; then
             command=${params[$((n + 1))]}
             n=$((n + 1))
diff --git a/pkgs/build-support/setup-hooks/separate-debug-info.sh b/pkgs/build-support/setup-hooks/separate-debug-info.sh
index 37753d9ce406..518be9647334 100644
--- a/pkgs/build-support/setup-hooks/separate-debug-info.sh
+++ b/pkgs/build-support/setup-hooks/separate-debug-info.sh
@@ -1,5 +1,6 @@
-export NIX_LDFLAGS+=" --build-id"
-export NIX_CFLAGS_COMPILE+=" -ggdb"
+export NIX_SET_BUILD_ID=1
+export NIX_LDFLAGS+=" --compress-debug-sections=zlib"
+export NIX_CFLAGS_COMPILE+=" -ggdb -Wa,--compress-debug-sections"
 dontStrip=1
 
 fixupOutputHooks+=(_separateDebugInfo)
@@ -25,18 +26,10 @@ _separateDebugInfo() {
         # Extract the debug info.
         header "separating debug info from $i (build ID $id)"
         mkdir -p "$dst/${id:0:2}"
-        objcopy --only-keep-debug "$i" "$dst/${id:0:2}/${id:2}.debug" --compress-debug-sections
+        objcopy --only-keep-debug "$i" "$dst/${id:0:2}/${id:2}.debug"
         strip --strip-debug "$i"
 
         # Also a create a symlink <original-name>.debug.
         ln -sfn ".build-id/${id:0:2}/${id:2}.debug" "$dst/../$(basename "$i")"
     done < <(find "$prefix" -type f -print0)
 }
-
-# - We might prefer to compress the debug info during link-time already,
-#   but our ld doesn't support --compress-debug-sections=zlib (yet).
-# - Debug info may cause problems due to excessive memory usage during linking.
-#   Using -Wa,--compress-debug-sections should help with that;
-#   further interesting information: https://gcc.gnu.org/wiki/DebugFission
-# - Another related tool: https://fedoraproject.org/wiki/Features/DwarfCompressor
-
diff --git a/pkgs/desktops/kde-4.14/kdebindings/pykde4-gcc-5.patch b/pkgs/desktops/kde-4.14/kdebindings/pykde4-gcc-5.patch
new file mode 100644
index 000000000000..27925a3e3548
--- /dev/null
+++ b/pkgs/desktops/kde-4.14/kdebindings/pykde4-gcc-5.patch
@@ -0,0 +1,27 @@
+https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fb0ed8c85dd15fb18a902b22a7555ba4f7cf01cb
+
+Patch created by: Erik Zeek
+
+See also: https://bugs.gentoo.org/show_bug.cgi?id=567022
+
+--- a/CMakeLists.txt
++++ a/CMakeLists.txt
+@@ -166,7 +166,7 @@ add_sip_python_module(PyKDE4.kdeui sip/kdeui/kdeuimod.sip ${KDE4_KDEUI_LIBS} ${Q
+ 
+ file(GLOB kio_files_sip sip/kio/*.sip)
+ set(SIP_EXTRA_FILES_DEPEND ${kio_files_sip})
+-add_sip_python_module(PyKDE4.kio sip/kio/kiomod.sip ${KDE4_KIO_LIBS} ${KDE4_KFILE_LIBS})
++add_sip_python_module(PyKDE4.kio sip/kio/kiomod.sip ${KDE4_SOLID_LIBS} ${KDE4_KIO_LIBS} ${KDE4_KFILE_LIBS})
+ 
+ file(GLOB kutils_files_sip sip/kutils/*.sip)
+ set(SIP_EXTRA_FILES_DEPEND ${kutils_files_sip})
+@@ -190,7 +190,7 @@ add_sip_python_module(PyKDE4.knewstuff sip/knewstuff/knewstuffmod.sip ${KDE4_KNE
+ 
+ file(GLOB dnssd_files_sip sip/dnssd/*.sip)
+ set(SIP_EXTRA_FILES_DEPEND ${dnssd_files_sip})
+-add_sip_python_module(PyKDE4.dnssd sip/dnssd/dnssdmod.sip ${KDE4_KDNSSD_LIBS} ${QT_QTCORE_LIBRARY})
++add_sip_python_module(PyKDE4.dnssd sip/dnssd/dnssdmod.sip ${KDE4_KDNSSD_LIBS} ${QT_QTCORE_LIBRARY} ${QT_QTNETWORK_LIBRARY})
+ 
+ file(GLOB phonon_files_sip sip/phonon/*.sip)
+ set(SIP_EXTRA_FILES_DEPEND ${phonon_files_sip})
+
diff --git a/pkgs/desktops/kde-4.14/kdebindings/pykde4.nix b/pkgs/desktops/kde-4.14/kdebindings/pykde4.nix
index 191b96380e6f..5a911d4b3ea3 100644
--- a/pkgs/desktops/kde-4.14/kdebindings/pykde4.nix
+++ b/pkgs/desktops/kde-4.14/kdebindings/pykde4.nix
@@ -5,6 +5,8 @@ let pydir = "lib/python${python.majorVersion}"; in
 
 kde {
 
+  patches = [ ./pykde4-gcc-5.patch ];
+
   # todo: polkit isn't found by the build system
 
   buildInputs = [
diff --git a/pkgs/development/compilers/gcc/4.3/builder.sh b/pkgs/development/compilers/gcc/4.3/builder.sh
deleted file mode 100644
index 16e53d9f2313..000000000000
--- a/pkgs/development/compilers/gcc/4.3/builder.sh
+++ /dev/null
@@ -1,144 +0,0 @@
-source $stdenv/setup
-
-
-export NIX_FIXINC_DUMMY=$NIX_BUILD_TOP/dummy
-mkdir $NIX_FIXINC_DUMMY
-
-
-# libstdc++ needs this; otherwise it will use /lib/cpp, which is a Bad
-# Thing.
-export CPP="gcc -E"
-
-
-if test "$noSysDirs" = "1"; then
-
-    if test -e $NIX_CC/nix-support/orig-libc; then
-
-        # Figure out what extra flags to pass to the gcc compilers
-        # being generated to make sure that they use our glibc.
-        extraCFlags="$(cat $NIX_CC/nix-support/libc-cflags)"
-        extraLDFlags="$(cat $NIX_CC/nix-support/libc-ldflags) $(cat $NIX_CC/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).
-        export NIX_FIXINC_DUMMY=$(cat $NIX_CC/nix-support/orig-libc)/include
-        
-    else
-        # Hack: support impure environments.
-        extraCFlags="-isystem /usr/include"
-        extraLDFlags="-L/usr/lib64 -L/usr/lib"
-        export NIX_FIXINC_DUMMY=/usr/include
-    fi
-
-
-    extraCFlags="-g0 -I$gmp/include -I$mpfr/include $extraCFlags"
-    extraLDFlags="--strip-debug $extraLDFlags"
-
-    export NIX_EXTRA_CFLAGS=$extraCFlags
-    for i in $extraLDFlags; do
-        export NIX_EXTRA_LDFLAGS="$NIX_EXTRA_LDFLAGS -Wl,$i"
-    done
-
-    if test -n "$targetConfig"; then
-        if test -z "$crossStageStatic"; then
-            extraXCFlags="-B${libcCross}/lib -idirafter ${libcCross}/include"
-            extraXLDFlags="-L${libcCross}/lib"
-            export NIX_EXTRA_CFLAGS_TARGET=$extraXCFlags
-            for i in $extraXLDFlags; do
-                export NIX_EXTRA_LDFLAGS_TARGET="$NIX_EXTRA_LDFLAGS_TARGET -Wl,$i"
-            done
-        fi
-
-        makeFlagsArray=( \
-            "${makeFlagsArray[@]}" \
-            NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
-            SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
-            CFLAGS_FOR_TARGET="$NIX_EXTRA_CFLAGS_TARGET $NIX_EXTRA_LDFLAGS_TARGET" \
-            LDFLAGS_FOR_TARGET="$NIX_EXTRA_CFLAGS_TARGET $NIX_EXTRA_LDFLAGS_TARGET" \
-            )
-    else
-        export NIX_EXTRA_CFLAGS_TARGET=$NIX_EXTRA_CFLAGS
-        export NIX_EXTRA_LDFLAGS_TARGET=$NIX_EXTRA_LDFLAGS
-        makeFlagsArray=( \
-            "${makeFlagsArray[@]}" \
-            NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
-            SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
-            CFLAGS_FOR_BUILD="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
-            CFLAGS_FOR_TARGET="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
-            LDFLAGS_FOR_BUILD="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
-            LDFLAGS_FOR_TARGET="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
-            )
-    fi
-
-    if test -n "$targetConfig" -a "$crossStageStatic" == 1; then
-        # We don't want the gcc build to assume there will be a libc providing
-        # limits.h in this stagae
-        makeFlagsArray=( \
-            "${makeFlagsArray[@]}" \
-            LIMITS_H_TEST=false \
-            )
-    else
-        makeFlagsArray=( \
-            "${makeFlagsArray[@]}" \
-            LIMITS_H_TEST=true \
-            )
-    fi
-fi
-
-if test -n "$targetConfig"; then
-    # The host strip will destroy everything in the target binaries otherwise
-    dontStrip=1
-fi
-
-preConfigure() {
-    # Perform the build in a different directory.
-    mkdir ../build
-    cd ../build
-    configureScript=../$sourceRoot/configure
-}
-
-
-postInstall() {
-    # Remove precompiled headers for now.  They are very big and
-    # probably not very useful yet.
-    find $out/include -name "*.gch" -exec rm -rf {} \; -prune
-
-    # Remove `fixincl' to prevent a retained dependency on the
-    # previous gcc.
-    rm -rf $out/libexec/gcc/*/*/install-tools
-    rm -rf $out/lib/gcc/*/*/install-tools
-
-    # Get rid of some "fixed" header files
-    rm -rf $out/lib/gcc/*/*/include/root
-
-    # Replace hard links for i686-pc-linux-gnu-gcc etc. with symlinks.
-    for i in $out/bin/*-gcc*; do
-        if cmp -s $out/bin/gcc $i; then
-            ln -sfn gcc $i
-        fi
-    done
-
-    for i in $out/bin/*-c++* $out/bin/*-g++*; do
-        if cmp -s $out/bin/g++ $i; then
-            ln -sfn g++ $i
-        fi
-    done
-
-    eval "$postInstallGhdl"
-}
-
-
-if test -z "$targetConfig"; then
-    if test -z "$profiledCompiler"; then
-        buildFlags="bootstrap $buildFlags"
-    else    
-        buildFlags="profiledbootstrap $buildFlags"
-    fi
-else
-:
-#    buildFlags="all-gcc all-target-libgcc $buildFlags"
-#    installTargets="install-gcc install-target-libgcc"
-fi
-
-genericBuild
diff --git a/pkgs/development/compilers/gcc/4.3/default.nix b/pkgs/development/compilers/gcc/4.3/default.nix
deleted file mode 100644
index 3db8ee5f3ea7..000000000000
--- a/pkgs/development/compilers/gcc/4.3/default.nix
+++ /dev/null
@@ -1,184 +0,0 @@
-{ stdenv, fetchurl, noSysDirs
-, langC ? true, langCC ? true, langFortran ? false, langTreelang ? false
-, langJava ? false
-, langVhdl ? false
-, profiledCompiler ? false
-, staticCompiler ? false
-, enableShared ? true
-, texinfo ? null
-, gmp, mpfr
-, bison ? null, flex ? null
-, zlib ? null, boehmgc ? null
-, enableMultilib ? false
-, name ? "gcc"
-, cross ? null
-, binutilsCross ? null
-, libcCross ? null
-, crossStageStatic ? true
-, gnat ? null
-}:
-
-assert langTreelang -> bison != null && flex != null;
-
-assert cross != null -> profiledCompiler == false && enableMultilib == true;
-assert (cross != null && crossStageStatic) -> (langCC == false && langFortran
-== false && langTreelang == false);
-
-assert langVhdl -> gnat != null;
-
-with stdenv.lib;
-
-let
-  version = "4.3.6";
-
-  crossConfigureFlags =
-    "--target=${cross.config}" +
-    (if crossStageStatic then
-      " --disable-libssp --disable-nls" +
-      " --without-headers" +
-      " --disable-threads " +
-      " --disable-libmudflap " +
-      " --disable-libgomp " +
-      " --disable-shared"
-      else
-      " --with-headers=${libcCross}/include" +
-      " --enable-__cxa_atexit" +
-      " --enable-long-long" +
-      " --enable-threads=posix" +
-      " --enable-nls"
-      );
-  stageNameAddon = if crossStageStatic then "-stage-static" else
-    "-stage-final";
-  crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
-in
-
-stdenv.mkDerivation ({
-  name = "${name}-${version}" + crossNameAddon;
-
-  builder = ./builder.sh;
-
-  src =
-    optional /*langC*/ true (fetchurl {
-      url = "mirror://gcc/releases/gcc-${version}/gcc-core-${version}.tar.bz2";
-      sha256 = "0ygrfw3hgp48hkqipbl9lw38f27npigc2sm6f01g9iswpq1igbw6";
-    }) ++
-    optional langCC (fetchurl {
-      url = "mirror://gcc/releases/gcc-${version}/gcc-g++-${version}.tar.bz2";
-      sha256 = "105xz3991b57zx3146xwlpchdb2sjmlknclvi1iac2gawm4mhxhf";
-    }) ++
-    optional langFortran (fetchurl {
-      url = "mirror://gcc/releases/gcc-${version}/gcc-fortran-${version}.tar.bz2";
-      sha256 = "12bqvf53hvhrwjnh101vn9frb5g8cr98cra4f11dzhzs4ppydpi1";
-    }) ++
-    optional langJava (fetchurl {
-      url = "mirror://gcc/releases/gcc-${version}/gcc-java-${version}.tar.bz2";
-      sha256 = "03w6jln9gmdv149s774rlw4rzi2zhbqna54r86cd6mql8flmy7fs";
-    });
-
-  patches =
-    [ ./pass-cxxcpp.patch ./libmudflap-cpp.patch ./siginfo_t_fix.patch ]
-    ++ optional noSysDirs ./no-sys-dirs.patch
-    ++ optional (noSysDirs && langFortran) ./no-sys-dirs-fortran.patch
-    ++ optional langJava ./java-jvgenmain-link.patch
-    ++ optional langVhdl ./ghdl-ortho-cflags.patch
-    ++ optional langVhdl ./ghdl-runtime-o2.patch;
-    
-  inherit noSysDirs profiledCompiler staticCompiler crossStageStatic
-    binutilsCross libcCross;
-  targetConfig = if cross != null then cross.config else null;
-
-  buildInputs = [texinfo gmp mpfr]
-    ++ (optionals langTreelang [bison flex])
-    ++ (optional (zlib != null) zlib)
-    ++ (optional (boehmgc != null) boehmgc)
-    ++ (optionals (cross != null) [binutilsCross])
-    ++ (optionals langVhdl [gnat])
-    ;
-
-  configureFlags = "
-    ${if enableMultilib then "" else "--disable-multilib"}
-    ${if enableShared then "" else "--disable-shared"}
-    --disable-libstdcxx-pch
-    --with-system-zlib
-    --enable-languages=${
-      concatStrings (intersperse ","
-        (  optional langC        "c"
-        ++ optional langCC       "c++"
-        ++ optional langFortran  "fortran"
-        ++ optional langJava     "java"
-        ++ optional langTreelang "treelang"
-        ++ optional langVhdl     "vhdl"
-        )
-      )
-    }
-    ${if stdenv.isi686 then "--with-arch=i686" else ""}
-    ${if cross != null then crossConfigureFlags else ""}
-  ";
-  #Above I added a hack on making the build different than the host.
-
-  # Needed for the cross compilation to work
-  AR = "ar";
-  LD = "ld";
-  CC = "gcc";
-
-  NIX_EXTRA_LDFLAGS = if staticCompiler then "-static" else "";
-
-  inherit gmp mpfr;
-  
-  passthru = { inherit langC langCC langFortran langVhdl langTreelang
-      enableMultilib; };
-
-  # ghdl does not build fine with parallel building
-  enableParallelBuilding = !langVhdl;
-
-  meta = {
-    homepage = "http://gcc.gnu.org/";
-    license = "GPL/LGPL";
-    description = "GNU Compiler Collection, 4.3.x";
-    maintainers = with stdenv.lib.maintainers; [viric];
-    platforms = with stdenv.lib.platforms; linux;
-  };
-
-} // (if langJava then {
-  postConfigure = ''
-    make configure-gcc
-    sed -i gcc/Makefile -e 's@^CFLAGS = .*@& -I${zlib}/include@ ; s@^LDFLAGS = .*@& -L${zlib}/lib@'
-    sed -i gcc/Makefile -e 's@^CFLAGS = .*@& -I${boehmgc}/include@ ; s@^LDFLAGS = .*@& -L${boehmgc}/lib -lgc@'
-  '';
-} else {})
-// (if langVhdl then rec {
-  name = "ghdl-0.29";
-
-  ghdlSrc = fetchurl {
-    url = "http://ghdl.free.fr/ghdl-0.29.tar.bz2";
-    sha256 = "15mlinr1lwljwll9ampzcfcrk9bk0qpdks1kxlvb70xf9zhh2jva";
-  };
-
-  # Ghdl has some timestamps checks, storing file timestamps in '.cf' files.
-  # As we will change the timestamps to 1970-01-01 00:00:01, we also set the
-  # content of that .cf to that value. This way ghdl does not complain on
-  # the installed object files from the basic libraries (ieee, ...)
-  postInstallGhdl = ''
-    pushd $out
-    find . -name "*.cf" -exec \
-        sed 's/[0-9]*\.000" /19700101000001.000" /g' -i {} \;
-    popd
-  '';
-
-  postUnpack = ''
-    tar xvf ${ghdlSrc}
-    mv ghdl-*/vhdl gcc*/gcc
-    rm -Rf ghdl-*
-  '';
-
-  passthru.isGNU = true;
-
-  meta = {
-    homepage = "http://ghdl.free.fr/";
-    license = stdenv.lib.licenses.gpl2Plus;
-    description = "Complete VHDL simulator, using the GCC technology";
-    maintainers = with stdenv.lib.maintainers; [viric];
-    platforms = with stdenv.lib.platforms; linux;
-  };
-
-} else {}))
diff --git a/pkgs/development/compilers/gcc/4.3/ghdl-ortho-cflags.patch b/pkgs/development/compilers/gcc/4.3/ghdl-ortho-cflags.patch
deleted file mode 100644
index 14188083f761..000000000000
--- a/pkgs/development/compilers/gcc/4.3/ghdl-ortho-cflags.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-diff --git a/gcc/vhdl/Make-lang.in b/gcc/vhdl/Make-lang.in
-index 8f481df..681ac59 100644
---- a/gcc/vhdl/Make-lang.in
-+++ b/gcc/vhdl/Make-lang.in
-@@ -96,7 +96,7 @@ AGCC_GCCOBJ_DIR=../
- AGCC_INC_FLAGS=-I$(AGCC_GCCOBJ_DIR)/gcc -I$(AGCC_GCCSRC_DIR)/include \
-  -I$(AGCC_GCCSRC_DIR)/gcc -I$(AGCC_GCCSRC_DIR)/gcc/config \
-  -I$(AGCC_GCCSRC_DIR)/libcpp/include
--AGCC_CFLAGS=-g -Wall -DIN_GCC $(AGCC_INC_FLAGS)
-+AGCC_CFLAGS=-g -Wall -DIN_GCC $(AGCC_INC_FLAGS) $(CFLAGS)
- 
- AGCC_LOCAL_OBJS=ortho-lang.o
- 
-@@ -140,7 +140,7 @@ ghdl$(exeext): force
- 
- # Ghdl libraries.
- ghdllib: ghdl$(exeext) $(GCC_PASSES) force
--	$(MAKE_IN_VHDL) GRT_FLAGS="-O -g" ghdllib
-+	$(MAKE_IN_VHDL) GRT_FLAGS="-O -g $(CFLAGS)" ghdllib
- 
- # Build hooks:
- 
-diff --git a/gcc/vhdl/Makefile.in b/gcc/vhdl/Makefile.in
-index d754c6c..07abc4a 100644
---- a/gcc/vhdl/Makefile.in
-+++ b/gcc/vhdl/Makefile.in
-@@ -80,7 +80,8 @@ T_CPPFLAGS =
- X_ADAFLAGS =
- T_ADAFLAGS =
- 
--ADAC = $(CC)
-+# Never use the bootstrapped compiler, as it may not be built for ada
-+ADAC = gcc
- 
- ECHO = echo
- CHMOD = chmod
diff --git a/pkgs/development/compilers/gcc/4.3/ghdl-runtime-o2.patch b/pkgs/development/compilers/gcc/4.3/ghdl-runtime-o2.patch
deleted file mode 100644
index ddc455143c02..000000000000
--- a/pkgs/development/compilers/gcc/4.3/ghdl-runtime-o2.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/gcc/vhdl/Makefile.in b/gcc/vhdl/Makefile.in
-index b8d2ed0..0e8bd55 100644
---- a/gcc/vhdl/Makefile.in
-+++ b/gcc/vhdl/Makefile.in
-@@ -682,7 +682,7 @@ install-ghdllib: ghdllib grt.lst $(STD93_SRCS) $(STD87_SRCS) \
- 	PDIR=`pwd` && cd $(DESTDIR)$(VHDL_LIB_DIR) && \
- 	$(MAKE) -f $$PDIR/Makefile REL_DIR=../../.. \
- 	 LIBSRC_DIR="src" LIB93_DIR=lib/v93 LIB87_DIR=lib/v87 \
--	 ANALYZE="$$PDIR/../ghdl -a --GHDL1=$$PDIR/../ghdl1 --ieee=none" \
-+	 ANALYZE="$$PDIR/../ghdl -a --GHDL1=$$PDIR/../ghdl1 --ieee=none -Wc,-O2" \
- 	 std.v93 std.v87 ieee.v93 ieee.v87 synopsys.v93 synopsys.v87 mentor.v93
- # Copy std_standard (this is done after libraries, since they remove dirs).
- 	$(INSTALL_DATA) std87_standard.o \
diff --git a/pkgs/development/compilers/gcc/4.3/java-jvgenmain-link.patch b/pkgs/development/compilers/gcc/4.3/java-jvgenmain-link.patch
deleted file mode 100644
index 2612e8bfbbbc..000000000000
--- a/pkgs/development/compilers/gcc/4.3/java-jvgenmain-link.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-The `jvgenmain' executable must be linked against `vec.o', among others,
-since it uses its vector API.
-
---- gcc-4.3.3/gcc/java/Make-lang.in	2008-12-05 00:00:19.000000000 +0100
-+++ gcc-4.3.3/gcc/java/Make-lang.in	2009-07-03 16:11:41.000000000 +0200
-@@ -109,9 +109,9 @@ jcf-dump$(exeext): $(JCFDUMP_OBJS) $(LIB
- 	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(JCFDUMP_OBJS) \
- 		$(CPPLIBS) $(ZLIB) $(LDEXP_LIB) $(LIBS)
- 
--jvgenmain$(exeext): $(JVGENMAIN_OBJS) $(LIBDEPS)
-+jvgenmain$(exeext): $(JVGENMAIN_OBJS) $(LIBDEPS) $(BUILD_RTL)
- 	rm -f $@
--	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(JVGENMAIN_OBJS) $(LIBS)
-+	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(JVGENMAIN_OBJS) $(BUILD_RTL) $(LIBS)
- 
- #
- # Build hooks:
diff --git a/pkgs/development/compilers/gcc/4.3/libmudflap-cpp.patch b/pkgs/development/compilers/gcc/4.3/libmudflap-cpp.patch
deleted file mode 100644
index 09dfb26b20db..000000000000
--- a/pkgs/development/compilers/gcc/4.3/libmudflap-cpp.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/Makefile.in b/Makefile.in
-index d24c1af..b86e522 100644
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -230,6 +229,7 @@ RAW_CXX_TARGET_EXPORTS = \
- 
- NORMAL_TARGET_EXPORTS = \
- 	$(BASE_TARGET_EXPORTS) \
-+	CPP="$(CC_FOR_TARGET) -E"; export CPP; \
- 	CXX="$(CXX_FOR_TARGET)"; export CXX;
- 
- # Where to find GMP
diff --git a/pkgs/development/compilers/gcc/4.3/no-sys-dirs-fortran.patch b/pkgs/development/compilers/gcc/4.3/no-sys-dirs-fortran.patch
deleted file mode 100644
index 4568e57819b2..000000000000
--- a/pkgs/development/compilers/gcc/4.3/no-sys-dirs-fortran.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff -ru gcc-4.3.1-orig/libgfortran/configure gcc-4.3.1/libgfortran/configure
---- gcc-4.3.1-orig/libgfortran/configure	2008-06-06 16:49:11.000000000 +0200
-+++ gcc-4.3.1/libgfortran/configure	2008-06-27 08:25:08.000000000 +0200
-@@ -35405,6 +35405,11 @@
- # A language specific compiler.
- CC=$lt_compiler
- 
-+# Ugly hack to get libmudflap (and possibly other libraries) to build.
-+# Libtool filters out \`-B' flags when linking (why?), so the \`-B' flag
-+# to Glibc gets lost.  Here we forcibly add it to any invocation.
-+CC="\$CC $NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS"
-+
- # Is the compiler the GNU compiler?
- with_gcc=$GCC
- 
diff --git a/pkgs/development/compilers/gcc/4.3/no-sys-dirs.patch b/pkgs/development/compilers/gcc/4.3/no-sys-dirs.patch
deleted file mode 100644
index 69fa2c7de828..000000000000
--- a/pkgs/development/compilers/gcc/4.3/no-sys-dirs.patch
+++ /dev/null
@@ -1,132 +0,0 @@
-diff -ru gcc-4.3.1-orig/gcc/cppdefault.c gcc-4.3.1/gcc/cppdefault.c
---- gcc-4.3.1-orig/gcc/cppdefault.c	2007-07-26 10:37:01.000000000 +0200
-+++ gcc-4.3.1/gcc/cppdefault.c	2008-06-25 17:48:23.000000000 +0200
-@@ -41,6 +41,10 @@
- # undef CROSS_INCLUDE_DIR
- #endif
- 
-+#undef LOCAL_INCLUDE_DIR
-+#undef SYSTEM_INCLUDE_DIR
-+#undef STANDARD_INCLUDE_DIR
-+
- const struct default_include cpp_include_defaults[]
- #ifdef INCLUDE_DEFAULTS
- = INCLUDE_DEFAULTS;
-diff -ru gcc-4.3.1-orig/gcc/gcc.c gcc-4.3.1/gcc/gcc.c
---- gcc-4.3.1-orig/gcc/gcc.c	2008-03-02 23:55:19.000000000 +0100
-+++ gcc-4.3.1/gcc/gcc.c	2008-06-25 17:52:53.000000000 +0200
-@@ -1478,10 +1478,10 @@
- /* Default prefixes to attach to command names.  */
- 
- #ifndef STANDARD_STARTFILE_PREFIX_1
--#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
-+#define STANDARD_STARTFILE_PREFIX_1 ""
- #endif
- #ifndef STANDARD_STARTFILE_PREFIX_2
--#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
-+#define STANDARD_STARTFILE_PREFIX_2 ""
- #endif
- 
- #ifdef CROSS_DIRECTORY_STRUCTURE  /* Don't use these prefixes for a cross compiler.  */
-@@ -1515,8 +1515,8 @@
- /* For native compilers, these are well-known paths containing
-    components that may be provided by the system.  For cross
-    compilers, these paths are not used.  */
--static const char *const standard_exec_prefix_1 = "/usr/libexec/gcc/";
--static const char *const standard_exec_prefix_2 = "/usr/lib/gcc/";
-+static const char *const standard_exec_prefix_1 = "/no-such-path/";
-+static const char *const standard_exec_prefix_2 = "/no-such-path/";
- static const char *md_exec_prefix = MD_EXEC_PREFIX;
- static const char *md_startfile_prefix = MD_STARTFILE_PREFIX;
- static const char *md_startfile_prefix_1 = MD_STARTFILE_PREFIX_1;
-diff -ru gcc-4.3.1-orig/gcc/Makefile.in gcc-4.3.1/gcc/Makefile.in
---- gcc-4.3.1-orig/gcc/Makefile.in	2008-05-11 20:54:15.000000000 +0200
-+++ gcc-4.3.1/gcc/Makefile.in	2008-06-25 17:48:23.000000000 +0200
-@@ -378,7 +378,11 @@
- MD5_H	    = $(srcdir)/../include/md5.h
- 
- # Default native SYSTEM_HEADER_DIR, to be overridden by targets.
--NATIVE_SYSTEM_HEADER_DIR = /usr/include
-+# Nix: we override NATIVE_SYSTEM_HEADER_DIR in order to prevent
-+# `fixinc' from fixing header files in /usr/include.  However,
-+# NATIVE_SYSTEM_HEADER_DIR must point to an existing directory, so set
-+# it to some dummy directory.
-+NATIVE_SYSTEM_HEADER_DIR = $(NIX_FIXINC_DUMMY)
- # Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
- CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
- 
-@@ -3277,7 +3281,7 @@
-   -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
-   -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \
-   -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
--  -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \
-+  -DLOCAL_INCLUDE_DIR=\"/no-such-dir\" \
-   -DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \
-   -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
-   -DPREFIX=\"$(prefix)/\" \
-diff -ru gcc-4.3.1-orig/libgomp/configure gcc-4.3.1/libgomp/configure
---- gcc-4.3.1-orig/libgomp/configure	2008-01-24 17:23:13.000000000 +0100
-+++ gcc-4.3.1/libgomp/configure	2008-06-26 11:23:49.000000000 +0200
-@@ -21493,6 +21493,11 @@
- # A language specific compiler.
- CC=$lt_compiler
- 
-+# Ugly hack to get libmudflap (and possibly other libraries) to build.
-+# Libtool filters out \`-B' flags when linking (why?), so the \`-B' flag
-+# to Glibc gets lost.  Here we forcibly add it to any invocation.
-+CC="\$CC $NIX_EXTRA_CFLAGS_TARGET $NIX_EXTRA_LDFLAGS_TARGET"
-+
- # Is the compiler the GNU compiler?
- with_gcc=$GCC
- 
-Only in gcc-4.3.1/libgomp: configure~
-diff -ru gcc-4.3.1-orig/libmudflap/configure gcc-4.3.1/libmudflap/configure
---- gcc-4.3.1-orig/libmudflap/configure	2008-01-24 17:30:08.000000000 +0100
-+++ gcc-4.3.1/libmudflap/configure	2008-06-26 11:23:11.000000000 +0200
-@@ -14229,6 +14229,11 @@
- # A language specific compiler.
- CC=$lt_compiler
- 
-+# Ugly hack to get libmudflap (and possibly other libraries) to build.
-+# Libtool filters out \`-B' flags when linking (why?), so the \`-B' flag
-+# to Glibc gets lost.  Here we forcibly add it to any invocation.
-+CC="\$CC $NIX_EXTRA_CFLAGS_TARGET $NIX_EXTRA_LDFLAGS_TARGET"
-+
- # Is the compiler the GNU compiler?
- with_gcc=$GCC
- 
-Only in gcc-4.3.1/libmudflap: configure~
-diff -ru gcc-4.3.1-orig/libssp/configure gcc-4.3.1/libssp/configure
---- gcc-4.3.1-orig/libssp/configure	2008-01-24 17:33:29.000000000 +0100
-+++ gcc-4.3.1/libssp/configure	2008-06-26 11:23:25.000000000 +0200
-@@ -12142,6 +12142,11 @@
- # A language specific compiler.
- CC=$lt_compiler
- 
-+# Ugly hack to get libmudflap (and possibly other libraries) to build.
-+# Libtool filters out \`-B' flags when linking (why?), so the \`-B' flag
-+# to Glibc gets lost.  Here we forcibly add it to any invocation.
-+CC="\$CC $NIX_EXTRA_CFLAGS_TARGET $NIX_EXTRA_LDFLAGS_TARGET"
-+
- # Is the compiler the GNU compiler?
- with_gcc=$GCC
- 
-Only in gcc-4.3.1/libssp: configure~
-diff -ru gcc-4.3.1-orig/Makefile.in gcc-4.3.1/Makefile.in
---- gcc-4.3.1-orig/Makefile.in	2007-12-13 10:30:49.000000000 +0100
-+++ gcc-4.3.1/Makefile.in	2008-06-25 17:48:23.000000000 +0200
-@@ -405,6 +405,14 @@
- @host_makefile_frag@
- ###
- 
-+CFLAGS += $(NIX_EXTRA_CFLAGS)
-+CPPFLAGS_FOR_TARGET += $(NIX_EXTRA_CFLAGS_TARGET)
-+CXXFLAGS += $(NIX_EXTRA_CFLAGS)
-+LDFLAGS += $(NIX_EXTRA_LDFLAGS)
-+LDFLAGS_FOR_TARGET += $(NIX_EXTRA_LDFLAGS_TARGET)
-+BOOT_CFLAGS += $(NIX_EXTRA_CFLAGS)
-+BOOT_LDFLAGS += $(NIX_EXTRA_LDFLAGS)
-+
- # This is the list of directories that may be needed in RPATH_ENVVAR
- # so that prorgams built for the target machine work.
- TARGET_LIB_PATH = $(TARGET_LIB_PATH_libstdc++-v3)$(TARGET_LIB_PATH_libmudflap)$(TARGET_LIB_PATH_libssp)$(TARGET_LIB_PATH_libgomp)$(HOST_LIB_PATH_gcc)
diff --git a/pkgs/development/compilers/gcc/4.3/pass-cxxcpp.patch b/pkgs/development/compilers/gcc/4.3/pass-cxxcpp.patch
deleted file mode 100644
index 9b0676d4fdc9..000000000000
--- a/pkgs/development/compilers/gcc/4.3/pass-cxxcpp.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff -rc gcc-orig/Makefile.in gcc-4.1.1/Makefile.in
-*** gcc-orig/Makefile.in	Wed Jun 21 13:40:23 2006
---- gcc-4.1.1/Makefile.in	Wed Jun 21 14:19:44 2006
-***************
-*** 213,219 ****
-  RAW_CXX_TARGET_EXPORTS = \
-  	$(BASE_TARGET_EXPORTS) \
-  	CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
-! 	CXX="$(RAW_CXX_FOR_TARGET)"; export CXX;
-  
-  NORMAL_TARGET_EXPORTS = \
-  	$(BASE_TARGET_EXPORTS) \
---- 213,220 ----
-  RAW_CXX_TARGET_EXPORTS = \
-  	$(BASE_TARGET_EXPORTS) \
-  	CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
-! 	CXX="$(RAW_CXX_FOR_TARGET) $(CFLAGS_FOR_BUILD)"; export CXX; \
-! 	CXXCPP="$(RAW_CXX_FOR_TARGET) $(CFLAGS_FOR_BUILD) -E"; export CXXCPP;
-  
-  NORMAL_TARGET_EXPORTS = \
-  	$(BASE_TARGET_EXPORTS) \
diff --git a/pkgs/development/compilers/gcc/4.3/siginfo_t_fix.patch b/pkgs/development/compilers/gcc/4.3/siginfo_t_fix.patch
deleted file mode 100644
index 8b126cd08c36..000000000000
--- a/pkgs/development/compilers/gcc/4.3/siginfo_t_fix.patch
+++ /dev/null
@@ -1,174 +0,0 @@
-https://bugs.gentoo.org/424970
-
-fix from upstream for building with newer glibc versions
-
-From f0cdca2bf2230005025e13e7354fedb612933c96 Mon Sep 17 00:00:00 2001
-From: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
-Date: Fri, 20 Apr 2012 08:14:00 +0000
-Subject: [PATCH] 	struct siginfo vs. siginfo_t
-
-	Backport from trunk (but apply to gcc/):
-
-	2012-04-20  Thomas Schwinge  <thomas@codesourcery.com>
-
-gcc/
-	* config/alpha/linux-unwind.h (alpha_fallback_frame_state): Use
-	siginfo_t instead of struct siginfo.
-	* config/bfin/linux-unwind.h (bfin_fallback_frame_state): Likewise.
-	* config/i386/linux-unwind.h (x86_fallback_frame_state): Likewise.
-	* config/ia64/linux-unwind.h (ia64_fallback_frame_state)
-	(ia64_handle_unwabi): Likewise.
-	* config/mips/linux-unwind.h (mips_fallback_frame_state): Likewise.
-	* config/pa/linux-unwind.h (pa32_fallback_frame_state): Likewise.
-	* config/sh/linux-unwind.h (shmedia_fallback_frame_state)
-	(sh_fallback_frame_state): Likewise.
-	* config/xtensa/linux-unwind.h (xtensa_fallback_frame_state): Likewise.
-
-git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_5-branch@186613 138bc75d-0d04-0410-961f-82ee72b054a4
----
- gcc/ChangeLog                    |   20 ++++++++++++++++++++
- gcc/config/alpha/linux-unwind.h  |    4 ++--
- gcc/config/bfin/linux-unwind.h   |    6 +++---
- gcc/config/i386/linux-unwind.h   |    6 +++---
- gcc/config/ia64/linux-unwind.h   |    6 +++---
- gcc/config/mips/linux-unwind.h   |    5 +++--
- gcc/config/pa/linux-unwind.h     |    4 ++--
- gcc/config/sh/linux-unwind.h     |    9 +++++----
- gcc/config/xtensa/linux-unwind.h |    4 ++--
- 9 files changed, 43 insertions(+), 21 deletions(-)
-
-diff --git a/gcc/config/alpha/linux-unwind.h b/gcc/config/alpha/linux-unwind.h
-index 4c811dc..8c04b3b 100644
---- a/gcc/config/alpha/linux-unwind.h
-+++ b/gcc/config/alpha/linux-unwind.h
-@@ -49,7 +49,7 @@ alpha_fallback_frame_state (struct _Unwind_Context *context,
-   else if (pc[1] == 0x201f015f)		/* lda $0,NR_rt_sigreturn */
-     {
-       struct rt_sigframe {
--	struct siginfo info;
-+	siginfo_t info;
- 	struct ucontext uc;
-       } *rt_ = context->cfa;
-       sc = &rt_->uc.uc_mcontext;
-diff --git a/gcc/config/bfin/linux-unwind.h b/gcc/config/bfin/linux-unwind.h
-index 88c8285..15bb2f1 100644
---- a/gcc/config/bfin/linux-unwind.h
-+++ b/gcc/config/bfin/linux-unwind.h
-@@ -48,10 +48,10 @@ bfin_fallback_frame_state (struct _Unwind_Context *context,
-     {
-       struct rt_sigframe {
- 	int sig;
--	struct siginfo *pinfo;
-+	siginfo_t *pinfo;
- 	void *puc;
- 	char retcode[8];
--	struct siginfo info;
-+	siginfo_t info;
- 	struct ucontext uc;
-       } *rt_ = context->cfa;
- 
-diff --git a/gcc/config/i386/linux-unwind.h b/gcc/config/i386/linux-unwind.h
-index 36ee370..fe0ea3e 100644
---- a/gcc/config/i386/linux-unwind.h
-+++ b/gcc/config/i386/linux-unwind.h
-@@ -133,9 +133,9 @@ x86_fallback_frame_state (struct _Unwind_Context *context,
-     {
-       struct rt_sigframe {
- 	int sig;
--	struct siginfo *pinfo;
-+	siginfo_t *pinfo;
- 	void *puc;
--	struct siginfo info;
-+	siginfo_t info;
- 	struct ucontext uc;
-       } *rt_ = context->cfa;
-       /* The void * cast is necessary to avoid an aliasing warning.
-diff --git a/gcc/config/ia64/linux-unwind.h b/gcc/config/ia64/linux-unwind.h
-index 93f762d..da31259 100644
---- a/gcc/config/ia64/linux-unwind.h
-+++ b/gcc/config/ia64/linux-unwind.h
-@@ -47,7 +47,7 @@ ia64_fallback_frame_state (struct _Unwind_Context *context,
-       struct sigframe {
- 	char scratch[16];
- 	unsigned long sig_number;
--	struct siginfo *info;
-+	siginfo_t *info;
- 	struct sigcontext *sc;
-       } *frame_ = (struct sigframe *)context->psp;
-       struct sigcontext *sc = frame_->sc;
-@@ -137,7 +137,7 @@ ia64_handle_unwabi (struct _Unwind_Context *context, _Unwind_FrameState *fs)
-       struct sigframe {
- 	char scratch[16];
- 	unsigned long sig_number;
--	struct siginfo *info;
-+	siginfo_t *info;
- 	struct sigcontext *sc;
-       } *frame = (struct sigframe *)context->psp;
-       struct sigcontext *sc = frame->sc;
-diff --git a/gcc/config/mips/linux-unwind.h b/gcc/config/mips/linux-unwind.h
-index 02f7cd5..094ff58 100644
---- a/gcc/config/mips/linux-unwind.h
-+++ b/gcc/config/mips/linux-unwind.h
-@@ -75,7 +76,7 @@ mips_fallback_frame_state (struct _Unwind_Context *context,
-       struct rt_sigframe {
- 	u_int32_t ass[4];  /* Argument save space for o32.  */
- 	u_int32_t trampoline[2];
--	struct siginfo info;
-+	siginfo_t info;
- 	_sig_ucontext_t uc;
-       } *rt_ = context->cfa;
-       sc = &rt_->uc.uc_mcontext;
-diff --git a/gcc/config/pa/linux-unwind.h b/gcc/config/pa/linux-unwind.h
-index a0560e9..38b4eda 100644
---- a/gcc/config/pa/linux-unwind.h
-+++ b/gcc/config/pa/linux-unwind.h
-@@ -63,7 +63,7 @@ pa32_fallback_frame_state (struct _Unwind_Context *context,
-   int i;
-   struct sigcontext *sc;
-   struct rt_sigframe {
--    struct siginfo info;
-+    siginfo_t info;
-     struct ucontext uc;
-   } *frame;
- 
-diff --git a/gcc/config/sh/linux-unwind.h b/gcc/config/sh/linux-unwind.h
-index 94ed95d..5a78e31 100644
---- a/gcc/config/sh/linux-unwind.h
-+++ b/gcc/config/sh/linux-unwind.h
-@@ -80,9 +81,9 @@ shmedia_fallback_frame_state (struct _Unwind_Context *context,
- 	   && (*(unsigned long *) (pc+11)  == 0x6ff0fff0))
-     {
-       struct rt_sigframe {
--	struct siginfo *pinfo;
-+	siginfo_t *pinfo;
- 	void *puc;
--	struct siginfo info;
-+	siginfo_t info;
- 	struct ucontext uc;
-       } *rt_ = context->cfa;
-       /* The void * cast is necessary to avoid an aliasing warning.
-@@ -179,7 +180,7 @@ sh_fallback_frame_state (struct _Unwind_Context *context,
- 		&& (*(unsigned short *) (pc+14)  == 0x00ad))))
-     {
-       struct rt_sigframe {
--	struct siginfo info;
-+	siginfo_t info;
- 	struct ucontext uc;
-       } *rt_ = context->cfa;
-       /* The void * cast is necessary to avoid an aliasing warning.
-diff --git a/gcc/config/xtensa/linux-unwind.h b/gcc/config/xtensa/linux-unwind.h
-index 32e9349..2456497 100644
---- a/gcc/config/xtensa/linux-unwind.h
-+++ b/gcc/config/xtensa/linux-unwind.h
-@@ -62,7 +62,7 @@ xtensa_fallback_frame_state (struct _Unwind_Context *context,
-   struct sigcontext *sc;
- 
-   struct rt_sigframe {
--    struct siginfo info;
-+    siginfo_t info;
-     struct ucontext uc;
-   } *rt_;
- 
--- 
-1.7.9.7
-
diff --git a/pkgs/development/compilers/gcc/4.4/builder.sh b/pkgs/development/compilers/gcc/4.4/builder.sh
deleted file mode 100644
index 15476131e03d..000000000000
--- a/pkgs/development/compilers/gcc/4.4/builder.sh
+++ /dev/null
@@ -1,200 +0,0 @@
-source $stdenv/setup
-
-
-export NIX_FIXINC_DUMMY=$NIX_BUILD_TOP/dummy
-mkdir $NIX_FIXINC_DUMMY
-
-
-# libstdc++ needs this; otherwise it will use /lib/cpp, which is a Bad
-# Thing.
-export CPP="gcc -E"
-
-if test "$staticCompiler" = "1"; then
-    EXTRA_LDFLAGS="-static"
-else
-    EXTRA_LDFLAGS=""
-fi
-
-if test "$noSysDirs" = "1"; then
-
-    if test -e $NIX_CC/nix-support/orig-libc; then
-
-        # Figure out what extra flags to pass to the gcc compilers
-        # being generated to make sure that they use our glibc.
-        extraFlags="$(cat $NIX_CC/nix-support/libc-cflags)"
-        extraLDFlags="$(cat $NIX_CC/nix-support/libc-ldflags) $(cat $NIX_CC/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).
-        export NIX_FIXINC_DUMMY=$(cat $NIX_CC/nix-support/orig-libc)/include
-
-        # The path to the Glibc binaries such as `crti.o'.
-        glibc_libdir="$(cat $NIX_CC/nix-support/orig-libc)/lib"
-        
-    else
-        # Hack: support impure environments.
-        extraFlags="-isystem /usr/include"
-        extraLDFlags="-L/usr/lib64 -L/usr/lib"
-        glibc_libdir="/usr/lib"
-        export NIX_FIXINC_DUMMY=/usr/include
-    fi
-
-    extraFlags="-g0 -O2 -I$NIX_FIXINC_DUMMY $extraFlags"
-    extraLDFlags="--strip-debug -L$glibc_libdir -rpath $glibc_libdir $extraLDFlags"
-
-    EXTRA_FLAGS="$extraFlags"
-    for i in $extraLDFlags; do
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,$i"
-    done
-
-    if test -n "$targetConfig"; then
-        # Cross-compiling, we need gcc not to read ./specs in order to build
-        # the g++ compiler (after the specs for the cross-gcc are created).
-        # Having LIBRARY_PATH= makes gcc read the specs from ., and the build
-        # breaks. Having this variable comes from the default.nix code to bring
-        # gcj in.
-        unset LIBRARY_PATH
-        unset CPATH
-        if test -z "$crossStageStatic"; then
-            EXTRA_FLAGS_TARGET="-g0 -O2 -B${libcCross}/lib -idirafter ${libcCross}/include"
-            EXTRA_LDFLAGS_TARGET="-Wl,-L${libcCross}/lib"
-        fi
-    else
-        if test -z "$NIX_CC_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_CC_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_CC_CROSS/nix-support/libc-cflags)"
-            extraLDFlags="$(cat $NIX_CC_CROSS/nix-support/libc-ldflags) $(cat $NIX_CC_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_CC_CROSS/nix-support/orig-libc)/include
-
-            # The path to the Glibc binaries such as `crti.o'.
-            glibc_libdir="$(cat $NIX_CC_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
-    # for the startfiles.
-    makeFlagsArray=( \
-        "${makeFlagsArray[@]}" \
-        NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
-        SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
-        CFLAGS_FOR_BUILD="$EXTRA_FLAGS $EXTRA_LDFLAGS" \
-        CFLAGS_FOR_TARGET="$EXTRA_FLAGS_TARGET $EXTRA_LDFLAGS_TARGET" \
-        FLAGS_FOR_TARGET="$EXTRA_FLAGS_TARGET $EXTRA_LDFLAGS_TARGET" \
-        LDFLAGS_FOR_BUILD="$EXTRA_FLAGS $EXTRA_LDFLAGS" \
-        LDFLAGS_FOR_TARGET="$EXTRA_FLAGS_TARGET $EXTRA_LDFLAGS_TARGET" \
-        )
-
-    if test -z "$targetConfig"; then
-        makeFlagsArray=( \
-            "${makeFlagsArray[@]}" \
-            BOOT_CFLAGS="$EXTRA_FLAGS $EXTRA_LDFLAGS" \
-            BOOT_LDFLAGS="$EXTRA_FLAGS_TARGET $EXTRA_LDFLAGS_TARGET" \
-            )
-    fi
-
-    if test -n "$targetConfig" -a "$crossStageStatic" == 1; then
-        # We don't want the gcc build to assume there will be a libc providing
-        # limits.h in this stagae
-        makeFlagsArray=( \
-            "${makeFlagsArray[@]}" \
-            LIMITS_H_TEST=false \
-            )
-    else
-        makeFlagsArray=( \
-            "${makeFlagsArray[@]}" \
-            LIMITS_H_TEST=true \
-            )
-    fi
-fi
-
-if test -n "$targetConfig"; then
-    # The host strip will destroy some important details of the objects
-    dontStrip=1
-fi
-
-preConfigure() {
-    if test -n "$newlibSrc"; then
-        tar xvf "$newlibSrc" -C ..
-        ln -s ../newlib-*/newlib newlib
-        # Patch to get armvt5el working:
-        sed -i -e 's/ arm)/ arm*)/' newlib/configure.host
-    fi
-    # Bug - they packaged zlib
-    if test -d "zlib"; then
-        # This breaks the build without-headers, which should build only
-        # the target libgcc as target libraries.
-        # See 'configure:5370'
-        rm -Rf zlib
-    fi
-
-    # Perform the build in a different directory.
-    mkdir ../build
-    cd ../build
-    configureScript=../$sourceRoot/configure
-}
-
-
-postInstall() {
-    # Remove precompiled headers for now.  They are very big and
-    # probably not very useful yet.
-    find $out/include -name "*.gch" -exec rm -rf {} \; -prune
-
-    # Remove `fixincl' to prevent a retained dependency on the
-    # previous gcc.
-    rm -rf $out/libexec/gcc/*/*/install-tools
-    rm -rf $out/lib/gcc/*/*/install-tools
-
-    # Get rid of some "fixed" header files
-    rm -rf $out/lib/gcc/*/*/include/root
-
-    # Replace hard links for i686-pc-linux-gnu-gcc etc. with symlinks.
-    for i in $out/bin/*-gcc*; do
-        if cmp -s $out/bin/gcc $i; then
-            ln -sfn gcc $i
-        fi
-    done
-
-    for i in $out/bin/*-c++* $out/bin/*-g++*; do
-        if cmp -s $out/bin/g++ $i; then
-            ln -sfn g++ $i
-        fi
-    done
-
-    eval "$postInstallGhdl"
-}
-
-
-if test -z "$targetConfig" && test -z "$crossConfig"; then
-    if test -z "$profiledCompiler"; then
-        buildFlags="bootstrap $buildFlags"
-    else    
-        buildFlags="profiledbootstrap $buildFlags"
-    fi
-fi
-
-genericBuild
diff --git a/pkgs/development/compilers/gcc/4.4/default.nix b/pkgs/development/compilers/gcc/4.4/default.nix
deleted file mode 100644
index 47c8c86a95d5..000000000000
--- a/pkgs/development/compilers/gcc/4.4/default.nix
+++ /dev/null
@@ -1,310 +0,0 @@
-{ stdenv, fetchurl, noSysDirs
-, langC ? true, langCC ? true, langFortran ? false
-, langJava ? false
-, langAda ? false
-, langVhdl ? false
-, profiledCompiler ? false
-, staticCompiler ? false
-, enableShared ? true
-, texinfo ? null
-, gmp, mpfr, gettext, which
-, ppl ? null, cloogppl ? null  # used by the Graphite optimization framework
-, zlib ? null, boehmgc ? null
-, zip ? null, unzip ? null, pkgconfig ? null, gtk ? null, libart_lgpl ? null
-, libX11 ? null, libXt ? null, libSM ? null, libICE ? null, libXtst ? null
-, libXrender ? null, xproto ? null, renderproto ? null, xextproto ? null
-, libXrandr ? null, libXi ? null, inputproto ? null, randrproto ? null
-, gnatboot ? null
-, enableMultilib ? false
-, name ? "gcc"
-, cross ? null
-, binutilsCross ? null
-, libcCross ? null
-, crossStageStatic ? true
-, gnat ? null
-}:
-
-assert langJava     -> zip != null && unzip != null
-                       && zlib != null && boehmgc != null;
-assert langAda      -> gnatboot != null;
-assert langVhdl     -> gnat != null;
-
-with stdenv.lib;
-
-let version = "4.4.7";
-    javaEcj = fetchurl {
-      # The `$(top_srcdir)/ecj.jar' file is automatically picked up at
-      # `configure' time.
-
-      # XXX: Eventually we might want to take it from upstream.
-      url = "ftp://sourceware.org/pub/java/ecj-4.3.jar";
-      sha256 = "0jz7hvc0s6iydmhgh5h2m15yza7p2rlss2vkif30vm9y77m97qcx";
-    };
-
-    # Antlr (optional) allows the Java `gjdoc' tool to be built.  We want a
-    # binary distribution here to allow the whole chain to be bootstrapped.
-    javaAntlr = fetchurl {
-      url = http://www.antlr.org/download/antlr-3.1.3.jar;
-      sha256 = "1f41j0y4kjydl71lqlvr73yagrs2jsg1fjymzjz66mjy7al5lh09";
-    };
-
-    xlibs = [
-      libX11 libXt libSM libICE libXtst libXrender libXrandr libXi
-      xproto renderproto xextproto inputproto randrproto
-    ];
-
-    javaAwtGtk = langJava && gtk != null;
-
-    /* Cross-gcc settings */
-    gccArch = stdenv.lib.attrByPath [ "gcc" "arch" ] null cross;
-    gccCpu = stdenv.lib.attrByPath [ "gcc" "cpu" ] null cross;
-    gccAbi = stdenv.lib.attrByPath [ "gcc" "abi" ] null cross;
-    withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
-    withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
-    withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
-
-    crossConfigureFlags =
-      "--target=${cross.config}" +
-      withArch +
-      withCpu +
-      withAbi +
-      (if crossStageStatic then
-        " --disable-libssp --disable-nls" +
-        " --without-headers" +
-        " --disable-threads " +
-        " --disable-libmudflap " +
-        " --disable-libgomp " +
-        " --disable-shared" +
-        " --disable-decimal-float" # libdecnumber requires libc
-        else
-        " --with-headers=${libcCross}/include" +
-        " --enable-__cxa_atexit" +
-        " --enable-long-long" +
-        " --enable-threads=posix" +
-        " --enable-nls" +
-        " --disable-decimal-float" # No final libdecnumber (it may work only in 386)
-        );
-    stageNameAddon = if crossStageStatic then "-stage-static" else
-      "-stage-final";
-    crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
-
-in
-
-# We need all these X libraries when building AWT with GTK+.
-assert gtk != null -> (filter (x: x == null) xlibs) == [];
-
-stdenv.mkDerivation ({
-  name = "${name}-${version}" + crossNameAddon;
-
-  builder = ./builder.sh;
-
-  src = (import ./sources.nix) {
-    inherit fetchurl optional version;
-    inherit langC langCC langFortran langJava langAda;
-  };
-
-  patches =
-    [ ./pass-cxxcpp.patch
-
-      # libmudflap and libstdc++ receive the build CPP,
-      # and not the target.
-      # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42279
-      ./target-cpp.patch
-
-      # Bad mixture of build/target flags
-      ./libstdc++-target.patch
-
-      # Compatibility with newer Glibc.
-      ./siginfo_t_fix.patch
-    ]
-    ++ optional noSysDirs ./no-sys-dirs.patch
-    # The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its
-    # target libraries and tools.
-    ++ optional langAda ./gnat-cflags.patch
-    ++ optional langVhdl ./ghdl-ortho-cflags.patch
-    ++ optional (cross != null && cross.arch == "sparc64") ./pr41818.patch;
-
-  inherit noSysDirs profiledCompiler staticCompiler langJava crossStageStatic
-    libcCross;
-
-  nativeBuildInputs = [ texinfo which ];
-
-  buildInputs = [ gmp mpfr gettext ]
-    ++ (optional (ppl != null) ppl)
-    ++ (optional (cloogppl != null) cloogppl)
-    ++ (optional (zlib != null) zlib)
-    ++ (optional (boehmgc != null) boehmgc)
-    ++ (optionals langJava [zip unzip])
-    ++ (optionals javaAwtGtk ([gtk pkgconfig libart_lgpl] ++ xlibs))
-    ++ (optionals (cross != null) [binutilsCross])
-    ++ (optionals langAda [gnatboot])
-    ++ (optionals langVhdl [gnat])
-    ;
-
-  configureFlags = "
-    ${if enableMultilib then "" else "--disable-multilib"}
-    ${if enableShared then "" else "--disable-shared"}
-    ${if ppl != null then "--with-ppl=${ppl}" else ""}
-    ${if cloogppl != null then "--with-cloog=${cloogppl}" else ""}
-    ${if langJava then "--with-ecj-jar=${javaEcj}" else ""}
-    ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
-    ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr}" else ""}
-    --with-gmp=${gmp}
-    --with-mpfr=${mpfr}
-    --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 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 ""}
-  ";
-
-  targetConfig = if cross != null then cross.config else null;
-
-  # Needed for the cross compilation to work
-  AR = "ar";
-  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_CC_CROSS = if cross == null then "${stdenv.ccCross}" else "";
-    configureFlags = "
-      ${if enableMultilib then "" else "--disable-multilib"}
-      ${if enableShared then "" else "--disable-shared"}
-      ${if ppl != null then "--with-ppl=${ppl.crossDrv}" else ""}
-      ${if cloogppl != null then "--with-cloog=${cloogppl.crossDrv}" else ""}
-      ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""}
-      ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
-      ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""}
-      --with-gmp=${gmp.crossDrv}
-      --with-mpfr=${mpfr.crossDrv}
-      --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 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.
-
-  # Note: When building the Java AWT GTK+ peer, the build system doesn't
-  # honor `--with-gmp' et al., e.g., when building
-  # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just
-  # add them to $CPATH and $LIBRARY_PATH in this case.
-
-  CPATH = concatStrings
-            (intersperse ":" (map (x: x + "/include")
-                                  (optionals langJava [ boehmgc zlib ]
-                                   ++ optionals javaAwtGtk xlibs
-                                   ++ optionals javaAwtGtk [ gmp mpfr ])));
-
-  LIBRARY_PATH = concatStrings
-                   (intersperse ":" (map (x: x + "/lib")
-                                         (optionals langJava [ boehmgc zlib ]
-                                          ++ optionals javaAwtGtk xlibs
-                                          ++ optionals javaAwtGtk [ gmp mpfr ])));
-
-
-  passthru = { inherit langC langCC langAda langFortran langVhdl
-      enableMultilib version; isGNU = true; };
-
-  # ghdl does not build fine with parallel building
-  # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46173
-  #enableParallelBuilding = !langVhdl && !langAda;
-
-  meta = {
-    homepage = http://gcc.gnu.org/;
-    license = stdenv.lib.licenses.gpl3Plus;  # runtime support libraries are typically LGPLv3+
-    description = "GNU Compiler Collection, version ${version}";
-
-    longDescription = ''
-      The GNU Compiler Collection includes compiler front ends for C, C++,
-      Objective-C, Fortran, OpenMP for C/C++/Fortran, Java, and Ada, as well
-      as libraries for these languages (libstdc++, libgcj, libgomp,...).
-
-      GCC development is a part of the GNU Project, aiming to improve the
-      compiler used in the GNU system including the GNU/Linux variant.
-    '';
-
-    maintainers = [
-      # Add your name here!
-      stdenv.lib.maintainers.viric
-    ];
-
-    # Volunteers needed for the {Cyg,Dar}win ports of *PPL.
-    # gnatboot is not available out of linux platforms, so we disable the darwin build
-    # for the gnat (ada compiler).
-    platforms = stdenv.lib.platforms.linux ++ optionals (langAda == false) [ "i686-darwin" ];
-  };
-}
-// (if langVhdl then rec {
-  name = "ghdl-0.29";
-
-  ghdlSrc = fetchurl {
-    url = "http://ghdl.free.fr/ghdl-0.29.tar.bz2";
-    sha256 = "15mlinr1lwljwll9ampzcfcrk9bk0qpdks1kxlvb70xf9zhh2jva";
-  };
-
-  # Ghdl has some timestamps checks, storing file timestamps in '.cf' files.
-  # As we will change the timestamps to 1970-01-01 00:00:01, we also set the
-  # content of that .cf to that value. This way ghdl does not complain on
-  # the installed object files from the basic libraries (ieee, ...)
-  postInstallGhdl = ''
-    pushd $out
-    find . -name "*.cf" -exec \
-        sed 's/[0-9]*\.000" /19700101000001.000" /g' -i {} \;
-    popd
-  '';
-
-  postUnpack = ''
-    tar xvf ${ghdlSrc}
-    mv ghdl-*/vhdl gcc*/gcc
-    rm -Rf ghdl-*
-  '';
-
-  meta = {
-    homepage = "http://ghdl.free.fr/";
-    license = stdenv.lib.licenses.gpl2Plus;
-    description = "Complete VHDL simulator, using the GCC technology (gcc ${version})";
-    maintainers = with stdenv.lib.maintainers; [viric];
-    platforms = with stdenv.lib.platforms; linux;
-  };
-
-} else {}))
diff --git a/pkgs/development/compilers/gcc/4.4/ghdl-ortho-cflags.patch b/pkgs/development/compilers/gcc/4.4/ghdl-ortho-cflags.patch
deleted file mode 100644
index 901534591c8f..000000000000
--- a/pkgs/development/compilers/gcc/4.4/ghdl-ortho-cflags.patch
+++ /dev/null
@@ -1,111 +0,0 @@
-diff --git a/gcc/vhdl/Make-lang.in b/gcc/vhdl/Make-lang.in
-index 8f481df..681ac59 100644
---- a/gcc/vhdl/Make-lang.in
-+++ b/gcc/vhdl/Make-lang.in
-@@ -96,7 +96,7 @@ AGCC_GCCOBJ_DIR=../
- AGCC_INC_FLAGS=-I$(AGCC_GCCOBJ_DIR)/gcc -I$(AGCC_GCCSRC_DIR)/include \
-  -I$(AGCC_GCCSRC_DIR)/gcc -I$(AGCC_GCCSRC_DIR)/gcc/config \
-  -I$(AGCC_GCCSRC_DIR)/libcpp/include
--AGCC_CFLAGS=-g -Wall -DIN_GCC $(AGCC_INC_FLAGS)
-+AGCC_CFLAGS=-g -Wall -DIN_GCC $(AGCC_INC_FLAGS) $(CFLAGS) $(INCLUDES)
- 
- AGCC_LOCAL_OBJS=ortho-lang.o
- 
-@@ -140,7 +140,7 @@ ghdl$(exeext): force
- 
- # Ghdl libraries.
- ghdllib: ghdl$(exeext) $(GCC_PASSES) force
--	$(MAKE_IN_VHDL) GRT_FLAGS="-O -g" ghdllib
-+	$(MAKE_IN_VHDL) GRT_FLAGS="-O -g $(CFLAGS)" ghdllib
- 
- # Build hooks:
- 
-diff --git a/gcc/vhdl/Makefile.in b/gcc/vhdl/Makefile.in
-index d754c6c..07abc4a 100644
---- a/gcc/vhdl/Makefile.in
-+++ b/gcc/vhdl/Makefile.in
-@@ -80,7 +80,8 @@ T_CPPFLAGS =
- X_ADAFLAGS =
- T_ADAFLAGS =
- 
--ADAC = $(CC)
-+# Never use the bootstrapped compiler, as it may not be built for ada
-+ADAC = gcc
- 
- ECHO = echo
- CHMOD = chmod
-diff --git a/gcc/vhdl/ortho-lang.c b/gcc/vhdl/ortho-lang.c
-index 84aeb92..8eddd42 100644
---- a/gcc/vhdl/ortho-lang.c
-+++ b/gcc/vhdl/ortho-lang.c
-@@ -16,6 +16,7 @@
- #include "options.h"
- #include "real.h"
--#include "tree-gimple.h"
-+#include "gimple.h"
-+#include "tree.h"
- #include "function.h"
- #include "cgraph.h"
- #include "target.h"
-@@ -680,38 +681,10 @@ type_for_mode (enum machine_mode mode, int unsignedp)
- 
- const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
- 
--/* Tree code classes.  */
--
--#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
--
--const enum tree_code_class tree_code_type[] = {
--#include "tree.def"
--  'x'
--};
--#undef DEFTREECODE
--
--/* Table indexed by tree code giving number of expression
--   operands beyond the fixed part of the node structure.
--   Not used for types or decls.  */
--
--#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) LENGTH,
--
--const unsigned char tree_code_length[] = {
--#include "tree.def"
--  0
--};
--#undef DEFTREECODE
--
--#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) NAME,
--const char * const tree_code_name[] = {
--#include "tree.def"
--  "@@dummy"
--};
--#undef DEFTREECODE
- 
- union lang_tree_node 
-   GTY((desc ("0"),
--       chain_next ("(union lang_tree_node *) GENERIC_NEXT (&%h.generic)")))
-+       chain_next ("(union lang_tree_node *) TREE_CHAIN (&%h.generic)")))
- {
-   union tree_node GTY ((tag ("0"))) generic;
- };
-@@ -1162,7 +1135,7 @@ new_access_type (tree dtype)
-       res = make_node (POINTER_TYPE);
-       TREE_TYPE (res) = NULL_TREE;
-       /* Seems necessary.  */
--      TYPE_MODE (res) = Pmode;
-+      SET_TYPE_MODE (res, Pmode);
-       layout_type (res);
-       return res;
-     }
-diff --git a/gcc/vhdl/Make-lang.in b/gcc/vhdl/Make-lang.in
-index e201f64..f36fb97 100644
---- a/gcc/vhdl/Make-lang.in
-+++ b/gcc/vhdl/Make-lang.in
-@@ -132,7 +132,7 @@ ghdl1$(exeext): $(AGCC_OBJS) $(AGCC_DEPS) force
- 	 -cargs $(CFLAGS) $(GHDL_ADAFLAGS)
- 	$(GNATMAKE) -o $@ -aI$(srcdir)/vhdl -aOvhdl ortho_gcc-main \
- 	 -bargs -E -cargs $(CFLAGS) $(GHDL_ADAFLAGS) \
--	 -largs $(AGCC_OBJS) $(LIBS) $(GMPLIBS)
-+	 -largs $(AGCC_OBJS) $(LIBS) $(GMPLIBS) $(CLOOGLIBS) $(PPLLIBS)
- 
- # The driver for ghdl.
- ghdl$(exeext): force
diff --git a/pkgs/development/compilers/gcc/4.4/gnat-cflags.patch b/pkgs/development/compilers/gcc/4.4/gnat-cflags.patch
deleted file mode 100644
index e85e5076be69..000000000000
--- a/pkgs/development/compilers/gcc/4.4/gnat-cflags.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-diff --git a/libada/Makefile.in b/libada/Makefile.in
-index f5057a0..337e0c6 100644
---- a/libada/Makefile.in
-+++ b/libada/Makefile.in
-@@ -55,7 +55,7 @@ GCC_WARN_CFLAGS = $(LOOSE_WARN)
- WARN_CFLAGS = @warn_cflags@
- 
- TARGET_LIBGCC2_CFLAGS=
--GNATLIBCFLAGS= -g -O2
-+GNATLIBCFLAGS= -g -O2 $(CFLAGS)
- GNATLIBCFLAGS_FOR_C = $(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS) -fexceptions \
- 	-DIN_RTS @have_getipinfo@
- 
---- a/gcc/ada/gcc-interface/Makefile.in
-+++ b/gcc/ada/gcc-interface/Makefile.in
-@@ -105,7 +105,7 @@ ADAFLAGS = -W -Wall -gnatpg -gnata
- SOME_ADAFLAGS =-gnata
- FORCE_DEBUG_ADAFLAGS = -g
- GNATLIBFLAGS = -gnatpg -nostdinc
--GNATLIBCFLAGS = -g -O2
-+GNATLIBCFLAGS = -g -O2 $(CFLAGS_FOR_TARGET)
- # Pretend that _Unwind_GetIPInfo is available for the target by default.  This
- # should be autodetected during the configuration of libada and passed down to
- # here, but we need something for --disable-libada and hope for the best.
-@@ -1838,7 +1838,7 @@ ADA_INCLUDE_SRCS =\
- 
- LIBGNAT=../$(RTSDIR)/libgnat.a
- 
--GCC_LINK=$(CC) -static-libgcc $(ADA_INCLUDES)
-+GCC_LINK=$(CC) -static-libgcc $(CFLAGS_FOR_TARGET) $(ADA_INCLUDES)
- 
- # when compiling the tools, the runtime has to be first on the path so that
- # it hides the runtime files lying with the rest of the sources
diff --git a/pkgs/development/compilers/gcc/4.4/libstdc++-target.patch b/pkgs/development/compilers/gcc/4.4/libstdc++-target.patch
deleted file mode 100644
index 0b04b83d08d5..000000000000
--- a/pkgs/development/compilers/gcc/4.4/libstdc++-target.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/Makefile.in b/Makefile.in
-index 245c770..8545b60 100644
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -250,8 +250,8 @@ BASE_TARGET_EXPORTS = \
- RAW_CXX_TARGET_EXPORTS = \
- 	$(BASE_TARGET_EXPORTS) \
- 	CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
--	CXX="$(RAW_CXX_FOR_TARGET) $(CFLAGS_FOR_BUILD)"; export CXX; \
--	CXXCPP="$(RAW_CXX_FOR_TARGET) $(CFLAGS_FOR_BUILD) -E"; export CXXCPP;
-+	CXX="$(RAW_CXX_FOR_TARGET) $(CFLAGS_FOR_TARGET)"; export CXX; \
-+	CXXCPP="$(RAW_CXX_FOR_TARGET) $(CFLAGS_FOR_TARGET) -E"; export CXXCPP;
- 
- NORMAL_TARGET_EXPORTS = \
- 	$(BASE_TARGET_EXPORTS) \
diff --git a/pkgs/development/compilers/gcc/4.4/no-sys-dirs.patch b/pkgs/development/compilers/gcc/4.4/no-sys-dirs.patch
deleted file mode 100644
index 7eaf421cc402..000000000000
--- a/pkgs/development/compilers/gcc/4.4/no-sys-dirs.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-diff -ru gcc-4.3.1-orig/gcc/cppdefault.c gcc-4.3.1/gcc/cppdefault.c
---- gcc-4.3.1-orig/gcc/cppdefault.c	2007-07-26 10:37:01.000000000 +0200
-+++ gcc-4.3.1/gcc/cppdefault.c	2008-06-25 17:48:23.000000000 +0200
-@@ -41,6 +41,10 @@
- # undef CROSS_INCLUDE_DIR
- #endif
- 
-+#undef LOCAL_INCLUDE_DIR
-+#undef SYSTEM_INCLUDE_DIR
-+#undef STANDARD_INCLUDE_DIR
-+
- const struct default_include cpp_include_defaults[]
- #ifdef INCLUDE_DEFAULTS
- = INCLUDE_DEFAULTS;
-diff -ru gcc-4.3.1-orig/gcc/gcc.c gcc-4.3.1/gcc/gcc.c
---- gcc-4.3.1-orig/gcc/gcc.c	2008-03-02 23:55:19.000000000 +0100
-+++ gcc-4.3.1/gcc/gcc.c	2008-06-25 17:52:53.000000000 +0200
-@@ -1478,10 +1478,10 @@
- /* Default prefixes to attach to command names.  */
- 
- #ifndef STANDARD_STARTFILE_PREFIX_1
--#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
-+#define STANDARD_STARTFILE_PREFIX_1 ""
- #endif
- #ifndef STANDARD_STARTFILE_PREFIX_2
--#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
-+#define STANDARD_STARTFILE_PREFIX_2 ""
- #endif
- 
- #ifdef CROSS_DIRECTORY_STRUCTURE  /* Don't use these prefixes for a cross compiler.  */
-@@ -1515,8 +1515,8 @@
- /* For native compilers, these are well-known paths containing
-    components that may be provided by the system.  For cross
-    compilers, these paths are not used.  */
--static const char *const standard_exec_prefix_1 = "/usr/libexec/gcc/";
--static const char *const standard_exec_prefix_2 = "/usr/lib/gcc/";
-+static const char *const standard_exec_prefix_1 = "/no-such-path/";
-+static const char *const standard_exec_prefix_2 = "/no-such-path/";
- static const char *md_exec_prefix = MD_EXEC_PREFIX;
- static const char *md_startfile_prefix = MD_STARTFILE_PREFIX;
- static const char *md_startfile_prefix_1 = MD_STARTFILE_PREFIX_1;
-diff -ru gcc-4.3.1-orig/gcc/Makefile.in gcc-4.3.1/gcc/Makefile.in
---- gcc-4.3.1-orig/gcc/Makefile.in	2008-05-11 20:54:15.000000000 +0200
-+++ gcc-4.3.1/gcc/Makefile.in	2008-06-25 17:48:23.000000000 +0200
-@@ -378,7 +378,11 @@
- MD5_H	    = $(srcdir)/../include/md5.h
- 
- # Default native SYSTEM_HEADER_DIR, to be overridden by targets.
--NATIVE_SYSTEM_HEADER_DIR = /usr/include
-+# Nix: we override NATIVE_SYSTEM_HEADER_DIR in order to prevent
-+# `fixinc' from fixing header files in /usr/include.  However,
-+# NATIVE_SYSTEM_HEADER_DIR must point to an existing directory, so set
-+# it to some dummy directory.
-+NATIVE_SYSTEM_HEADER_DIR = $(NIX_FIXINC_DUMMY)
- # Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
- CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
- 
-@@ -3277,7 +3281,7 @@
-   -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
-   -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \
-   -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
--  -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \
-+  -DLOCAL_INCLUDE_DIR=\"/no-such-dir\" \
-   -DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \
-   -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
-   -DPREFIX=\"$(prefix)/\" \
diff --git a/pkgs/development/compilers/gcc/4.4/pass-cxxcpp.patch b/pkgs/development/compilers/gcc/4.4/pass-cxxcpp.patch
deleted file mode 100644
index 9b0676d4fdc9..000000000000
--- a/pkgs/development/compilers/gcc/4.4/pass-cxxcpp.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff -rc gcc-orig/Makefile.in gcc-4.1.1/Makefile.in
-*** gcc-orig/Makefile.in	Wed Jun 21 13:40:23 2006
---- gcc-4.1.1/Makefile.in	Wed Jun 21 14:19:44 2006
-***************
-*** 213,219 ****
-  RAW_CXX_TARGET_EXPORTS = \
-  	$(BASE_TARGET_EXPORTS) \
-  	CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
-! 	CXX="$(RAW_CXX_FOR_TARGET)"; export CXX;
-  
-  NORMAL_TARGET_EXPORTS = \
-  	$(BASE_TARGET_EXPORTS) \
---- 213,220 ----
-  RAW_CXX_TARGET_EXPORTS = \
-  	$(BASE_TARGET_EXPORTS) \
-  	CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
-! 	CXX="$(RAW_CXX_FOR_TARGET) $(CFLAGS_FOR_BUILD)"; export CXX; \
-! 	CXXCPP="$(RAW_CXX_FOR_TARGET) $(CFLAGS_FOR_BUILD) -E"; export CXXCPP;
-  
-  NORMAL_TARGET_EXPORTS = \
-  	$(BASE_TARGET_EXPORTS) \
diff --git a/pkgs/development/compilers/gcc/4.4/pr41818.patch b/pkgs/development/compilers/gcc/4.4/pr41818.patch
deleted file mode 100644
index 98731c460679..000000000000
--- a/pkgs/development/compilers/gcc/4.4/pr41818.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41818>.  This fixes compilation
-of the sparc64-linux-gnu cross-compiler with shared libraries.
-
---- trunk/Makefile.in	2010/01/07 19:21:46	155705
-+++ trunk/Makefile.in	2010/01/07 19:53:50	155706
-@@ -259,7 +259,7 @@
- # directories built for the target.
- TARGET_CONFIGARGS = @target_configargs@ --with-target-subdir="$(TARGET_SUBDIR)"
- # This is the list of variables to export in the environment when
--# configuring subdirectories for the host system.
-+# configuring subdirectories for the target system.
- BASE_TARGET_EXPORTS = \
- 	$(BASE_EXPORTS) \
- 	AR="$(AR_FOR_TARGET)"; export AR; \
-@@ -281,7 +281,10 @@
- 	STRIP="$(STRIP_FOR_TARGET)"; export STRIP; \
- 	WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
- 	WINDMC="$(WINDMC_FOR_TARGET)"; export WINDMC; \
--	$(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
-+@if gcc-bootstrap
-+	$(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
-+@endif gcc-bootstrap
-+	$(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
- 
- RAW_CXX_TARGET_EXPORTS = \
- 	$(BASE_TARGET_EXPORTS) \
diff --git a/pkgs/development/compilers/gcc/4.4/siginfo_t_fix.patch b/pkgs/development/compilers/gcc/4.4/siginfo_t_fix.patch
deleted file mode 100644
index 8b126cd08c36..000000000000
--- a/pkgs/development/compilers/gcc/4.4/siginfo_t_fix.patch
+++ /dev/null
@@ -1,174 +0,0 @@
-https://bugs.gentoo.org/424970
-
-fix from upstream for building with newer glibc versions
-
-From f0cdca2bf2230005025e13e7354fedb612933c96 Mon Sep 17 00:00:00 2001
-From: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
-Date: Fri, 20 Apr 2012 08:14:00 +0000
-Subject: [PATCH] 	struct siginfo vs. siginfo_t
-
-	Backport from trunk (but apply to gcc/):
-
-	2012-04-20  Thomas Schwinge  <thomas@codesourcery.com>
-
-gcc/
-	* config/alpha/linux-unwind.h (alpha_fallback_frame_state): Use
-	siginfo_t instead of struct siginfo.
-	* config/bfin/linux-unwind.h (bfin_fallback_frame_state): Likewise.
-	* config/i386/linux-unwind.h (x86_fallback_frame_state): Likewise.
-	* config/ia64/linux-unwind.h (ia64_fallback_frame_state)
-	(ia64_handle_unwabi): Likewise.
-	* config/mips/linux-unwind.h (mips_fallback_frame_state): Likewise.
-	* config/pa/linux-unwind.h (pa32_fallback_frame_state): Likewise.
-	* config/sh/linux-unwind.h (shmedia_fallback_frame_state)
-	(sh_fallback_frame_state): Likewise.
-	* config/xtensa/linux-unwind.h (xtensa_fallback_frame_state): Likewise.
-
-git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_5-branch@186613 138bc75d-0d04-0410-961f-82ee72b054a4
----
- gcc/ChangeLog                    |   20 ++++++++++++++++++++
- gcc/config/alpha/linux-unwind.h  |    4 ++--
- gcc/config/bfin/linux-unwind.h   |    6 +++---
- gcc/config/i386/linux-unwind.h   |    6 +++---
- gcc/config/ia64/linux-unwind.h   |    6 +++---
- gcc/config/mips/linux-unwind.h   |    5 +++--
- gcc/config/pa/linux-unwind.h     |    4 ++--
- gcc/config/sh/linux-unwind.h     |    9 +++++----
- gcc/config/xtensa/linux-unwind.h |    4 ++--
- 9 files changed, 43 insertions(+), 21 deletions(-)
-
-diff --git a/gcc/config/alpha/linux-unwind.h b/gcc/config/alpha/linux-unwind.h
-index 4c811dc..8c04b3b 100644
---- a/gcc/config/alpha/linux-unwind.h
-+++ b/gcc/config/alpha/linux-unwind.h
-@@ -49,7 +49,7 @@ alpha_fallback_frame_state (struct _Unwind_Context *context,
-   else if (pc[1] == 0x201f015f)		/* lda $0,NR_rt_sigreturn */
-     {
-       struct rt_sigframe {
--	struct siginfo info;
-+	siginfo_t info;
- 	struct ucontext uc;
-       } *rt_ = context->cfa;
-       sc = &rt_->uc.uc_mcontext;
-diff --git a/gcc/config/bfin/linux-unwind.h b/gcc/config/bfin/linux-unwind.h
-index 88c8285..15bb2f1 100644
---- a/gcc/config/bfin/linux-unwind.h
-+++ b/gcc/config/bfin/linux-unwind.h
-@@ -48,10 +48,10 @@ bfin_fallback_frame_state (struct _Unwind_Context *context,
-     {
-       struct rt_sigframe {
- 	int sig;
--	struct siginfo *pinfo;
-+	siginfo_t *pinfo;
- 	void *puc;
- 	char retcode[8];
--	struct siginfo info;
-+	siginfo_t info;
- 	struct ucontext uc;
-       } *rt_ = context->cfa;
- 
-diff --git a/gcc/config/i386/linux-unwind.h b/gcc/config/i386/linux-unwind.h
-index 36ee370..fe0ea3e 100644
---- a/gcc/config/i386/linux-unwind.h
-+++ b/gcc/config/i386/linux-unwind.h
-@@ -133,9 +133,9 @@ x86_fallback_frame_state (struct _Unwind_Context *context,
-     {
-       struct rt_sigframe {
- 	int sig;
--	struct siginfo *pinfo;
-+	siginfo_t *pinfo;
- 	void *puc;
--	struct siginfo info;
-+	siginfo_t info;
- 	struct ucontext uc;
-       } *rt_ = context->cfa;
-       /* The void * cast is necessary to avoid an aliasing warning.
-diff --git a/gcc/config/ia64/linux-unwind.h b/gcc/config/ia64/linux-unwind.h
-index 93f762d..da31259 100644
---- a/gcc/config/ia64/linux-unwind.h
-+++ b/gcc/config/ia64/linux-unwind.h
-@@ -47,7 +47,7 @@ ia64_fallback_frame_state (struct _Unwind_Context *context,
-       struct sigframe {
- 	char scratch[16];
- 	unsigned long sig_number;
--	struct siginfo *info;
-+	siginfo_t *info;
- 	struct sigcontext *sc;
-       } *frame_ = (struct sigframe *)context->psp;
-       struct sigcontext *sc = frame_->sc;
-@@ -137,7 +137,7 @@ ia64_handle_unwabi (struct _Unwind_Context *context, _Unwind_FrameState *fs)
-       struct sigframe {
- 	char scratch[16];
- 	unsigned long sig_number;
--	struct siginfo *info;
-+	siginfo_t *info;
- 	struct sigcontext *sc;
-       } *frame = (struct sigframe *)context->psp;
-       struct sigcontext *sc = frame->sc;
-diff --git a/gcc/config/mips/linux-unwind.h b/gcc/config/mips/linux-unwind.h
-index 02f7cd5..094ff58 100644
---- a/gcc/config/mips/linux-unwind.h
-+++ b/gcc/config/mips/linux-unwind.h
-@@ -75,7 +76,7 @@ mips_fallback_frame_state (struct _Unwind_Context *context,
-       struct rt_sigframe {
- 	u_int32_t ass[4];  /* Argument save space for o32.  */
- 	u_int32_t trampoline[2];
--	struct siginfo info;
-+	siginfo_t info;
- 	_sig_ucontext_t uc;
-       } *rt_ = context->cfa;
-       sc = &rt_->uc.uc_mcontext;
-diff --git a/gcc/config/pa/linux-unwind.h b/gcc/config/pa/linux-unwind.h
-index a0560e9..38b4eda 100644
---- a/gcc/config/pa/linux-unwind.h
-+++ b/gcc/config/pa/linux-unwind.h
-@@ -63,7 +63,7 @@ pa32_fallback_frame_state (struct _Unwind_Context *context,
-   int i;
-   struct sigcontext *sc;
-   struct rt_sigframe {
--    struct siginfo info;
-+    siginfo_t info;
-     struct ucontext uc;
-   } *frame;
- 
-diff --git a/gcc/config/sh/linux-unwind.h b/gcc/config/sh/linux-unwind.h
-index 94ed95d..5a78e31 100644
---- a/gcc/config/sh/linux-unwind.h
-+++ b/gcc/config/sh/linux-unwind.h
-@@ -80,9 +81,9 @@ shmedia_fallback_frame_state (struct _Unwind_Context *context,
- 	   && (*(unsigned long *) (pc+11)  == 0x6ff0fff0))
-     {
-       struct rt_sigframe {
--	struct siginfo *pinfo;
-+	siginfo_t *pinfo;
- 	void *puc;
--	struct siginfo info;
-+	siginfo_t info;
- 	struct ucontext uc;
-       } *rt_ = context->cfa;
-       /* The void * cast is necessary to avoid an aliasing warning.
-@@ -179,7 +180,7 @@ sh_fallback_frame_state (struct _Unwind_Context *context,
- 		&& (*(unsigned short *) (pc+14)  == 0x00ad))))
-     {
-       struct rt_sigframe {
--	struct siginfo info;
-+	siginfo_t info;
- 	struct ucontext uc;
-       } *rt_ = context->cfa;
-       /* The void * cast is necessary to avoid an aliasing warning.
-diff --git a/gcc/config/xtensa/linux-unwind.h b/gcc/config/xtensa/linux-unwind.h
-index 32e9349..2456497 100644
---- a/gcc/config/xtensa/linux-unwind.h
-+++ b/gcc/config/xtensa/linux-unwind.h
-@@ -62,7 +62,7 @@ xtensa_fallback_frame_state (struct _Unwind_Context *context,
-   struct sigcontext *sc;
- 
-   struct rt_sigframe {
--    struct siginfo info;
-+    siginfo_t info;
-     struct ucontext uc;
-   } *rt_;
- 
--- 
-1.7.9.7
-
diff --git a/pkgs/development/compilers/gcc/4.4/sources.nix b/pkgs/development/compilers/gcc/4.4/sources.nix
deleted file mode 100644
index 5517e7c3b922..000000000000
--- a/pkgs/development/compilers/gcc/4.4/sources.nix
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Automatically generated by `update-gcc.sh', do not edit.
-   For GCC 4.4.7.  */
-{ fetchurl, optional, version, langC, langCC, langFortran, langJava, langAda }:
-
-assert version == "4.4.7";
-optional /* langC */ true (fetchurl {
-  url = "mirror://gcc/releases/gcc-${version}/gcc-core-${version}.tar.bz2";
-  sha256 = "c4663b7023909a4a075d3c2b2e17f6e082a9625aebfd0ce7f1d7817e44bf5542";
-}) ++
-optional langCC (fetchurl {
-  url = "mirror://gcc/releases/gcc-${version}/gcc-g++-${version}.tar.bz2";
-  sha256 = "1882ff29be51eeb3fb349cbcda9df200a5c3cd20c97dd1d593101e0998b3c469";
-}) ++
-optional langFortran (fetchurl {
-  url = "mirror://gcc/releases/gcc-${version}/gcc-fortran-${version}.tar.bz2";
-  sha256 = "545a1e8e97d9364de4408c6a91830f9051ce24b4fbfbfdc56e72c7b4be17ebdd";
-}) ++
-optional langJava (fetchurl {
-  url = "mirror://gcc/releases/gcc-${version}/gcc-java-${version}.tar.bz2";
-  sha256 = "3c31ddd80f945b797d8d4ed7761426c26343781c361ec1b33bcea9874cc4c6c0";
-}) ++
-optional langAda (fetchurl {
-  url = "mirror://gcc/releases/gcc-${version}/gcc-ada-${version}.tar.bz2";
-  sha256 = "fb9f30b85d48838390554b948d137487f0db09ad5f8ba73ca4d7ca35765c6ed8";
-}) ++
-[]
diff --git a/pkgs/development/compilers/gcc/4.4/target-cpp.patch b/pkgs/development/compilers/gcc/4.4/target-cpp.patch
deleted file mode 100644
index ab0f0ee51aaa..000000000000
--- a/pkgs/development/compilers/gcc/4.4/target-cpp.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/Makefile.in b/Makefile.in
-index 8545b60..1fab64d 100644
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -231,6 +231,7 @@ BASE_TARGET_EXPORTS = \
- 	CC="$(CC_FOR_TARGET)"; export CC; \
- 	CFLAGS="$(CFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \
- 	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-+	CPP="$(CC_FOR_TARGET) -E"; export CPP; \
- 	CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \
- 	CXXFLAGS="$(CXXFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CXXFLAGS; \
- 	GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
diff --git a/pkgs/development/compilers/gcc/4.4/update-gcc.sh b/pkgs/development/compilers/gcc/4.4/update-gcc.sh
deleted file mode 100755
index 03297fbadd64..000000000000
--- a/pkgs/development/compilers/gcc/4.4/update-gcc.sh
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/bin/sh
-
-if [ $# -ne 1 ]
-then
-    echo "Usage: $(basename $0) VERSION"
-    echo
-    echo "Download and GPG-check component tarballs for GCC VERSION."
-    exit 1
-fi
-
-version="$1"
-
-set -e
-
-out="sources.nix"
-
-declare -A options
-
-options["core"]="/* langC */ true"
-options["g++"]="langCC"
-options["fortran"]="langFortran"
-options["java"]="langJava"
-options["ada"]="langAda"
-#options["go"]="langGo"
-
-cat > "$out"<<EOF
-/* Automatically generated by \`$(basename $0)', do not edit.
-   For GCC ${version}.  */
-{ fetchurl, optional, version, langC, langCC, langFortran, langJava, langAda,
-  langGo }:
-
-assert version == "${version}";
-EOF
-
-for component in core g++ fortran java ada #go
-do
-    dir="ftp.gnu.org/gnu/gcc/gcc-${version}"
-    file="gcc-${component}-${version}.tar.bz2"
-    url="${dir}/${file}"
-
-    rm -f "${file}"
-
-    wget "$url"
-    hash="$(nix-hash --flat --type sha256 "$file")"
-    path="$(nix-store --add-fixed sha256 "$file")"
-
-    rm -f "${file}" "${file}.sig"
-    wget "${url}.sig"
-    gpg --verify "${file}.sig" "${path}" || gpg2 --verify "${file}.sig" "${path}"
-    rm "${file}.sig"
-
-    cat >> "$out" <<EOF
-optional ${options[$component]} (fetchurl {
-  url = "mirror://gcc/releases/gcc-\${version}/gcc-${component}-\${version}.tar.bz2";
-  sha256 = "${hash}";
-}) ++
-EOF
-done
-
-cat >> "$out" <<EOF
-[]
-EOF
-
-echo "result stored in \`$out'"
diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix
index 3b105143c0bf..53e64fe8abc6 100644
--- a/pkgs/development/compilers/gcc/5/default.nix
+++ b/pkgs/development/compilers/gcc/5/default.nix
@@ -495,6 +495,8 @@ stdenv.mkDerivation ({
 
   inherit (stdenv) is64bit;
 
+  setupHook = ./use-old-abi.sh;
+
   meta = {
     homepage = http://gcc.gnu.org/;
     license = stdenv.lib.licenses.gpl3Plus;  # runtime support libraries are typically LGPLv3+
diff --git a/pkgs/development/compilers/gcc/5/use-old-abi.sh b/pkgs/development/compilers/gcc/5/use-old-abi.sh
new file mode 100644
index 000000000000..3a0c996033a9
--- /dev/null
+++ b/pkgs/development/compilers/gcc/5/use-old-abi.sh
@@ -0,0 +1 @@
+NIX_CFLAGS_COMPILE+=" -D_GLIBCXX_USE_CXX11_ABI=0"
diff --git a/pkgs/development/compilers/gcl/default.nix b/pkgs/development/compilers/gcl/default.nix
index 25b1599fbea0..cf5b862646e4 100644
--- a/pkgs/development/compilers/gcl/default.nix
+++ b/pkgs/development/compilers/gcl/default.nix
@@ -16,6 +16,11 @@ stdenv.mkDerivation rec {
     url = "http://gnu.spinellicreations.com/gcl/${name}.tar.gz";
   };
 
+  patches = [(fetchurl {
+    url = https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-lisp/gcl/files/gcl-2.6.12-gcc5.patch;
+    sha256 = "00jbsn0qp8ki2w7dx8caha7g2hr9076xa6bg48j3qqqncff93zdh";
+  })];
+
   buildInputs = [
     mpfr m4 binutils emacs gmp
     libX11 xproto inputproto libXi
@@ -38,6 +43,8 @@ stdenv.mkDerivation rec {
     # sed -re "s@/bin/cat@$(which cat)@g" -i configure */configure
     # sed -re "s@if test -d /proc/self @if false @" -i configure
     # sed -re 's^([ \t])cpp ^\1cpp -I${stdenv.cc.cc}/include -I${stdenv.cc.libc}/include ^g' -i makefile
+
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -fgnu89-inline"
   '';
 
   /* doConfigure should be removed if not needed */
diff --git a/pkgs/development/compilers/go/1.4.nix b/pkgs/development/compilers/go/1.4.nix
index 9c6bbba24d5d..2a1f437ffdf6 100644
--- a/pkgs/development/compilers/go/1.4.nix
+++ b/pkgs/development/compilers/go/1.4.nix
@@ -87,6 +87,7 @@ stdenv.mkDerivation rec {
 
   patches = [
     ./remove-tools-1.4.patch
+    ./new-binutils.patch
   ];
 
   GOOS = if stdenv.isDarwin then "darwin" else "linux";
diff --git a/pkgs/development/compilers/go/new-binutils.patch b/pkgs/development/compilers/go/new-binutils.patch
new file mode 100644
index 000000000000..a547e3ab9b9a
--- /dev/null
+++ b/pkgs/development/compilers/go/new-binutils.patch
@@ -0,0 +1,194 @@
+https://github.com/golang/go/issues/13114
+https://gnats.netbsd.org/50777
+
+--- a/src/cmd/6l/asm.c	2015-09-23 06:20:05.000000000 +0200
++++ b/src/cmd/6l/asm.c	2016-03-10 21:00:29.032083210 +0100
+@@ -118,6 +118,8 @@
+ 		return;
+ 	
+ 	case 256 + R_X86_64_GOTPCREL:
++	case 256 + R_X86_64_GOTPCRELX:
++	case 256 + R_X86_64_REX_GOTPCRELX:
+ 		if(targ->type != SDYNIMPORT) {
+ 			// have symbol
+ 			if(r->off >= 2 && s->p[r->off-2] == 0x8b) {
+--- a/src/cmd/8l/asm.c	2015-09-23 06:20:05.000000000 +0200
++++ b/src/cmd/8l/asm.c	2016-03-10 21:02:16.702064080 +0100
+@@ -115,6 +115,7 @@
+ 		return;		
+ 	
+ 	case 256 + R_386_GOT32:
++	case 256 + R_386_GOT32X:
+ 		if(targ->type != SDYNIMPORT) {
+ 			// have symbol
+ 			if(r->off >= 2 && s->p[r->off-2] == 0x8b) {
+--- a/src/cmd/ld/elf.h	2015-09-23 06:20:05.000000000 +0200
++++ b/src/cmd/ld/elf.h	2016-03-10 21:00:29.033083211 +0100
+@@ -478,32 +478,47 @@
+  * Relocation types.
+  */
+ 
+-#define	R_X86_64_NONE	0	/* No relocation. */
+-#define	R_X86_64_64	1	/* Add 64 bit symbol value. */
+-#define	R_X86_64_PC32	2	/* PC-relative 32 bit signed sym value. */
+-#define	R_X86_64_GOT32	3	/* PC-relative 32 bit GOT offset. */
+-#define	R_X86_64_PLT32	4	/* PC-relative 32 bit PLT offset. */
+-#define	R_X86_64_COPY	5	/* Copy data from shared object. */
+-#define	R_X86_64_GLOB_DAT 6	/* Set GOT entry to data address. */
+-#define	R_X86_64_JMP_SLOT 7	/* Set GOT entry to code address. */
+-#define	R_X86_64_RELATIVE 8	/* Add load address of shared object. */
+-#define	R_X86_64_GOTPCREL 9	/* Add 32 bit signed pcrel offset to GOT. */
+-#define	R_X86_64_32	10	/* Add 32 bit zero extended symbol value */
+-#define	R_X86_64_32S	11	/* Add 32 bit sign extended symbol value */
+-#define	R_X86_64_16	12	/* Add 16 bit zero extended symbol value */
+-#define	R_X86_64_PC16	13	/* Add 16 bit signed extended pc relative symbol value */
+-#define	R_X86_64_8	14	/* Add 8 bit zero extended symbol value */
+-#define	R_X86_64_PC8	15	/* Add 8 bit signed extended pc relative symbol value */
+-#define	R_X86_64_DTPMOD64 16	/* ID of module containing symbol */
+-#define	R_X86_64_DTPOFF64 17	/* Offset in TLS block */
+-#define	R_X86_64_TPOFF64 18	/* Offset in static TLS block */
+-#define	R_X86_64_TLSGD	19	/* PC relative offset to GD GOT entry */
+-#define	R_X86_64_TLSLD	20	/* PC relative offset to LD GOT entry */
+-#define	R_X86_64_DTPOFF32 21	/* Offset in TLS block */
+-#define	R_X86_64_GOTTPOFF 22	/* PC relative offset to IE GOT entry */
+-#define	R_X86_64_TPOFF32 23	/* Offset in static TLS block */
+-
+-#define	R_X86_64_COUNT	24	/* Count of defined relocation types. */
++#define	R_X86_64_NONE           0
++#define	R_X86_64_64             1
++#define	R_X86_64_PC32           2
++#define	R_X86_64_GOT32          3
++#define	R_X86_64_PLT32          4
++#define	R_X86_64_COPY           5
++#define	R_X86_64_GLOB_DAT       6
++#define	R_X86_64_JMP_SLOT       7
++#define	R_X86_64_RELATIVE       8
++#define	R_X86_64_GOTPCREL       9
++#define	R_X86_64_32             10
++#define	R_X86_64_32S            11
++#define	R_X86_64_16             12
++#define	R_X86_64_PC16           13
++#define	R_X86_64_8              14
++#define	R_X86_64_PC8            15
++#define	R_X86_64_DTPMOD64       16
++#define	R_X86_64_DTPOFF64       17
++#define	R_X86_64_TPOFF64        18
++#define	R_X86_64_TLSGD          19
++#define	R_X86_64_TLSLD          20
++#define	R_X86_64_DTPOFF32       21
++#define	R_X86_64_GOTTPOFF       22
++#define	R_X86_64_TPOFF32        23
++#define	R_X86_64_PC64           24
++#define	R_X86_64_GOTOFF64       25
++#define	R_X86_64_GOTPC32        26
++#define	R_X86_64_GOT64          27
++#define	R_X86_64_GOTPCREL64     28
++#define	R_X86_64_GOTPC64        29
++#define	R_X86_64_GOTPLT64       30
++#define	R_X86_64_PLTOFF64       31
++#define	R_X86_64_SIZE32         32
++#define	R_X86_64_SIZE64         33
++#define	R_X86_64_GOTPC32_TLSDEC 34
++#define	R_X86_64_TLSDESC_CALL   35
++#define	R_X86_64_TLSDESC        36
++#define	R_X86_64_IRELATIVE      37
++#define	R_X86_64_PC32_BND       40
++#define	R_X86_64_GOTPCRELX      41
++#define	R_X86_64_REX_GOTPCRELX  42
+ 
+ 
+ #define	R_ALPHA_NONE		0	/* No reloc */
+@@ -581,39 +596,42 @@
+ #define	R_ARM_COUNT		38	/* Count of defined relocation types. */
+ 
+ 
+-#define	R_386_NONE	0	/* No relocation. */
+-#define	R_386_32	1	/* Add symbol value. */
+-#define	R_386_PC32	2	/* Add PC-relative symbol value. */
+-#define	R_386_GOT32	3	/* Add PC-relative GOT offset. */
+-#define	R_386_PLT32	4	/* Add PC-relative PLT offset. */
+-#define	R_386_COPY	5	/* Copy data from shared object. */
+-#define	R_386_GLOB_DAT	6	/* Set GOT entry to data address. */
+-#define	R_386_JMP_SLOT	7	/* Set GOT entry to code address. */
+-#define	R_386_RELATIVE	8	/* Add load address of shared object. */
+-#define	R_386_GOTOFF	9	/* Add GOT-relative symbol address. */
+-#define	R_386_GOTPC	10	/* Add PC-relative GOT table address. */
+-#define	R_386_TLS_TPOFF	14	/* Negative offset in static TLS block */
+-#define	R_386_TLS_IE	15	/* Absolute address of GOT for -ve static TLS */
+-#define	R_386_TLS_GOTIE	16	/* GOT entry for negative static TLS block */
+-#define	R_386_TLS_LE	17	/* Negative offset relative to static TLS */
+-#define	R_386_TLS_GD	18	/* 32 bit offset to GOT (index,off) pair */
+-#define	R_386_TLS_LDM	19	/* 32 bit offset to GOT (index,zero) pair */
+-#define	R_386_TLS_GD_32	24	/* 32 bit offset to GOT (index,off) pair */
+-#define	R_386_TLS_GD_PUSH 25	/* pushl instruction for Sun ABI GD sequence */
+-#define	R_386_TLS_GD_CALL 26	/* call instruction for Sun ABI GD sequence */
+-#define	R_386_TLS_GD_POP 27	/* popl instruction for Sun ABI GD sequence */
+-#define	R_386_TLS_LDM_32 28	/* 32 bit offset to GOT (index,zero) pair */
+-#define	R_386_TLS_LDM_PUSH 29	/* pushl instruction for Sun ABI LD sequence */
+-#define	R_386_TLS_LDM_CALL 30	/* call instruction for Sun ABI LD sequence */
+-#define	R_386_TLS_LDM_POP 31	/* popl instruction for Sun ABI LD sequence */
+-#define	R_386_TLS_LDO_32 32	/* 32 bit offset from start of TLS block */
+-#define	R_386_TLS_IE_32	33	/* 32 bit offset to GOT static TLS offset entry */
+-#define	R_386_TLS_LE_32	34	/* 32 bit offset within static TLS block */
+-#define	R_386_TLS_DTPMOD32 35	/* GOT entry containing TLS index */
+-#define	R_386_TLS_DTPOFF32 36	/* GOT entry containing TLS offset */
+-#define	R_386_TLS_TPOFF32 37	/* GOT entry of -ve static TLS offset */
+-
+-#define	R_386_COUNT	38	/* Count of defined relocation types. */
++#define	R_386_NONE          0
++#define	R_386_32            1
++#define	R_386_PC32          2
++#define	R_386_GOT32         3
++#define	R_386_PLT32         4
++#define	R_386_COPY          5
++#define	R_386_GLOB_DAT      6
++#define	R_386_JMP_SLOT      7
++#define	R_386_RELATIVE      8
++#define	R_386_GOTOFF        9
++#define	R_386_GOTPC         10
++#define	R_386_TLS_TPOFF     14
++#define	R_386_TLS_IE        15
++#define	R_386_TLS_GOTIE     16
++#define	R_386_TLS_LE        17
++#define	R_386_TLS_GD        18
++#define	R_386_TLS_LDM       19
++#define	R_386_TLS_GD_32     24
++#define	R_386_TLS_GD_PUSH   25
++#define	R_386_TLS_GD_CALL   26
++#define	R_386_TLS_GD_POP    27
++#define	R_386_TLS_LDM_32    28
++#define	R_386_TLS_LDM_PUSH  29
++#define	R_386_TLS_LDM_CALL  30
++#define	R_386_TLS_LDM_POP   31
++#define	R_386_TLS_LDO_32    32
++#define	R_386_TLS_IE_32     33
++#define	R_386_TLS_LE_32     34
++#define	R_386_TLS_DTPMOD32  35
++#define	R_386_TLS_DTPOFF32  36
++#define	R_386_TLS_TPOFF32   37
++#define	R_386_TLS_GOTDESC   39
++#define	R_386_TLS_DESC_CALL 40
++#define	R_386_TLS_DESC      41
++#define	R_386_IRELATIVE     42
++#define	R_386_GOT32X        43
+ 
+ #define	R_PPC_NONE		0	/* No relocation. */
+ #define	R_PPC_ADDR32		1
+--- a/src/cmd/ld/ldelf.c	2015-09-23 06:20:05.000000000 +0200
++++ b/src/cmd/ld/ldelf.c	2016-03-10 21:00:29.033083211 +0100
+@@ -888,12 +888,15 @@
+ 	case R('6', R_X86_64_PC32):
+ 	case R('6', R_X86_64_PLT32):
+ 	case R('6', R_X86_64_GOTPCREL):
++	case R('6', R_X86_64_GOTPCRELX):
++	case R('6', R_X86_64_REX_GOTPCRELX):
+ 	case R('8', R_386_32):
+ 	case R('8', R_386_PC32):
+ 	case R('8', R_386_GOT32):
+ 	case R('8', R_386_PLT32):
+ 	case R('8', R_386_GOTOFF):
+ 	case R('8', R_386_GOTPC):
++	case R('8', R_386_GOT32X):
+ 		*siz = 4;
+ 		break;
+ 	case R('6', R_X86_64_64):
diff --git a/pkgs/development/interpreters/clisp/2.44.1.nix b/pkgs/development/interpreters/clisp/2.44.1.nix
index 66f53831374f..682978a5ac8d 100644
--- a/pkgs/development/interpreters/clisp/2.44.1.nix
+++ b/pkgs/development/interpreters/clisp/2.44.1.nix
@@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
     cd builddir
   '';
 
-  NIX_CFLAGS_COMPILE="-O0";
+  NIX_CFLAGS_COMPILE = "-O0 ${stdenv.lib.optionalString (!stdenv.is64bit) "-falign-functions=4"}";
 
   # TODO : make mod-check fails
   doCheck = false;
diff --git a/pkgs/development/interpreters/clisp/default.nix b/pkgs/development/interpreters/clisp/default.nix
index b8af3f6d7479..919c3771bc5d 100644
--- a/pkgs/development/interpreters/clisp/default.nix
+++ b/pkgs/development/interpreters/clisp/default.nix
@@ -53,7 +53,7 @@ stdenv.mkDerivation rec {
         clx/new-clx bindings/glibc pcre rawsock wildcard zlib
   '';
 
-  NIX_CFLAGS_COMPILE="-O0";
+  NIX_CFLAGS_COMPILE = "-O0 ${stdenv.lib.optionalString (!stdenv.is64bit) "-falign-functions=4"}";
 
   # TODO : make mod-check fails
   doCheck = false;
diff --git a/pkgs/development/interpreters/hugs/default.nix b/pkgs/development/interpreters/hugs/default.nix
index b1c3df28d1f2..14afe0279c38 100644
--- a/pkgs/development/interpreters/hugs/default.nix
+++ b/pkgs/development/interpreters/hugs/default.nix
@@ -6,10 +6,18 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = http://cvs.haskell.org/Hugs/downloads/2006-09/hugs98-Sep2006.tar.gz;
-    sha256 = "3cf4d27673564cffe691bd14032369f646233f14daf2bc37c6c6df9f062b46b6";
+    sha256 = "1dj65c39zpy6qqvvrwns2hzj6ipnd4ih655xj7kgyk2nfdvd5x1w";
   };
 
-  buildInputs = [ bison ];
+  patches =
+    [ (fetchurl {
+        url = https://aur.archlinux.org/cgit/aur.git/plain/hsbase_inline.patch?h=hugs;
+        name = "hsbase_inline.patch";
+        sha256 = "1h0sp16d17hlm6gj7zdbgwrjwi2l4q02m8p0wd60dp4gn9i9js0v";
+      })
+    ];
+
+  nativeBuildInputs = [ bison ];
 
   postUnpack = "find -type f -exec sed -i 's@/bin/cp@cp@' {} +";
 
@@ -29,10 +37,11 @@ stdenv.mkDerivation {
     "--enable-pthreads"                 # build Hugs using POSIX threads C library
   ];
 
-  meta = {
-    homepage = http://www.haskell.org/hugs;
+  meta = with stdenv.lib; {
+    homepage = https://www.haskell.org/hugs;
     description = "Haskell interpreter";
-    license = "as-is";                          # gentoo labels it this way
-    platforms = stdenv.lib.platforms.unix;      # arbitrary choice
+    maintainers = with maintainers; [ joachifm ];
+    license = licenses.bsd3;
+    platforms = platforms.all;
   };
 }
diff --git a/pkgs/development/interpreters/io/default.nix b/pkgs/development/interpreters/io/default.nix
index f4854c237bd2..4f4880aaca72 100644
--- a/pkgs/development/interpreters/io/default.nix
+++ b/pkgs/development/interpreters/io/default.nix
@@ -18,7 +18,8 @@ stdenv.mkDerivation {
     freeglut libsamplerate pcre libevent libedit yajl
   ];
 
-  cmakeFlags = [ "-DCMAKE_BUILD_TYPE=release" ];
+  # for gcc5; c11 inline semantics breaks the build
+  NIX_CFLAGS_COMPILE = "-fgnu89-inline";
 
   meta = {
     description = "Io programming language";
diff --git a/pkgs/development/interpreters/perl/default.nix b/pkgs/development/interpreters/perl/default.nix
index d9158ad55ab5..1a92f3aa0072 100644
--- a/pkgs/development/interpreters/perl/default.nix
+++ b/pkgs/development/interpreters/perl/default.nix
@@ -113,7 +113,7 @@ let
 
 in rec {
 
-  perl = perl520;
+  perl = perl522;
 
   perl520 = common {
     version = "5.20.3";
diff --git a/pkgs/development/interpreters/self/default.nix b/pkgs/development/interpreters/self/default.nix
index d37d60993944..7a24e092fd3e 100644
--- a/pkgs/development/interpreters/self/default.nix
+++ b/pkgs/development/interpreters/self/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, fetchgit, stdenv, xorg, gcc44, makeWrapper, ncurses, cmake }:
+{ fetchurl, fetchgit, stdenv, xorg, makeWrapper, ncurses, cmake }:
 
 stdenv.mkDerivation rec {
   # The Self wrapper stores source in $XDG_DATA_HOME/self or ~/.local/share/self 
@@ -20,8 +20,7 @@ stdenv.mkDerivation rec {
     sha256 = "966025b71542e44fc830b951f404f5721ad410ed24f7236fd0cd820ea0fc5731";
   };
 
-  # gcc 4.6 and above causes crashes on Self startup but gcc 4.4 works.
-  buildInputs = [ gcc44 ncurses xorg.libX11 xorg.libXext makeWrapper cmake ];
+  buildInputs = [ ncurses xorg.libX11 xorg.libXext makeWrapper cmake ];
 
   selfWrapper = ./self;
 
@@ -36,9 +35,10 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "A prototype-based dynamic object-oriented programming language, environment, and virtual machine";
-    homepage = "http://selflanguage.org/";
+    homepage = http://selflanguage.org/;
     license = stdenv.lib.licenses.bsd3;
     maintainers = [ stdenv.lib.maintainers.doublec ];
     platforms = with stdenv.lib.platforms; linux;
+    broken = true; # segfaults on gcc > 4.4
   };
 }
diff --git a/pkgs/development/libraries/aterm/2.5.nix b/pkgs/development/libraries/aterm/2.5.nix
index ef53a76d20ba..c1bbbb0ae5a9 100644
--- a/pkgs/development/libraries/aterm/2.5.nix
+++ b/pkgs/development/libraries/aterm/2.5.nix
@@ -29,5 +29,6 @@ stdenv.mkDerivation {
     description = "Library for manipulation of term data structures in C";
     platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
     maintainers = [ stdenv.lib.maintainers.eelco ];
+    broken = true;
   };
 }
diff --git a/pkgs/development/libraries/crypto++/default.nix b/pkgs/development/libraries/crypto++/default.nix
index 788d488659af..940af8c44e91 100644
--- a/pkgs/development/libraries/crypto++/default.nix
+++ b/pkgs/development/libraries/crypto++/default.nix
@@ -25,7 +25,6 @@ stdenv.mkDerivation rec {
     ''
       sed -i GNUmakefile \
         -e 's|-march=native|${marchflags} -fPIC|g' \
-        -e 's|-mtune=native||g' \
         -e '/^CXXFLAGS =/s|-g ||'
     '';
 
diff --git a/pkgs/development/libraries/ffmpeg/generic.nix b/pkgs/development/libraries/ffmpeg/generic.nix
index 52273857fe93..122ded4d3021 100644
--- a/pkgs/development/libraries/ffmpeg/generic.nix
+++ b/pkgs/development/libraries/ffmpeg/generic.nix
@@ -1,11 +1,13 @@
 { stdenv, fetchurl, pkgconfig, perl, texinfo, yasm
 , alsaLib, bzip2, fontconfig, freetype, gnutls, libiconv, lame, libass, libogg
-, libtheora, libva, libvdpau, libvorbis, libvpx, lzma, libpulseaudio, SDL, soxr
-, x264, xvidcore, zlib, libopus
+, libtheora, libva, libvorbis, libvpx, lzma, libpulseaudio, soxr
+, x264, xvidcore, zlib, libopus, SDL
 , openglSupport ? false, mesa ? null
 # Build options
 , runtimeCpuDetectBuild ? true # Detect CPU capabilities at runtime
 , multithreadBuild ? true # Multithreading via pthreads/win32 threads
+, sdlSupport ? !stdenv.isArm, SDL ? null
+, vdpauSupport ? !stdenv.isArm, libvdpau ? null
 # Developer options
 , debugDeveloper ? false
 , optimizationsDeveloper ? true
@@ -39,7 +41,7 @@
  */
 
 let
-  inherit (stdenv) icCygwin isDarwin isFreeBSD isLinux;
+  inherit (stdenv) icCygwin isDarwin isFreeBSD isLinux isArm;
   inherit (stdenv.lib) optional optionals enableFeature;
 
   cmpVer = builtins.compareVersions;
@@ -51,8 +53,8 @@ let
   # Version specific fix
   verFix = withoutFix: fixVer: withFix: if reqMatch fixVer then withFix else withoutFix;
 
-  # Disable dependency that needs fixes before it will work on Darwin
-  disDarwinFix = origArg: minVer: fixArg: if (isDarwin && reqMin minVer) then fixArg else origArg;
+  # Disable dependency that needs fixes before it will work on Darwin or Arm
+  disDarwinOrArmFix = origArg: minVer: fixArg: if ((isDarwin || isArm) && reqMin minVer) then fixArg else origArg;
 in
 
 assert openglSupport -> mesa != null;
@@ -117,11 +119,11 @@ stdenv.mkDerivation rec {
       (ifMinVer "0.6" (enableFeature (isLinux || isFreeBSD) "vaapi"))
       "--enable-vdpau"
       "--enable-libvorbis"
-      (disDarwinFix (ifMinVer "0.6" "--enable-libvpx") "0.6" "--disable-libvpx")
+      (disDarwinOrArmFix (ifMinVer "0.6" "--enable-libvpx") "0.6" "--disable-libvpx")
       (ifMinVer "2.4" "--enable-lzma")
       (ifMinVer "2.2" (enableFeature openglSupport "opengl"))
-      (disDarwinFix (ifMinVer "0.9" "--enable-libpulse") "0.9" "--disable-libpulse")
-      (ifMinVer "2.5" "--enable-sdl") # Only configurable since 2.5, auto detected before then
+      (disDarwinOrArmFix (ifMinVer "0.9" "--enable-libpulse") "0.9" "--disable-libpulse")
+      (ifMinVer "2.5" (if sdlSupport then "--enable-sdl" else "")) # Only configurable since 2.5, auto detected before then
       (ifMinVer "1.2" "--enable-libsoxr")
       "--enable-libx264"
       "--enable-libxvid"
@@ -142,10 +144,13 @@ stdenv.mkDerivation rec {
     bzip2 fontconfig freetype gnutls libiconv lame libass libogg libtheora
     libvdpau libvorbis lzma SDL soxr x264 xvidcore zlib libopus
   ] ++ optional openglSupport mesa
-    ++ optionals (!isDarwin) [ libvpx libpulseaudio ] # Need to be fixed on Darwin
-    ++ optional (isLinux || isFreeBSD) libva
+    ++ optionals (!isDarwin && !isArm) [ libvpx libpulseaudio ] # Need to be fixed on Darwin and ARM
+    ++ optional ((isLinux || isFreeBSD) && !isArm) libva
     ++ optional isLinux alsaLib
-    ++ optional isDarwin Cocoa;
+    ++ optional isDarwin Cocoa
+    ++ optional vdpauSupport libvdpau
+    ++ optional sdlSupport SDL;
+
 
   enableParallelBuilding = true;
 
@@ -179,8 +184,8 @@ stdenv.mkDerivation rec {
   };
 
   passthru = {
-    vaapiSupport = if reqMin "0.6" && (isLinux || isFreeBSD) then true else false;
-    vdpauSupport = true;
+    vaapiSupport = if reqMin "0.6" && ((isLinux || isFreeBSD) && !isArm) then true else false;
+    inherit vdpauSupport;
   };
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/glibc/builder.sh b/pkgs/development/libraries/glibc/builder.sh
index d0684d6194d0..d60b143a1eca 100644
--- a/pkgs/development/libraries/glibc/builder.sh
+++ b/pkgs/development/libraries/glibc/builder.sh
@@ -37,6 +37,10 @@ postInstall() {
 
     # Get rid of more unnecessary stuff.
     rm -rf $out/var $out/sbin/sln
+
+    for i in $out/lib/*.a; do
+        strip -S "$i"
+    done
 }
 
 genericBuild
diff --git a/pkgs/development/libraries/glibc/default.nix b/pkgs/development/libraries/glibc/default.nix
index 5e25c2dc8bc8..2630cdb127f7 100644
--- a/pkgs/development/libraries/glibc/default.nix
+++ b/pkgs/development/libraries/glibc/default.nix
@@ -2,7 +2,6 @@
 , installLocales ? true
 , profilingLibraries ? false
 , gccCross ? null
-, debugSymbols ? false
 , withGd ? false, gd ? null, libpng ? null
 }:
 
@@ -13,9 +12,7 @@ let
   cross = if gccCross != null then gccCross.target else null;
 in
   build cross ({
-    name = "glibc"
-      + lib.optionalString debugSymbols "-debug"
-      + lib.optionalString withGd "-gd";
+    name = "glibc" + lib.optionalString withGd "-gd";
 
     inherit lib stdenv fetchurl linuxHeaders installLocales
       profilingLibraries gccCross withGd gd libpng;
@@ -38,23 +35,13 @@ in
       fi
     '';
 
+    separateDebugInfo = true;
+
     meta.description = "The GNU C Library";
   }
 
   //
 
-  (if debugSymbols
-   then {
-     # Build with debugging symbols, but leave optimizations on and don't
-     # attempt to keep the build tree.
-     dontStrip = true;
-     dontCrossStrip = true;
-     NIX_STRIP_DEBUG = 0;
-   }
-   else {})
-
-  //
-
   (if cross != null
    then {
       preConfigure = ''
diff --git a/pkgs/development/libraries/gsl/default.nix b/pkgs/development/libraries/gsl/default.nix
index af6c91499ac4..f5fdf4eec44c 100644
--- a/pkgs/development/libraries/gsl/default.nix
+++ b/pkgs/development/libraries/gsl/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
     ./disable-fma.patch # http://lists.gnu.org/archive/html/bug-gsl/2011-11/msg00019.html
   ];
 
-  doCheck = true;
+  doCheck = stdenv.system != "i686-linux"; # https://lists.gnu.org/archive/html/bug-gsl/2015-11/msg00012.html
 
   meta = {
     description = "The GNU Scientific Library, a large numerical library";
diff --git a/pkgs/development/libraries/libcli/default.nix b/pkgs/development/libraries/libcli/default.nix
index 1c247f6faa88..587e72409c45 100644
--- a/pkgs/development/libraries/libcli/default.nix
+++ b/pkgs/development/libraries/libcli/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ stdenv, fetchFromGitHub, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "libcli-${version}";
@@ -11,6 +11,13 @@ stdenv.mkDerivation rec {
     owner = "dparrish";
   };
 
+  patches =
+    [ (fetchurl {
+        url = "https://github.com/dparrish/libcli/commit/ebc5a09db457ee1be9996711463cbbafe5ea72d5.patch";
+        sha256 = "0szjiw3gd7by1sv924shnngfxvc98xvaqvx228b575xq93xxjcwl";
+      })
+    ];
+
   enableParallelBuilding = true;
 
   makeFlags = [ "PREFIX=$(out)" ];
diff --git a/pkgs/development/libraries/librdf/redland.nix b/pkgs/development/libraries/librdf/redland.nix
index 8ef900493456..34eabfe64732 100644
--- a/pkgs/development/libraries/librdf/redland.nix
+++ b/pkgs/development/libraries/librdf/redland.nix
@@ -30,6 +30,9 @@ stdenv.mkDerivation rec {
     [ "--with-threads" ]
     ++ stdenv.lib.optional withBdb "--with-bdb=${db}";
 
+  # Fix broken DT_NEEDED in lib/redland/librdf_storage_sqlite.so.
+  NIX_CFLAGS_LINK = "-lraptor2";
+
   meta = {
     homepage = http://librdf.org/;
   };
diff --git a/pkgs/development/libraries/nghttp2/default.nix b/pkgs/development/libraries/nghttp2/default.nix
index 2243cb2cca31..e6f76ce27ea7 100644
--- a/pkgs/development/libraries/nghttp2/default.nix
+++ b/pkgs/development/libraries/nghttp2/default.nix
@@ -34,12 +34,12 @@ let
 in
 stdenv.mkDerivation rec {
   name = "${prefix}nghttp2-${version}";
-  version = "1.7.1";
+  version = "1.8.0";
 
   # Don't use fetchFromGitHub since this needs a bootstrap curl
   src = fetchurl {
-    url = "http://security.ubuntu.com/ubuntu/pool/universe/n/nghttp2/nghttp2_${version}.orig.tar.bz2";
-    sha256 = "0nbrww5gyjn4il33wz5b4sql5nifi12y2jbkmfbvxwlxlywm48kf";
+    url = "http://http.debian.net/debian/pool/main/n/nghttp2/nghttp2_${version}.orig.tar.bz2";
+    sha256 = "10xz3s624w208pr9xgm4ammc8bc5mi17vy4357hjfd5vmmp5m8b0";
   };
 
   # Configure script searches for a symbol which does not exist in jemalloc on Darwin
diff --git a/pkgs/development/libraries/openbabel/default.nix b/pkgs/development/libraries/openbabel/default.nix
index 03cfbc8fabdd..3c4cd8bb6c8d 100644
--- a/pkgs/development/libraries/openbabel/default.nix
+++ b/pkgs/development/libraries/openbabel/default.nix
@@ -18,5 +18,6 @@ stdenv.mkDerivation rec {
   meta = {
     platforms = stdenv.lib.platforms.all;
     maintainers = [ stdenv.lib.maintainers.urkud ];
+    broken = true; # doesn't build with GCC 5; fix in GitHub
   };
 }
diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix
index 98e168f310d0..081f71b498e1 100644
--- a/pkgs/development/libraries/openssl/default.nix
+++ b/pkgs/development/libraries/openssl/default.nix
@@ -5,7 +5,7 @@ with stdenv.lib;
 
 let
 
-  opensslCrossSystem = stdenv.cross.openssl.system or 
+  opensslCrossSystem = stdenv.cross.openssl.system or
     (throw "openssl needs its platform name cross building");
 
   common = { version, sha256 }: stdenv.mkDerivation rec {
@@ -100,13 +100,13 @@ let
 in {
 
   openssl_1_0_1 = common {
-    version = "1.0.1r";
-    sha256 = "0iik7a3b0mrfrxzngdf7ywfscg9inbw77y0jp2ccw0gdap9xhjvq";
+    version = "1.0.1s";
+    sha256 = "e7e81d82f3cd538ab0cdba494006d44aab9dd96b7f6233ce9971fb7c7916d511";
   };
 
-  openssl_1_0_2 = lowPrio (common {
-    version = "1.0.2f";
-    sha256 = "932b4ee4def2b434f85435d9e3e19ca8ba99ce9a065a61524b429a9d5e9b2e9c";
-  });
+  openssl_1_0_2 = common {
+    version = "1.0.2g";
+    sha256 = "b784b1b3907ce39abf4098702dade6365522a253ad1552e267a9a0e89594aa33";
+  };
 
 }
diff --git a/pkgs/development/libraries/telepathy/qt/default.nix b/pkgs/development/libraries/telepathy/qt/default.nix
index 441d9385f736..e3e579eefdb6 100644
--- a/pkgs/development/libraries/telepathy/qt/default.nix
+++ b/pkgs/development/libraries/telepathy/qt/default.nix
@@ -8,6 +8,7 @@ stdenv.mkDerivation rec {
     url = "http://telepathy.freedesktop.org/releases/telepathy-qt/${name}.tar.gz";
     sha256 = "1y51c6rxk5qvmab98c8rnmrlyk27hnl248casvbq3cd93sav8vj9";
   };
+
   patches = let
     mkUrl = hash: "http://cgit.freedesktop.org/telepathy/telepathy-qt/patch/?id=" + hash;
     in [
@@ -36,7 +37,7 @@ stdenv.mkDerivation rec {
   cmakeFlags = "-DDESIRED_QT_VERSION=${builtins.substring 0 1 qtbase.version}";
 
   # should be removable after the next update
-  NIX_CFLAGS_COMPILE = [ "-Wno-error=cpp" "-Wno-error=unused-but-set-variable" ];
+  NIX_CFLAGS_COMPILE = [ "-Wno-error" ];
 
   preBuild = ''
     NIX_CFLAGS_COMPILE+=" `pkg-config --cflags dbus-glib-1`"
diff --git a/pkgs/development/libraries/vxl/default.nix b/pkgs/development/libraries/vxl/default.nix
index e181ade4d6c4..725a0bdfceaf 100644
--- a/pkgs/development/libraries/vxl/default.nix
+++ b/pkgs/development/libraries/vxl/default.nix
@@ -20,6 +20,8 @@ stdenv.mkDerivation {
 
   enableParallelBuilding = true;
 
+  patches = [ ./gcc5.patch ];
+
   meta = {
     description = "C++ Libraries for Computer Vision Research and Implementation";
     homepage = http://vxl.sourceforge.net/;
diff --git a/pkgs/development/libraries/vxl/gcc5.patch b/pkgs/development/libraries/vxl/gcc5.patch
new file mode 100644
index 000000000000..4660f9e8f483
--- /dev/null
+++ b/pkgs/development/libraries/vxl/gcc5.patch
@@ -0,0 +1,15 @@
+https://lists.fedoraproject.org/pipermail/scm-commits/Week-of-Mon-20150216/1511118.html
+
+--- vxl-git4e07960/vcl/vcl_compiler.h~	2012-11-02 12:08:21.000000000 +0100
++++ vxl-git4e07960/vcl/vcl_compiler.h	2015-02-15 13:50:46.376329878 +0100
+@@ -119,6 +119,10 @@
+ #  else

+ #   define VCL_GCC_40

+ #  endif

++# elif (__GNUC__== 5)

++// pretend GCC 5 to be GCC 4

++#  define VCL_GCC_4

++#  define VCL_GCC_41

+ # else

+ #  error "Dunno about this gcc"

+ # endif

diff --git a/pkgs/development/tools/misc/avarice/default.nix b/pkgs/development/tools/misc/avarice/default.nix
index e2c4c89e9987..eb81b7136f3d 100644
--- a/pkgs/development/tools/misc/avarice/default.nix
+++ b/pkgs/development/tools/misc/avarice/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, perl, libusb }:
+{ stdenv, fetchurl, pkgconfig, gcc, perl, libusb }:
 
 stdenv.mkDerivation rec {
 
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "0jhh1h1k5b41v2ycq8kn43nkrkh0b9l7xjmw38rak871g3z3hix1";
   };
 
-  buildInputs = [ pkgconfig perl libusb ];
+  buildInputs = [ pkgconfig gcc perl libusb ];
 
   meta = {
     license = stdenv.lib.licenses.gpl2;
diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix
index 86d69d8da8ce..89dd269b8cc1 100644
--- a/pkgs/development/tools/misc/binutils/default.nix
+++ b/pkgs/development/tools/misc/binutils/default.nix
@@ -2,7 +2,7 @@
 , cross ? null, gold ? true, bison ? null
 }:
 
-let basename = "binutils-2.23.1"; in
+let basename = "binutils-2.26"; in
 
 with { inherit (stdenv.lib) optional optionals optionalString; };
 
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://gnu/binutils/${basename}.tar.bz2";
-    sha256 = "06bs5v5ndb4g5qx96d52lc818gkbskd1m0sz57314v887sqfbcia";
+    sha256 = "1ngc2h3knhiw8s22l8y6afycfaxr5grviqy7mwvm4bsl14cf9b62";
   };
 
   patches = [
@@ -31,10 +31,15 @@ stdenv.mkDerivation rec {
     # Always add PaX flags section to ELF files.
     # This is needed, for instance, so that running "ldd" on a binary that is
     # PaX-marked to disable mprotect doesn't fail with permission denied.
-    ./pt-pax-flags-20121023.patch
+    ./pt-pax-flags.patch
+
+    # Bug fix backported from binutils master.
+    ./fix-bsymbolic.patch
   ];
 
-  nativeBuildInputs = optional gold bison;
+  outputs = [ "out" "info" ];
+
+  nativeBuildInputs = [ bison ];
   buildInputs = [ zlib ];
 
   inherit noSysDirs;
diff --git a/pkgs/development/tools/misc/binutils/fix-bsymbolic.patch b/pkgs/development/tools/misc/binutils/fix-bsymbolic.patch
new file mode 100644
index 000000000000..afaafc997efb
--- /dev/null
+++ b/pkgs/development/tools/misc/binutils/fix-bsymbolic.patch
@@ -0,0 +1,47 @@
+http://lists.gnu.org/archive/html/bug-binutils/2016-01/msg00193.html
+https://sourceware.org/bugzilla/show_bug.cgi?id=19615
+
+From 1dab972d797c060e17229c2e10da01852ba82629 Mon Sep 17 00:00:00 2001
+From: "H.J. Lu" <hjl.tools@gmail.com>
+Date: Thu, 11 Feb 2016 15:31:15 -0800
+Subject: [PATCH] Enable -Bsymbolic and -Bsymbolic-functions to PIE
+
+Before binutils 2.26, -Bsymbolic and -Bsymbolic-functions were also
+applied to PIE so that "ld -pie -Bsymbolic -E" can be used to export
+symbols in PIE with local binding.  This patch re-enables -Bsymbolic
+and -Bsymbolic-functions for PIE.
+
+diff --git a/ld/lexsup.c b/ld/lexsup.c
+index 4cad209..e2fb212 100644
+--- a/ld/lexsup.c
++++ b/ld/lexsup.c
+@@ -1586,15 +1586,14 @@ parse_args (unsigned argc, char **argv)
+   /* We may have -Bsymbolic, -Bsymbolic-functions, --dynamic-list-data,
+      --dynamic-list-cpp-new, --dynamic-list-cpp-typeinfo and
+      --dynamic-list FILE.  -Bsymbolic and -Bsymbolic-functions are
+-     for shared libraries.  -Bsymbolic overrides all others and vice
+-     versa.  */
++     for PIC outputs.  -Bsymbolic overrides all others and vice versa.  */
+   switch (command_line.symbolic)
+     {
+     case symbolic_unset:
+       break;
+     case symbolic:
+-      /* -Bsymbolic is for shared library only.  */
+-      if (bfd_link_dll (&link_info))
++      /* -Bsymbolic is for PIC output only.  */
++      if (bfd_link_pic (&link_info))
+ 	{
+ 	  link_info.symbolic = TRUE;
+ 	  /* Should we free the unused memory?  */
+@@ -1603,8 +1602,8 @@ parse_args (unsigned argc, char **argv)
+ 	}
+       break;
+     case symbolic_functions:
+-      /* -Bsymbolic-functions is for shared library only.  */
+-      if (bfd_link_dll (&link_info))
++      /* -Bsymbolic-functions is for PIC output only.  */
++      if (bfd_link_pic (&link_info))
+ 	command_line.dynamic_list = dynamic_list_data;
+       break;
+     }
diff --git a/pkgs/development/tools/misc/binutils/pt-pax-flags-20121023.patch b/pkgs/development/tools/misc/binutils/pt-pax-flags-20121023.patch
deleted file mode 100644
index bb0785fe192e..000000000000
--- a/pkgs/development/tools/misc/binutils/pt-pax-flags-20121023.patch
+++ /dev/null
@@ -1,1786 +0,0 @@
---- binutils-2.23/bfd/elf-bfd.h
-+++ binutils-2.23/bfd/elf-bfd.h
-@@ -1577,6 +1577,9 @@ struct elf_obj_tdata
-   /* Segment flags for the PT_GNU_STACK segment.  */
-   unsigned int stack_flags;
- 
-+  /* Segment flags for the PT_PAX_FLAGS segment.  */
-+  unsigned int pax_flags;
-+
-   /* Symbol version definitions in external objects.  */
-   Elf_Internal_Verdef *verdef;
- 
---- binutils-2.23/bfd/elf.c
-+++ binutils-2.23/bfd/elf.c
-@@ -1158,6 +1158,7 @@ get_segment_type (unsigned int p_type)
-     case PT_GNU_EH_FRAME: pt = "EH_FRAME"; break;
-     case PT_GNU_STACK: pt = "STACK"; break;
-     case PT_GNU_RELRO: pt = "RELRO"; break;
-+    case PT_PAX_FLAGS: pt = "PAX_FLAGS"; break;
-     default: pt = NULL; break;
-     }
-   return pt;
-@@ -2477,6 +2478,9 @@ bfd_section_from_phdr (bfd *abfd, Elf_Internal_Phdr *hdr, int hdr_index)
-     case PT_GNU_RELRO:
-       return _bfd_elf_make_section_from_phdr (abfd, hdr, hdr_index, "relro");
- 
-+    case PT_PAX_FLAGS:
-+      return _bfd_elf_make_section_from_phdr (abfd, hdr, hdr_index, "pax_flags");
-+
-     default:
-       /* Check for any processor-specific program segment types.  */
-       bed = get_elf_backend_data (abfd);
-@@ -3551,6 +3555,11 @@ get_program_header_size (bfd *abfd, struct bfd_link_info *info)
-       ++segs;
-     }
- 
-+    {
-+      /* We need a PT_PAX_FLAGS segment.  */
-+      ++segs;
-+    }
-+
-   for (s = abfd->sections; s != NULL; s = s->next)
-     {
-       if ((s->flags & SEC_LOAD) != 0
-@@ -4153,6 +4162,20 @@ _bfd_elf_map_sections_to_segments (bfd *abfd, struct bfd_link_info *info)
- 	    }
- 	}
- 
-+    {
-+      amt = sizeof (struct elf_segment_map);
-+      m = bfd_zalloc (abfd, amt);
-+      if (m == NULL)
-+	goto error_return;
-+      m->next = NULL;
-+      m->p_type = PT_PAX_FLAGS;
-+      m->p_flags = elf_tdata (abfd)->pax_flags;
-+      m->p_flags_valid = 1;
-+
-+      *pm = m;
-+      pm = &m->next;
-+    }
-+
-       free (sections);
-       elf_tdata (abfd)->segment_map = mfirst;
-     }
-@@ -5417,7 +5440,8 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd)
-        6. PT_TLS segment includes only SHF_TLS sections.
-        7. SHF_TLS sections are only in PT_TLS or PT_LOAD segments.
-        8. PT_DYNAMIC should not contain empty sections at the beginning
--	  (with the possible exception of .dynamic).  */
-+	  (with the possible exception of .dynamic).
-+       9. PT_PAX_FLAGS segments do not include any sections.  */
- #define IS_SECTION_IN_INPUT_SEGMENT(section, segment, bed)		\
-   ((((segment->p_paddr							\
-       ? IS_CONTAINED_BY_LMA (section, segment, segment->p_paddr)	\
-@@ -5425,6 +5449,7 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd)
-      && (section->flags & SEC_ALLOC) != 0)				\
-     || IS_NOTE (segment, section))					\
-    && segment->p_type != PT_GNU_STACK					\
-+   && segment->p_type != PT_PAX_FLAGS					\
-    && (segment->p_type != PT_TLS					\
-        || (section->flags & SEC_THREAD_LOCAL))				\
-    && (segment->p_type == PT_LOAD					\
---- binutils-2.23/bfd/elflink.c
-+++ binutils-2.23/bfd/elflink.c
-@@ -5545,16 +5545,30 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd,
-     return TRUE;
- 
-   bed = get_elf_backend_data (output_bfd);
-+
-+  elf_tdata (output_bfd)->pax_flags = PF_NORANDEXEC;
-+  if (info->execheap)
-+    elf_tdata (output_bfd)->pax_flags |= PF_NOMPROTECT;
-+  else if (info->noexecheap)
-+    elf_tdata (output_bfd)->pax_flags |= PF_MPROTECT;
-+
-   if (info->execstack)
--    elf_tdata (output_bfd)->stack_flags = PF_R | PF_W | PF_X;
-+    {
-+      elf_tdata (output_bfd)->stack_flags = PF_R | PF_W | PF_X;
-+      elf_tdata (output_bfd)->pax_flags |= PF_EMUTRAMP;
-+    }
-   else if (info->noexecstack)
--    elf_tdata (output_bfd)->stack_flags = PF_R | PF_W;
-+    {
-+      elf_tdata (output_bfd)->stack_flags = PF_R | PF_W;
-+      elf_tdata (output_bfd)->pax_flags |= PF_NOEMUTRAMP;
-+    }
-   else
-     {
-       bfd *inputobj;
-       asection *notesec = NULL;
-       int exec = 0;
- 
-+      elf_tdata (output_bfd)->pax_flags |= PF_NOEMUTRAMP;
-       for (inputobj = info->input_bfds;
- 	   inputobj;
- 	   inputobj = inputobj->link_next)
-@@ -5567,7 +5581,11 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd,
- 	  if (s)
- 	    {
- 	      if (s->flags & SEC_CODE)
--		exec = PF_X;
-+		{
-+		  elf_tdata (output_bfd)->pax_flags &= ~PF_NOEMUTRAMP;
-+		  elf_tdata (output_bfd)->pax_flags |= PF_EMUTRAMP;
-+		  exec = PF_X;
-+		}
- 	      notesec = s;
- 	    }
- 	  else if (bed->default_execstack)
---- binutils-2.23/binutils/readelf.c
-+++ binutils-2.23/binutils/readelf.c
-@@ -2740,6 +2740,7 @@ get_segment_type (unsigned long p_type)
- 			return "GNU_EH_FRAME";
-     case PT_GNU_STACK:	return "GNU_STACK";
-     case PT_GNU_RELRO:  return "GNU_RELRO";
-+    case PT_PAX_FLAGS:  return "PAX_FLAGS";
- 
-     default:
-       if ((p_type >= PT_LOPROC) && (p_type <= PT_HIPROC))
---- binutils-2.23/include/bfdlink.h
-+++ binutils-2.23/include/bfdlink.h
-@@ -322,6 +322,14 @@ struct bfd_link_info
-   /* TRUE if PT_GNU_RELRO segment should be created.  */
-   unsigned int relro: 1;
- 
-+  /* TRUE if PT_PAX_FLAGS segment should be created with PF_NOMPROTECT
-+     flags.  */
-+  unsigned int execheap: 1;
-+
-+  /* TRUE if PT_PAX_FLAGS segment should be created with PF_MPROTECT
-+     flags.  */
-+  unsigned int noexecheap: 1;
-+
-   /* TRUE if .eh_frame_hdr section and PT_GNU_EH_FRAME ELF segment
-      should be created.  */
-   unsigned int eh_frame_hdr: 1;
---- binutils-2.23/include/elf/common.h
-+++ binutils-2.23/include/elf/common.h
-@@ -429,6 +429,7 @@
- #define PT_SUNW_EH_FRAME PT_GNU_EH_FRAME      /* Solaris uses the same value */
- #define PT_GNU_STACK	(PT_LOOS + 0x474e551) /* Stack flags */
- #define PT_GNU_RELRO	(PT_LOOS + 0x474e552) /* Read-only after relocation */
-+#define PT_PAX_FLAGS	(PT_LOOS + 0x5041580) /* PaX flags */
- 
- /* Program segment permissions, in program header p_flags field.  */
- 
-@@ -439,6 +440,21 @@
- #define PF_MASKOS	0x0FF00000	/* New value, Oct 4, 1999 Draft */
- #define PF_MASKPROC	0xF0000000	/* Processor-specific reserved bits */
- 
-+/* Flags to control PaX behavior.  */
-+
-+#define PF_PAGEEXEC	(1 << 4)	/* Enable  PAGEEXEC */
-+#define PF_NOPAGEEXEC	(1 << 5)	/* Disable PAGEEXEC */
-+#define PF_SEGMEXEC	(1 << 6)	/* Enable  SEGMEXEC */
-+#define PF_NOSEGMEXEC	(1 << 7)	/* Disable SEGMEXEC */
-+#define PF_MPROTECT	(1 << 8)	/* Enable  MPROTECT */
-+#define PF_NOMPROTECT	(1 << 9)	/* Disable MPROTECT */
-+#define PF_RANDEXEC	(1 << 10)	/* Enable  RANDEXEC */
-+#define PF_NORANDEXEC	(1 << 11)	/* Disable RANDEXEC */
-+#define PF_EMUTRAMP	(1 << 12)	/* Enable  EMUTRAMP */
-+#define PF_NOEMUTRAMP	(1 << 13)	/* Disable EMUTRAMP */
-+#define PF_RANDMMAP	(1 << 14)	/* Enable  RANDMMAP */
-+#define PF_NORANDMMAP	(1 << 15)	/* Disable RANDMMAP */
-+
- /* Values for section header, sh_type field.  */
- 
- #define SHT_NULL	0		/* Section header table entry unused */
---- binutils-2.23/ld/emultempl/elf32.em
-+++ binutils-2.23/ld/emultempl/elf32.em
-@@ -2285,6 +2285,16 @@ fragment <<EOF
- 	  link_info.noexecstack = TRUE;
- 	  link_info.execstack = FALSE;
- 	}
-+      else if (strcmp (optarg, "execheap") == 0)
-+	{
-+	  link_info.execheap = TRUE;
-+	  link_info.noexecheap = FALSE;
-+	}
-+      else if (strcmp (optarg, "noexecheap") == 0)
-+	{
-+	  link_info.noexecheap = TRUE;
-+	  link_info.execheap = FALSE;
-+	}
- EOF
- if test x"$GENERATE_SHLIB_SCRIPT" = xyes; then
- fragment <<EOF
-@@ -2368,6 +2378,8 @@ fragment <<EOF
-   -z defs                     Report unresolved symbols in object files.\n"));
-   fprintf (file, _("\
-   -z execstack                Mark executable as requiring executable stack\n"));
-+  fprintf (file, _("\
-+  -z execheap                 Mark executable as requiring executable heap\n"));
- EOF
- 
- if test x"$GENERATE_SHLIB_SCRIPT" = xyes; then
-@@ -2391,6 +2403,8 @@ fragment <<EOF
- fragment <<EOF
-   fprintf (file, _("\
-   -z noexecstack              Mark executable as not requiring executable stack\n"));
-+  fprintf (file, _("\
-+  -z noexecheap               Mark executable as not requiring executable heap\n"));
- EOF
- if test x"$GENERATE_SHLIB_SCRIPT" = xyes; then
- fragment <<EOF
---- binutils-2.23/ld/ldgram.y
-+++ binutils-2.23/ld/ldgram.y
-@@ -1119,6 +1119,8 @@ phdr_type:
- 			    $$ = exp_intop (0x6474e550);
- 			  else if (strcmp (s, "PT_GNU_STACK") == 0)
- 			    $$ = exp_intop (0x6474e551);
-+			  else if (strcmp (s, "PT_PAX_FLAGS") == 0)
-+			    $$ = exp_intop (0x65041580);
- 			  else
- 			    {
- 			      einfo (_("\
---- binutils-2.23/ld/testsuite/ld-alpha/tlsbin.rd
-+++ binutils-2.23/ld/testsuite/ld-alpha/tlsbin.rd
-@@ -35,13 +35,14 @@ There are [0-9]+ program headers, starting at offset [0-9]+
- 
- Program Headers:
-   Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align
--  PHDR +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+150 R E 0x8
-+  PHDR +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+188 R E 0x8
-   INTERP +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ R +0x1
- .*Requesting program interpreter.*
-   LOAD +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ R E 0x10000
-   LOAD +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ RWE 0x10000
-   DYNAMIC +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ RW +0x8
-   TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ R +0x4
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- #...
- 
- Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 3 entries:
---- binutils-2.23/ld/testsuite/ld-alpha/tlsbinr.rd
-+++ binutils-2.23/ld/testsuite/ld-alpha/tlsbinr.rd
-@@ -42,6 +42,7 @@ Program Headers:
-  +LOAD +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ RWE 0x10000
-  +DYNAMIC +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ RW +0x8
-  +TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ R +0x4
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- #...
- 
- Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 2 entries:
---- binutils-2.23/ld/testsuite/ld-alpha/tlspic.rd
-+++ binutils-2.23/ld/testsuite/ld-alpha/tlspic.rd
-@@ -38,6 +38,7 @@ Program Headers:
-  +LOAD +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ RWE 0x10000
-  +DYNAMIC +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ RW +0x8
-  +TLS +0x0+10e0 0x0+110e0 0x0+110e0 0x0+60 0x0+80 R +0x4
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- #...
- 
- Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 7 entries:
---- binutils-2.23/ld/testsuite/ld-elf/eh1.d
-+++ binutils-2.23/ld/testsuite/ld-elf/eh1.d
-@@ -22,11 +22,11 @@ Contents of the .eh_frame section:
-   DW_CFA_nop
-   DW_CFA_nop
- 
--00000018 0000001c 0000001c FDE cie=00000000 pc=00400078..00400078
--  DW_CFA_advance_loc: 0 to 00400078
-+00000018 0000001c 0000001c FDE cie=00000000 pc=([0-9a-f]+)..\1
-+  DW_CFA_advance_loc: 0 to [0-9a-f]+
-   DW_CFA_def_cfa_offset: 16
-   DW_CFA_offset: r6 \(rbp\) at cfa-16
--  DW_CFA_advance_loc: 0 to 00400078
-+  DW_CFA_advance_loc: 0 to [0-9a-f]+
-   DW_CFA_def_cfa_register: r6 \(rbp\)
- 
- 00000038 ZERO terminator
---- binutils-2.23/ld/testsuite/ld-elf/eh2.d
-+++ binutils-2.23/ld/testsuite/ld-elf/eh2.d
-@@ -22,11 +22,11 @@ Contents of the .eh_frame section:
-   DW_CFA_nop
-   DW_CFA_nop
- 
--00000018 0000001c 0000001c FDE cie=00000000 pc=00400078..00400078
--  DW_CFA_advance_loc: 0 to 00400078
-+00000018 0000001c 0000001c FDE cie=00000000 pc=([0-9a-f]+)..\1
-+  DW_CFA_advance_loc: 0 to [0-9a-f]+
-   DW_CFA_def_cfa_offset: 16
-   DW_CFA_offset: r6 \(rbp\) at cfa-16
--  DW_CFA_advance_loc: 0 to 00400078
-+  DW_CFA_advance_loc: 0 to [0-9a-f]+
-   DW_CFA_def_cfa_register: r6 \(rbp\)
- 
- 00000038 ZERO terminator
---- binutils-2.23/ld/testsuite/ld-elf/eh3.d
-+++ binutils-2.23/ld/testsuite/ld-elf/eh3.d
-@@ -22,11 +22,11 @@ Contents of the .eh_frame section:
-   DW_CFA_nop
-   DW_CFA_nop
- 
--00000018 0000001c 0000001c FDE cie=00000000 pc=00400078..00400078
--  DW_CFA_advance_loc: 0 to 00400078
-+00000018 0000001c 0000001c FDE cie=00000000 pc=([0-9a-f]+)..\1
-+  DW_CFA_advance_loc: 0 to [0-9a-f]+
-   DW_CFA_def_cfa_offset: 16
-   DW_CFA_offset: r6 \(rbp\) at cfa-16
--  DW_CFA_advance_loc: 0 to 00400078
-+  DW_CFA_advance_loc: 0 to [0-9a-f]+
-   DW_CFA_def_cfa_register: r6 \(rbp\)
- 
- 00000038 ZERO terminator
---- binutils-2.23/ld/testsuite/ld-elf/orphan-region.d
-+++ binutils-2.23/ld/testsuite/ld-elf/orphan-region.d
-@@ -15,7 +15,9 @@
- Program Headers:
-   Type.*
-   LOAD[ \t]+0x[0-9a-f]+ 0x0*40000000 0x0*40000000 0x[0-9a-f]+ 0x[0-9a-f]+ RWE 0x[0-9a-f]+
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- 
-  Section to Segment mapping:
-   Segment Sections...
-    00     .text .rodata .moredata *
-+   01 +
---- binutils-2.23/ld/testsuite/ld-i386/tlsbin.rd
-+++ binutils-2.23/ld/testsuite/ld-i386/tlsbin.rd
-@@ -44,6 +44,7 @@ Program Headers:
-  +LOAD.*
-  +DYNAMIC.*
-  +TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+60 0x0+a0 R +0x1000
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- 
-  Section to Segment mapping:
-  +Segment Sections...
-@@ -53,6 +54,7 @@ Program Headers:
-  +03 +.tdata .dynamic .got .got.plt *
-  +04 +.dynamic *
-  +05 +.tdata .tbss *
-+ +06 +
- 
- Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 9 entries:
-  Offset +Info +Type +Sym.Value +Sym. Name
---- binutils-2.23/ld/testsuite/ld-i386/tlsbindesc.rd
-+++ binutils-2.23/ld/testsuite/ld-i386/tlsbindesc.rd
-@@ -42,6 +42,7 @@ Program Headers:
-  +LOAD.*
-  +DYNAMIC.*
-  +TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+60 0x0+a0 R +0x1000
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- 
-  Section to Segment mapping:
-  +Segment Sections...
-@@ -51,6 +52,7 @@ Program Headers:
-  +03 +.tdata .dynamic .got .got.plt *
-  +04 +.dynamic *
-  +05 +.tdata .tbss *
-+ +06 +
- 
- Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 9 entries:
-  Offset +Info +Type +Sym.Value +Sym. Name
---- binutils-2.23/ld/testsuite/ld-i386/tlsdesc.rd
-+++ binutils-2.23/ld/testsuite/ld-i386/tlsdesc.rd
-@@ -39,6 +39,7 @@ Program Headers:
-  +LOAD.*
-  +DYNAMIC.*
-  +TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+60 0x0+80 R +0x1
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- 
-  Section to Segment mapping:
-  +Segment Sections...
-@@ -46,6 +47,7 @@ Program Headers:
-  +01 +.tdata .dynamic .got .got.plt *
-  +02 +.dynamic *
-  +03 +.tdata .tbss *
-+ +04 +
- 
- Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 20 entries:
-  Offset +Info +Type +Sym.Value +Sym. Name
---- binutils-2.23/ld/testsuite/ld-i386/tlsgdesc.rd
-+++ binutils-2.23/ld/testsuite/ld-i386/tlsgdesc.rd
-@@ -36,12 +36,14 @@ Program Headers:
-  +LOAD.*
-  +LOAD.*
-  +DYNAMIC.*
-+ +PAX_FLAGS.*
- 
-  Section to Segment mapping:
-  +Segment Sections...
-  +00 +.hash .dynsym .dynstr .rel.dyn .rel.plt .plt .text *
-  +01 +.dynamic .got .got.plt *
-  +02 +.dynamic *
-+ +03 +
- 
- Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 8 entries:
-  Offset +Info +Type +Sym.Value +Sym. Name
---- binutils-2.23/ld/testsuite/ld-i386/tlsnopic.rd
-+++ binutils-2.23/ld/testsuite/ld-i386/tlsnopic.rd
-@@ -37,6 +37,7 @@ Program Headers:
-  +LOAD.*
-  +DYNAMIC.*
-  +TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+ 0x0+24 R +0x1
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- 
-  Section to Segment mapping:
-  +Segment Sections...
-@@ -44,6 +45,7 @@ Program Headers:
-  +01 +.dynamic .got .got.plt *
-  +02 +.dynamic *
-  +03 +.tbss *
-+ +04 +
- 
- Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 20 entries:
-  Offset +Info +Type +Sym.Value +Sym. Name
---- binutils-2.23/ld/testsuite/ld-i386/tlspic.rd
-+++ binutils-2.23/ld/testsuite/ld-i386/tlspic.rd
-@@ -40,6 +40,7 @@ Program Headers:
-  +LOAD.*
-  +DYNAMIC.*
-  +TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+60 0x0+80 R +0x1
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- 
-  Section to Segment mapping:
-  +Segment Sections...
-@@ -47,6 +48,7 @@ Program Headers:
-  +01 +.tdata .dynamic .got .got.plt *
-  +02 +.dynamic *
-  +03 +.tdata .tbss *
-+ +04 +
- 
- Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 26 entries:
-  Offset +Info +Type +Sym.Value +Sym. Name
---- binutils-2.23/ld/testsuite/ld-ia64/merge1.d
-+++ binutils-2.23/ld/testsuite/ld-ia64/merge1.d
-@@ -4,7 +4,7 @@
- #objdump: -d
- 
- #...
--0+1e0 <.text>:
-+[a-f0-9]+ <.text>:
- [ 	]*[a-f0-9]+:	0b 60 80 02 00 24 	\[MMI\]       addl r12=32,r1;;
- [ 	]*[a-f0-9]+:	c0 c0 04 00 48 00 	            addl r12=24,r1
- [ 	]*[a-f0-9]+:	00 00 04 00       	            nop.i 0x0;;
---- binutils-2.23/ld/testsuite/ld-ia64/merge2.d
-+++ binutils-2.23/ld/testsuite/ld-ia64/merge2.d
-@@ -4,7 +4,7 @@
- #objdump: -d
- 
- #...
--0+1e0 <.text>:
-+[a-f0-9]+ <.text>:
- [ 	]*[a-f0-9]+:	0b 60 80 02 00 24 	\[MMI\]       addl r12=32,r1;;
- [ 	]*[a-f0-9]+:	c0 c0 04 00 48 00 	            addl r12=24,r1
- [ 	]*[a-f0-9]+:	00 00 04 00       	            nop.i 0x0;;
---- binutils-2.23/ld/testsuite/ld-ia64/merge3.d
-+++ binutils-2.23/ld/testsuite/ld-ia64/merge3.d
-@@ -4,7 +4,7 @@
- #objdump: -d
- 
- #...
--0+210 <.text>:
-+[a-f0-9]+ <.text>:
- [ 	]*[a-f0-9]+:	0b 60 80 02 00 24 	\[MMI\]       addl r12=32,r1;;
- [ 	]*[a-f0-9]+:	c0 40 05 00 48 00 	            addl r12=40,r1
- [ 	]*[a-f0-9]+:	00 00 04 00       	            nop.i 0x0;;
---- binutils-2.23/ld/testsuite/ld-ia64/merge4.d
-+++ binutils-2.23/ld/testsuite/ld-ia64/merge4.d
-@@ -4,7 +4,7 @@
- #objdump: -d
- 
- #...
--0+240 <.text>:
-+[a-f0-9]+ <.text>:
- [ 	]*[a-f0-9]+:	0b 60 80 02 00 24 	\[MMI\]       addl r12=32,r1;;
- [ 	]*[a-f0-9]+:	c0 40 05 00 48 00 	            addl r12=40,r1
- [ 	]*[a-f0-9]+:	00 00 04 00       	            nop.i 0x0;;
---- binutils-2.23/ld/testsuite/ld-ia64/merge5.d
-+++ binutils-2.23/ld/testsuite/ld-ia64/merge5.d
-@@ -4,7 +4,7 @@
- #objdump: -d
- 
- #...
--0+270 <.text>:
-+[a-f0-9]+ <.text>:
- [ 	]*[a-f0-9]+:	0b 60 80 02 00 24 	\[MMI\]       addl r12=32,r1;;
- [ 	]*[a-f0-9]+:	c0 40 05 00 48 00 	            addl r12=40,r1
- [ 	]*[a-f0-9]+:	00 00 04 00       	            nop.i 0x0;;
---- binutils-2.23/ld/testsuite/ld-ia64/tlsbin.rd
-+++ binutils-2.23/ld/testsuite/ld-ia64/tlsbin.rd
-@@ -36,13 +36,14 @@ There are [0-9]+ program headers, starting at offset [0-9]+
- 
- Program Headers:
-  +Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align
-- +PHDR +0x0+40 0x40+40 0x40+40 0x0+188 0x0+188 R E 0x8
-- +INTERP +0x0+1c8 0x40+1c8 0x40+1c8 0x[0-9a-f]+ 0x[0-9a-f]+ R +0x1
-+ +PHDR +0x0+40 0x40+40 0x40+40 (0x[0-9a-f]+) \1 R E 0x8
-+ +INTERP +0x0+([0-9a-f]+) (0x40+\1) \2 0x[0-9a-f]+ 0x[0-9a-f]+ R +0x1
- .*Requesting program interpreter.*
-  +LOAD +0x0+ 0x40+ 0x40+ 0x0+1[0-9a-f]+ 0x0+1[0-9a-f]+ R E 0x10000
-  +LOAD +0x0+1[0-9a-f]+ 0x60+1[0-9a-f]+ 0x60+1[0-9a-f]+ 0x0+0[0-9a-f]+ 0x0+0[0-9a-f]+ RW +0x10000
-  +DYNAMIC +0x0+1[0-9a-f]+ 0x60+1[0-9a-f]+ 0x60+1[0-9a-f]+ 0x0+150 0x0+150 RW +0x8
-  +TLS +0x0+1[0-9a-f]+ 0x60+1[0-9a-f]+ 0x60+1[0-9a-f]+ 0x0+60 0x0+a0 R +0x4
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
-  +IA_64_UNWIND .* R +0x8
- #...
- 
---- binutils-2.23/ld/testsuite/ld-ia64/tlspic.rd
-+++ binutils-2.23/ld/testsuite/ld-ia64/tlspic.rd
-@@ -40,6 +40,7 @@ Program Headers:
-  +LOAD +0x0+1[0-9a-f]+ 0x0+11[0-9a-f]+ 0x0+11[0-9a-f]+ 0x0+0[0-9a-f]+ 0x0+0[0-9a-f]+ RW +0x10000
-  +DYNAMIC +0x0+1[0-9a-f]+ 0x0+11[0-9a-f]+ 0x0+11[0-9a-f]+ 0x0+140 0x0+140 RW +0x8
-  +TLS +0x0+1[0-9a-f]+ 0x0+11[0-9a-f]+ 0x0+11[0-9a-f]+ 0x0+60 0x0+80 R +0x4
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
-  +IA_64_UNWIND +0x0+1[0-9a-f]+ 0x0+1[0-9a-f]+ 0x0+1[0-9a-f]+ 0x0+18 0x0+18 R +0x8
- #...
- 
---- binutils-2.23/ld/testsuite/ld-mips-elf/multi-got-no-shared.d
-+++ binutils-2.23/ld/testsuite/ld-mips-elf/multi-got-no-shared.d
-@@ -8,9 +8,9 @@
- .*: +file format.*
- 
- Disassembly of section \.text:
--004000b0 <[^>]*> 3c1c0043 	lui	gp,0x43
--004000b4 <[^>]*> 279c9ff0 	addiu	gp,gp,-24592
--004000b8 <[^>]*> afbc0008 	sw	gp,8\(sp\)
-+004000d0 <[^>]*> 3c1c0043 	lui	gp,0x43
-+004000d4 <[^>]*> 279c9ff0 	addiu	gp,gp,-24592
-+004000d8 <[^>]*> afbc0008 	sw	gp,8\(sp\)
- #...
- 00408d60 <[^>]*> 3c1c0043 	lui	gp,0x43
- 00408d64 <[^>]*> 279c2c98 	addiu	gp,gp,11416
---- binutils-2.23/ld/testsuite/ld-mips-elf/pic-and-nonpic-3a.sd
-+++ binutils-2.23/ld/testsuite/ld-mips-elf/pic-and-nonpic-3a.sd
-@@ -1,7 +1,7 @@
- 
- Elf file type is DYN \(Shared object file\)
- Entry point .*
--There are 5 program headers, starting at offset .*
-+There are [0-9] program headers, starting at offset .*
- 
- Program Headers:
-  * Type * Offset * VirtAddr * PhysAddr * FileSiz * MemSiz * Flg * Align
-@@ -9,6 +9,7 @@ Program Headers:
-  * LOAD * [^ ]+ * 0x0+00000 * 0x0+00000 [^ ]+ * [^ ]+ * R E * 0x.*
-  * LOAD * [^ ]+ * 0x0+10000 * 0x0+10000 [^ ]+ * [^ ]+ * RW  * 0x.*
-  * DYNAMIC * [^ ]+ * 0x0+00400 * 0x0+00400 .*
-+ * PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
-  * NULL * .*
- 
-  *Section to Segment mapping:
-@@ -18,3 +19,4 @@ Program Headers:
-  *0*2 * \.data \.got *
-  *0*3 * \.dynamic *
-  *0*4 *
-+ *0*5 *
---- binutils-2.23/ld/testsuite/ld-mips-elf/pic-and-nonpic-3b.sd
-+++ binutils-2.23/ld/testsuite/ld-mips-elf/pic-and-nonpic-3b.sd
-@@ -1,7 +1,7 @@
- 
- Elf file type is EXEC \(Executable file\)
- Entry point 0x44000
--There are 8 program headers, starting at offset .*
-+There are [0-9] program headers, starting at offset .*
- 
- Program Headers:
-  * Type * Offset * VirtAddr * PhysAddr * FileSiz * MemSiz * Flg * Align
-@@ -13,6 +13,7 @@ Program Headers:
-  * LOAD * [^ ]+ * 0x0+80000 * 0x0+80000 [^ ]+ * [^ ]+ * RW  * 0x.*
-  * LOAD * [^ ]+ * 0x0+a0000 * 0x0+a0000 [^ ]+ * [^ ]+ * RW  * 0x.*
-  * DYNAMIC * [^ ]+ * 0x0+42000 * 0x0+42000 .*
-+ * PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
-  * NULL * .*
- 
-  *Section to Segment mapping:
-@@ -25,3 +26,4 @@ Program Headers:
-  *0*5 *\.got \.data *
-  *0*6 *\.dynamic *
-  *0*7 *
-+ *0*8 *
---- binutils-2.23/ld/testsuite/ld-mips-elf/pic-and-nonpic-4b.sd
-+++ binutils-2.23/ld/testsuite/ld-mips-elf/pic-and-nonpic-4b.sd
-@@ -1,7 +1,7 @@
- 
- Elf file type is EXEC \(Executable file\)
- Entry point 0x44000
--There are 8 program headers, starting at offset .*
-+There are [0-9] program headers, starting at offset .*
- 
- Program Headers:
-  * Type * Offset * VirtAddr * PhysAddr * FileSiz * MemSiz * Flg * Align
-@@ -13,6 +13,7 @@ Program Headers:
-  * LOAD * [^ ]+ * 0x0+80000 * 0x0+80000 [^ ]+ * [^ ]+ * RW  * 0x.*
-  * LOAD * [^ ]+ * 0x0+a0000 * 0x0+a0000 [^ ]+ * [^ ]+ * RW  * 0x.*
-  * DYNAMIC * [^ ]+ * 0x0+42000 * 0x0+42000 .*
-+ * PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
-  * NULL * .*
- 
-  *Section to Segment mapping:
-@@ -25,3 +26,4 @@ Program Headers:
-  *0*5 * \.got \.data \.bss *
-  *0*6 * \.dynamic *
-  *0*7 *
-+ *0*8 *
---- binutils-2.23/ld/testsuite/ld-mips-elf/pic-and-nonpic-5b.sd
-+++ binutils-2.23/ld/testsuite/ld-mips-elf/pic-and-nonpic-5b.sd
-@@ -1,7 +1,7 @@
- 
- Elf file type is EXEC \(Executable file\)
- Entry point 0x44000
--There are 8 program headers, starting at offset .*
-+There are [0-9] program headers, starting at offset .*
- 
- Program Headers:
-  * Type * Offset * VirtAddr * PhysAddr * FileSiz * MemSiz * Flg * Align
-@@ -13,6 +13,7 @@ Program Headers:
-  * LOAD * [^ ]+ * 0x0+80000 * 0x0+80000 [^ ]+ * [^ ]+ * RW  * 0x.*
-  * LOAD * [^ ]+ * 0x0+a0000 * 0x0+a0000 [^ ]+ * [^ ]+ * RW  * 0x.*
-  * DYNAMIC * [^ ]+ * 0x0+42000 * 0x0+42000 .*
-+ * PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
-  * NULL * .*
- 
-  *Section to Segment mapping:
-@@ -25,3 +26,4 @@ Program Headers:
-  *0*5 * \.got \.data \.bss *
-  *0*6 * \.dynamic *
-  *0*7 *
-+ *0*8 *
---- binutils-2.23/ld/testsuite/ld-mips-elf/pic-and-nonpic-6-n32.sd
-+++ binutils-2.23/ld/testsuite/ld-mips-elf/pic-and-nonpic-6-n32.sd
-@@ -1,7 +1,7 @@
- 
- Elf file type is EXEC \(Executable file\)
- Entry point 0x44000
--There are 8 program headers, starting at offset .*
-+There are [0-9] program headers, starting at offset .*
- 
- Program Headers:
-  * Type * Offset * VirtAddr * PhysAddr * FileSiz * MemSiz * Flg * Align
-@@ -13,6 +13,7 @@ Program Headers:
-  * LOAD * [^ ]+ * 0x0+80000 * 0x0+80000 [^ ]+ * [^ ]+ * RW  * 0x.*
-  * LOAD * [^ ]+ * 0x0+a0000 * 0x0+a0000 [^ ]+ * [^ ]+ * RW  * 0x.*
-  * DYNAMIC * [^ ]+ * 0x0+42000 * 0x0+42000 .*
-+ * PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
-  * NULL * .*
- 
-  *Section to Segment mapping:
-@@ -25,3 +26,4 @@ Program Headers:
-  *0*5 * \.got \.data \.bss *
-  *0*6 * \.dynamic *
-  *0*7 *
-+ *0*8 *
---- binutils-2.23/ld/testsuite/ld-mips-elf/pic-and-nonpic-6-n64.sd
-+++ binutils-2.23/ld/testsuite/ld-mips-elf/pic-and-nonpic-6-n64.sd
-@@ -1,7 +1,7 @@
- 
- Elf file type is EXEC \(Executable file\)
- Entry point 0x44000
--There are 7 program headers, starting at offset .*
-+There are [0-9] program headers, starting at offset .*
- 
- Program Headers:
-  * Type * Offset * VirtAddr * PhysAddr * FileSiz * MemSiz * Flg * Align
-@@ -12,6 +12,7 @@ Program Headers:
-  * LOAD * [^ ]+ * 0x0+80000 * 0x0+80000 [^ ]+ * [^ ]+ * RW  * 0x.*
-  * LOAD * [^ ]+ * 0x0+a0000 * 0x0+a0000 [^ ]+ * [^ ]+ * RW  * 0x.*
-  * DYNAMIC * [^ ]+ * 0x0+42000 * 0x0+42000 .*
-+ * PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
-  * NULL * .*
- 
-  *Section to Segment mapping:
-@@ -23,3 +24,4 @@ Program Headers:
-  *0*4 * \.got \.data \.bss *
-  *0*5 * \.dynamic *
-  *0*6 *
-+ *0*7 *
---- binutils-2.23/ld/testsuite/ld-mips-elf/pic-and-nonpic-6-o32.sd
-+++ binutils-2.23/ld/testsuite/ld-mips-elf/pic-and-nonpic-6-o32.sd
-@@ -1,7 +1,7 @@
- 
- Elf file type is EXEC \(Executable file\)
- Entry point 0x44000
--There are 8 program headers, starting at offset .*
-+There are [0-9] program headers, starting at offset .*
- 
- Program Headers:
-  * Type * Offset * VirtAddr * PhysAddr * FileSiz * MemSiz * Flg * Align
-@@ -13,6 +13,7 @@ Program Headers:
-  * LOAD * [^ ]+ * 0x0+80000 * 0x0+80000 [^ ]+ * [^ ]+ * RW  * 0x.*
-  * LOAD * [^ ]+ * 0x0+a0000 * 0x0+a0000 [^ ]+ * [^ ]+ * RW  * 0x.*
-  * DYNAMIC * [^ ]+ * 0x0+42000 * 0x0+42000 .*
-+ * PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
-  * NULL * .*
- 
-  *Section to Segment mapping:
-@@ -25,3 +26,4 @@ Program Headers:
-  *0*5 * \.got \.data \.bss *
-  *0*6 * \.dynamic *
-  *0*7 *
-+ *0*8 *
---- binutils-2.23/ld/testsuite/ld-mips-elf/tlsbin-o32.d
-+++ binutils-2.23/ld/testsuite/ld-mips-elf/tlsbin-o32.d
-@@ -2,42 +2,42 @@
- 
- Disassembly of section .text:
- 
--004000d0 <__start>:
--  4000d0:	3c1c0fc0 	lui	gp,0xfc0
--  4000d4:	279c7f30 	addiu	gp,gp,32560
--  4000d8:	0399e021 	addu	gp,gp,t9
--  4000dc:	27bdfff0 	addiu	sp,sp,-16
--  4000e0:	afbe0008 	sw	s8,8\(sp\)
--  4000e4:	03a0f021 	move	s8,sp
--  4000e8:	afbc0000 	sw	gp,0\(sp\)
--  4000ec:	8f998018 	lw	t9,-32744\(gp\)
--  4000f0:	27848028 	addiu	a0,gp,-32728
--  4000f4:	0320f809 	jalr	t9
--  4000f8:	00000000 	nop
--  4000fc:	8fdc0000 	lw	gp,0\(s8\)
--  400100:	00000000 	nop
--  400104:	8f998018 	lw	t9,-32744\(gp\)
--  400108:	27848020 	addiu	a0,gp,-32736
--  40010c:	0320f809 	jalr	t9
--  400110:	00000000 	nop
--  400114:	8fdc0000 	lw	gp,0\(s8\)
--  400118:	00401021 	move	v0,v0
--  40011c:	3c030000 	lui	v1,0x0
--  400120:	24638000 	addiu	v1,v1,-32768
--  400124:	00621821 	addu	v1,v1,v0
--  400128:	7c02283b 	rdhwr	v0,\$5
--  40012c:	8f83801c 	lw	v1,-32740\(gp\)
--  400130:	00000000 	nop
--  400134:	00621821 	addu	v1,v1,v0
--  400138:	7c02283b 	rdhwr	v0,\$5
--  40013c:	3c030000 	lui	v1,0x0
--  400140:	24639004 	addiu	v1,v1,-28668
--  400144:	00621821 	addu	v1,v1,v0
--  400148:	03c0e821 	move	sp,s8
--  40014c:	8fbe0008 	lw	s8,8\(sp\)
--  400150:	03e00008 	jr	ra
--  400154:	27bd0010 	addiu	sp,sp,16
-+00400[0-9a-f]{3} <__start>:
-+  400[0-9a-f]{3}:	3c1c0fc0 	lui	gp,0xfc0
-+  400[0-9a-f]{3}:	279c7f30 	addiu	gp,gp,32560
-+  400[0-9a-f]{3}:	0399e021 	addu	gp,gp,t9
-+  400[0-9a-f]{3}:	27bdfff0 	addiu	sp,sp,-16
-+  400[0-9a-f]{3}:	afbe0008 	sw	s8,8\(sp\)
-+  400[0-9a-f]{3}:	03a0f021 	move	s8,sp
-+  400[0-9a-f]{3}:	afbc0000 	sw	gp,0\(sp\)
-+  400[0-9a-f]{3}:	8f998018 	lw	t9,-32744\(gp\)
-+  400[0-9a-f]{3}:	27848028 	addiu	a0,gp,-32728
-+  400[0-9a-f]{3}:	0320f809 	jalr	t9
-+  400[0-9a-f]{3}:	00000000 	nop
-+  400[0-9a-f]{3}:	8fdc0000 	lw	gp,0\(s8\)
-+  400[0-9a-f]{3}:	00000000 	nop
-+  400[0-9a-f]{3}:	8f998018 	lw	t9,-32744\(gp\)
-+  400[0-9a-f]{3}:	27848020 	addiu	a0,gp,-32736
-+  400[0-9a-f]{3}:	0320f809 	jalr	t9
-+  400[0-9a-f]{3}:	00000000 	nop
-+  400[0-9a-f]{3}:	8fdc0000 	lw	gp,0\(s8\)
-+  400[0-9a-f]{3}:	00401021 	move	v0,v0
-+  400[0-9a-f]{3}:	3c030000 	lui	v1,0x0
-+  400[0-9a-f]{3}:	24638000 	addiu	v1,v1,-32768
-+  400[0-9a-f]{3}:	00621821 	addu	v1,v1,v0
-+  400[0-9a-f]{3}:	7c02283b 	rdhwr	v0,\$5
-+  400[0-9a-f]{3}:	8f83801c 	lw	v1,-32740\(gp\)
-+  400[0-9a-f]{3}:	00000000 	nop
-+  400[0-9a-f]{3}:	00621821 	addu	v1,v1,v0
-+  400[0-9a-f]{3}:	7c02283b 	rdhwr	v0,\$5
-+  400[0-9a-f]{3}:	3c030000 	lui	v1,0x0
-+  400[0-9a-f]{3}:	24639004 	addiu	v1,v1,-28668
-+  400[0-9a-f]{3}:	00621821 	addu	v1,v1,v0
-+  400[0-9a-f]{3}:	03c0e821 	move	sp,s8
-+  400[0-9a-f]{3}:	8fbe0008 	lw	s8,8\(sp\)
-+  400[0-9a-f]{3}:	03e00008 	jr	ra
-+  400[0-9a-f]{3}:	27bd0010 	addiu	sp,sp,16
- 
--00400158 <__tls_get_addr>:
--  400158:	03e00008 	jr	ra
--  40015c:	00000000 	nop
-+00400[0-9a-f]{3} <__tls_get_addr>:
-+  400[0-9a-f]{3}:	03e00008 	jr	ra
-+  400[0-9a-f]{3}:	00000000 	nop
---- binutils-2.23/ld/testsuite/ld-powerpc/tls.d
-+++ binutils-2.23/ld/testsuite/ld-powerpc/tls.d
-@@ -9,45 +9,45 @@
- 
- Disassembly of section \.text:
- 
--0+100000e8 <_start>:
--    100000e8:	3c 6d 00 00 	addis   r3,r13,0
--    100000ec:	60 00 00 00 	nop
--    100000f0:	38 63 90 78 	addi    r3,r3,-28552
--    100000f4:	3c 6d 00 00 	addis   r3,r13,0
--    100000f8:	60 00 00 00 	nop
--    100000fc:	38 63 10 00 	addi    r3,r3,4096
--    10000100:	3c 6d 00 00 	addis   r3,r13,0
--    10000104:	60 00 00 00 	nop
--    10000108:	38 63 90 40 	addi    r3,r3,-28608
--    1000010c:	3c 6d 00 00 	addis   r3,r13,0
--    10000110:	60 00 00 00 	nop
--    10000114:	38 63 10 00 	addi    r3,r3,4096
--    10000118:	39 23 80 48 	addi    r9,r3,-32696
--    1000011c:	3d 23 00 00 	addis   r9,r3,0
--    10000120:	81 49 80 50 	lwz     r10,-32688\(r9\)
--    10000124:	e9 22 80 10 	ld      r9,-32752\(r2\)
--    10000128:	7d 49 18 2a 	ldx     r10,r9,r3
--    1000012c:	3d 2d 00 00 	addis   r9,r13,0
--    10000130:	a1 49 90 60 	lhz     r10,-28576\(r9\)
--    10000134:	89 4d 90 68 	lbz     r10,-28568\(r13\)
--    10000138:	3d 2d 00 00 	addis   r9,r13,0
--    1000013c:	99 49 90 70 	stb     r10,-28560\(r9\)
--    10000140:	3c 6d 00 00 	addis   r3,r13,0
--    10000144:	60 00 00 00 	nop
--    10000148:	38 63 90 00 	addi    r3,r3,-28672
--    1000014c:	3c 6d 00 00 	addis   r3,r13,0
--    10000150:	60 00 00 00 	nop
--    10000154:	38 63 10 00 	addi    r3,r3,4096
--    10000158:	f9 43 80 08 	std     r10,-32760\(r3\)
--    1000015c:	3d 23 00 00 	addis   r9,r3,0
--    10000160:	91 49 80 10 	stw     r10,-32752\(r9\)
--    10000164:	e9 22 80 08 	ld      r9,-32760\(r2\)
--    10000168:	7d 49 19 2a 	stdx    r10,r9,r3
--    1000016c:	3d 2d 00 00 	addis   r9,r13,0
--    10000170:	b1 49 90 60 	sth     r10,-28576\(r9\)
--    10000174:	e9 4d 90 2a 	lwa     r10,-28632\(r13\)
--    10000178:	3d 2d 00 00 	addis   r9,r13,0
--    1000017c:	a9 49 90 30 	lha     r10,-28624\(r9\)
-+0+10000[0-9a-f]{3} <_start>:
-+    10000[0-9a-f]{3}:	3c 6d 00 00 	addis   r3,r13,0
-+    10000[0-9a-f]{3}:	60 00 00 00 	nop
-+    10000[0-9a-f]{3}:	38 63 90 78 	addi    r3,r3,-28552
-+    10000[0-9a-f]{3}:	3c 6d 00 00 	addis   r3,r13,0
-+    10000[0-9a-f]{3}:	60 00 00 00 	nop
-+    10000[0-9a-f]{3}:	38 63 10 00 	addi    r3,r3,4096
-+    10000[0-9a-f]{3}:	3c 6d 00 00 	addis   r3,r13,0
-+    10000[0-9a-f]{3}:	60 00 00 00 	nop
-+    10000[0-9a-f]{3}:	38 63 90 40 	addi    r3,r3,-28608
-+    10000[0-9a-f]{3}:	3c 6d 00 00 	addis   r3,r13,0
-+    10000[0-9a-f]{3}:	60 00 00 00 	nop
-+    10000[0-9a-f]{3}:	38 63 10 00 	addi    r3,r3,4096
-+    10000[0-9a-f]{3}:	39 23 80 48 	addi    r9,r3,-32696
-+    10000[0-9a-f]{3}:	3d 23 00 00 	addis   r9,r3,0
-+    10000[0-9a-f]{3}:	81 49 80 50 	lwz     r10,-32688\(r9\)
-+    10000[0-9a-f]{3}:	e9 22 80 10 	ld      r9,-32752\(r2\)
-+    10000[0-9a-f]{3}:	7d 49 18 2a 	ldx     r10,r9,r3
-+    10000[0-9a-f]{3}:	3d 2d 00 00 	addis   r9,r13,0
-+    10000[0-9a-f]{3}:	a1 49 90 60 	lhz     r10,-28576\(r9\)
-+    10000[0-9a-f]{3}:	89 4d 90 68 	lbz     r10,-28568\(r13\)
-+    10000[0-9a-f]{3}:	3d 2d 00 00 	addis   r9,r13,0
-+    10000[0-9a-f]{3}:	99 49 90 70 	stb     r10,-28560\(r9\)
-+    10000[0-9a-f]{3}:	3c 6d 00 00 	addis   r3,r13,0
-+    10000[0-9a-f]{3}:	60 00 00 00 	nop
-+    10000[0-9a-f]{3}:	38 63 90 00 	addi    r3,r3,-28672
-+    10000[0-9a-f]{3}:	3c 6d 00 00 	addis   r3,r13,0
-+    10000[0-9a-f]{3}:	60 00 00 00 	nop
-+    10000[0-9a-f]{3}:	38 63 10 00 	addi    r3,r3,4096
-+    10000[0-9a-f]{3}:	f9 43 80 08 	std     r10,-32760\(r3\)
-+    10000[0-9a-f]{3}:	3d 23 00 00 	addis   r9,r3,0
-+    10000[0-9a-f]{3}:	91 49 80 10 	stw     r10,-32752\(r9\)
-+    10000[0-9a-f]{3}:	e9 22 80 08 	ld      r9,-32760\(r2\)
-+    10000[0-9a-f]{3}:	7d 49 19 2a 	stdx    r10,r9,r3
-+    10000[0-9a-f]{3}:	3d 2d 00 00 	addis   r9,r13,0
-+    10000[0-9a-f]{3}:	b1 49 90 60 	sth     r10,-28576\(r9\)
-+    10000[0-9a-f]{3}:	e9 4d 90 2a 	lwa     r10,-28632\(r13\)
-+    10000[0-9a-f]{3}:	3d 2d 00 00 	addis   r9,r13,0
-+    10000[0-9a-f]{3}:	a9 49 90 30 	lha     r10,-28624\(r9\)
- 
--0+10000180 <\.__tls_get_addr>:
--    10000180:	4e 80 00 20 	blr
-+0+10000[0-9a-f]{3} <\.__tls_get_addr>:
-+    10000[0-9a-f]{3}:	4e 80 00 20 	blr
---- binutils-2.23/ld/testsuite/ld-powerpc/tls.g
-+++ binutils-2.23/ld/testsuite/ld-powerpc/tls.g
-@@ -8,5 +8,5 @@
- .*: +file format elf64-powerpc
- 
- Contents of section \.got:
-- 100101e0 00000000 100181e0 ffffffff ffff8018  .*
-- 100101f0 ffffffff ffff8058                    .*
-+ 10010([0-9a-f]{3}) 00000000 10018\1 ffffffff ffff8018  .*
-+ 10010[0-9a-f]{3} ffffffff ffff8058                    .*
---- binutils-2.23/ld/testsuite/ld-powerpc/tls32.d
-+++ binutils-2.23/ld/testsuite/ld-powerpc/tls32.d
-@@ -9,42 +9,42 @@
- 
- Disassembly of section \.text:
- 
--0+1800094 <_start>:
-- 1800094:	3c 62 00 00 	addis   r3,r2,0
-- 1800098:	38 63 90 3c 	addi    r3,r3,-28612
-- 180009c:	3c 62 00 00 	addis   r3,r2,0
-- 18000a0:	38 63 10 00 	addi    r3,r3,4096
-- 18000a4:	3c 62 00 00 	addis   r3,r2,0
-- 18000a8:	38 63 90 20 	addi    r3,r3,-28640
-- 18000ac:	3c 62 00 00 	addis   r3,r2,0
-- 18000b0:	38 63 10 00 	addi    r3,r3,4096
-- 18000b4:	39 23 80 24 	addi    r9,r3,-32732
-- 18000b8:	3d 23 00 00 	addis   r9,r3,0
-- 18000bc:	81 49 80 28 	lwz     r10,-32728\(r9\)
-- 18000c0:	3d 22 00 00 	addis   r9,r2,0
-- 18000c4:	a1 49 90 30 	lhz     r10,-28624\(r9\)
-- 18000c8:	89 42 90 34 	lbz     r10,-28620\(r2\)
-- 18000cc:	3d 22 00 00 	addis   r9,r2,0
-- 18000d0:	99 49 90 38 	stb     r10,-28616\(r9\)
-- 18000d4:	3c 62 00 00 	addis   r3,r2,0
-- 18000d8:	38 63 90 00 	addi    r3,r3,-28672
-- 18000dc:	3c 62 00 00 	addis   r3,r2,0
-- 18000e0:	38 63 10 00 	addi    r3,r3,4096
-- 18000e4:	91 43 80 04 	stw     r10,-32764\(r3\)
-- 18000e8:	3d 23 00 00 	addis   r9,r3,0
-- 18000ec:	91 49 80 08 	stw     r10,-32760\(r9\)
-- 18000f0:	3d 22 00 00 	addis   r9,r2,0
-- 18000f4:	b1 49 90 30 	sth     r10,-28624\(r9\)
-- 18000f8:	a1 42 90 14 	lhz     r10,-28652\(r2\)
-- 18000fc:	3d 22 00 00 	addis   r9,r2,0
-- 1800100:	a9 49 90 18 	lha     r10,-28648\(r9\)
-+0+1800[0-9a-f]{3} <_start>:
-+ 1800[0-9a-f]{3}:	3c 62 00 00 	addis   r3,r2,0
-+ 1800[0-9a-f]{3}:	38 63 90 3c 	addi    r3,r3,-28612
-+ 1800[0-9a-f]{3}:	3c 62 00 00 	addis   r3,r2,0
-+ 1800[0-9a-f]{3}:	38 63 10 00 	addi    r3,r3,4096
-+ 1800[0-9a-f]{3}:	3c 62 00 00 	addis   r3,r2,0
-+ 1800[0-9a-f]{3}:	38 63 90 20 	addi    r3,r3,-28640
-+ 1800[0-9a-f]{3}:	3c 62 00 00 	addis   r3,r2,0
-+ 1800[0-9a-f]{3}:	38 63 10 00 	addi    r3,r3,4096
-+ 1800[0-9a-f]{3}:	39 23 80 24 	addi    r9,r3,-32732
-+ 1800[0-9a-f]{3}:	3d 23 00 00 	addis   r9,r3,0
-+ 1800[0-9a-f]{3}:	81 49 80 28 	lwz     r10,-32728\(r9\)
-+ 1800[0-9a-f]{3}:	3d 22 00 00 	addis   r9,r2,0
-+ 1800[0-9a-f]{3}:	a1 49 90 30 	lhz     r10,-28624\(r9\)
-+ 1800[0-9a-f]{3}:	89 42 90 34 	lbz     r10,-28620\(r2\)
-+ 1800[0-9a-f]{3}:	3d 22 00 00 	addis   r9,r2,0
-+ 1800[0-9a-f]{3}:	99 49 90 38 	stb     r10,-28616\(r9\)
-+ 1800[0-9a-f]{3}:	3c 62 00 00 	addis   r3,r2,0
-+ 1800[0-9a-f]{3}:	38 63 90 00 	addi    r3,r3,-28672
-+ 1800[0-9a-f]{3}:	3c 62 00 00 	addis   r3,r2,0
-+ 1800[0-9a-f]{3}:	38 63 10 00 	addi    r3,r3,4096
-+ 1800[0-9a-f]{3}:	91 43 80 04 	stw     r10,-32764\(r3\)
-+ 1800[0-9a-f]{3}:	3d 23 00 00 	addis   r9,r3,0
-+ 1800[0-9a-f]{3}:	91 49 80 08 	stw     r10,-32760\(r9\)
-+ 1800[0-9a-f]{3}:	3d 22 00 00 	addis   r9,r2,0
-+ 1800[0-9a-f]{3}:	b1 49 90 30 	sth     r10,-28624\(r9\)
-+ 1800[0-9a-f]{3}:	a1 42 90 14 	lhz     r10,-28652\(r2\)
-+ 1800[0-9a-f]{3}:	3d 22 00 00 	addis   r9,r2,0
-+ 1800[0-9a-f]{3}:	a9 49 90 18 	lha     r10,-28648\(r9\)
- 
--0+1800104 <__tls_get_addr>:
-- 1800104:	4e 80 00 20 	blr
-+0+1800[0-9a-f]{3} <__tls_get_addr>:
-+ 1800[0-9a-f]{3}:	4e 80 00 20 	blr
- Disassembly of section \.got:
- 
--0+1810128 <_GLOBAL_OFFSET_TABLE_-0x4>:
-- 1810128:	4e 80 00 21 	blrl
-+0+1810[0-9a-f]{3} <_GLOBAL_OFFSET_TABLE_-0x4>:
-+ 1810[0-9a-f]{3}:	4e 80 00 21 	blrl
- 
--0+181012c <_GLOBAL_OFFSET_TABLE_>:
-+0+1810[0-9a-f]{3} <_GLOBAL_OFFSET_TABLE_>:
- 	\.\.\.
---- binutils-2.23/ld/testsuite/ld-powerpc/tls32.g
-+++ binutils-2.23/ld/testsuite/ld-powerpc/tls32.g
-@@ -8,4 +8,4 @@
- .*: +file format elf32-powerpc
- 
- Contents of section \.got:
-- 1810128 4e800021 00000000 00000000 00000000  .*
-+ 18101[0-9a-f]{2} 4e800021 00000000 00000000 00000000  .*
---- binutils-2.23/ld/testsuite/ld-powerpc/tls32.t
-+++ binutils-2.23/ld/testsuite/ld-powerpc/tls32.t
-@@ -8,5 +8,5 @@
- .*: +file format elf32-powerpc
- 
- Contents of section \.tdata:
-- 1810108 12345678 23456789 3456789a 456789ab  .*
-- 1810118 56789abc 6789abcd 789abcde 00c0ffee  .*
-+ 18101[0-9a-f]{2} 12345678 23456789 3456789a 456789ab  .*
-+ 18101[0-9a-f]{2} 56789abc 6789abcd 789abcde 00c0ffee  .*
---- binutils-2.23/ld/testsuite/ld-powerpc/tlsexe32.d
-+++ binutils-2.23/ld/testsuite/ld-powerpc/tlsexe32.d
-@@ -44,4 +44,4 @@ Disassembly of section \.got:
- .*:	4e 80 00 21 	blrl
- 
- .* <_GLOBAL_OFFSET_TABLE_>:
--.*:	01 81 02 b8 00 00 00 00 00 00 00 00  .*
-+.*:	01 81 02 [bd]8 00 00 00 00 00 00 00 00  .*
---- binutils-2.23/ld/testsuite/ld-powerpc/tlsexe32.g
-+++ binutils-2.23/ld/testsuite/ld-powerpc/tlsexe32.g
-@@ -8,4 +8,4 @@
- 
- Contents of section \.got:
- .* 00000000 00000000 00000000 4e800021  .*
--.* 018102b8 00000000 00000000           .*
-+.* 018102[bd]8 00000000 00000000           .*
---- binutils-2.23/ld/testsuite/ld-powerpc/tlsexe32.r
-+++ binutils-2.23/ld/testsuite/ld-powerpc/tlsexe32.r
-@@ -33,13 +33,14 @@ There are [0-9]+ program headers, starting at offset [0-9]+
- 
- Program Headers:
-  +Type +Offset +VirtAddr +PhysAddr +FileSiz MemSiz +Flg Align
-- +PHDR +0x000034 0x01800034 0x01800034 0x000c0 0x000c0 R E 0x4
-- +INTERP +0x0000f4 0x018000f4 0x018000f4 0x00011 0x00011 R +0x1
-+ +PHDR +0x000034 0x01800034 0x01800034 (0x000[0-9a-f]{2}) \1 R E 0x4
-+ +INTERP +0x000([0-9a-f]{3}) 0x01800\1 0x01800\1 0x00011 0x00011 R +0x1
-  +\[Requesting program interpreter: .*\]
-  +LOAD .* R E 0x10000
-  +LOAD .* RWE 0x10000
-  +DYNAMIC .* RW +0x4
-  +TLS .* 0x0001c 0x00038 R +0x4
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- 
-  Section to Segment mapping:
-  +Segment Sections\.\.\.
-@@ -49,6 +50,7 @@ Program Headers:
-  +03 +\.tdata \.dynamic \.got \.plt 
-  +04 +\.dynamic 
-  +05 +\.tdata \.tbss 
-+ +06 +
- 
- Relocation section '\.rela\.dyn' at offset .* contains 2 entries:
-  Offset +Info +Type +Sym\. Value +Symbol's Name \+ Addend
---- binutils-2.23/ld/testsuite/ld-powerpc/tlsmark.d
-+++ binutils-2.23/ld/testsuite/ld-powerpc/tlsmark.d
-@@ -9,29 +9,29 @@
- 
- Disassembly of section \.text:
- 
--0+100000e8 <_start>:
--    100000e8:	48 00 00 18 	b       10000100 <_start\+0x18>
--    100000ec:	60 00 00 00 	nop
--    100000f0:	38 63 90 00 	addi    r3,r3,-28672
--    100000f4:	e8 83 00 00 	ld      r4,0\(r3\)
--    100000f8:	3c 6d 00 00 	addis   r3,r13,0
--    100000fc:	48 00 00 0c 	b       10000108 <_start\+0x20>
--    10000100:	3c 6d 00 00 	addis   r3,r13,0
--    10000104:	4b ff ff e8 	b       100000ec <_start\+0x4>
--    10000108:	60 00 00 00 	nop
--    1000010c:	38 63 10 00 	addi    r3,r3,4096
--    10000110:	e8 83 80 00 	ld      r4,-32768\(r3\)
--    10000114:	3c 6d 00 00 	addis   r3,r13,0
--    10000118:	48 00 00 0c 	b       10000124 <_start\+0x3c>
--    1000011c:	3c 6d 00 00 	addis   r3,r13,0
--    10000120:	48 00 00 14 	b       10000134 <_start\+0x4c>
--    10000124:	60 00 00 00 	nop
--    10000128:	38 63 90 04 	addi    r3,r3,-28668
--    1000012c:	e8 a3 00 00 	ld      r5,0\(r3\)
--    10000130:	4b ff ff ec 	b       1000011c <_start\+0x34>
--    10000134:	60 00 00 00 	nop
--    10000138:	38 63 10 00 	addi    r3,r3,4096
--    1000013c:	e8 a3 80 04 	ld      r5,-32764\(r3\)
-+0+10000[0-9a-f]{3} <_start>:
-+    10000[0-9a-f]{3}:	48 00 00 18 	b       10000[0-9a-f]{3} <_start\+0x18>
-+    10000[0-9a-f]{3}:	60 00 00 00 	nop
-+    10000[0-9a-f]{3}:	38 63 90 00 	addi    r3,r3,-28672
-+    10000[0-9a-f]{3}:	e8 83 00 00 	ld      r4,0\(r3\)
-+    10000[0-9a-f]{3}:	3c 6d 00 00 	addis   r3,r13,0
-+    10000[0-9a-f]{3}:	48 00 00 0c 	b       10000[0-9a-f]{3} <_start\+0x20>
-+    10000[0-9a-f]{3}:	3c 6d 00 00 	addis   r3,r13,0
-+    10000[0-9a-f]{3}:	4b ff ff e8 	b       10000[0-9a-f]{3} <_start\+0x4>
-+    10000[0-9a-f]{3}:	60 00 00 00 	nop
-+    10000[0-9a-f]{3}:	38 63 10 00 	addi    r3,r3,4096
-+    10000[0-9a-f]{3}:	e8 83 80 00 	ld      r4,-32768\(r3\)
-+    10000[0-9a-f]{3}:	3c 6d 00 00 	addis   r3,r13,0
-+    10000[0-9a-f]{3}:	48 00 00 0c 	b       10000[0-9a-f]{3} <_start\+0x3c>
-+    10000[0-9a-f]{3}:	3c 6d 00 00 	addis   r3,r13,0
-+    10000[0-9a-f]{3}:	48 00 00 14 	b       10000[0-9a-f]{3} <_start\+0x4c>
-+    10000[0-9a-f]{3}:	60 00 00 00 	nop
-+    10000[0-9a-f]{3}:	38 63 90 04 	addi    r3,r3,-28668
-+    10000[0-9a-f]{3}:	e8 a3 00 00 	ld      r5,0\(r3\)
-+    10000[0-9a-f]{3}:	4b ff ff ec 	b       10000[0-9a-f]{3} <_start\+0x34>
-+    10000[0-9a-f]{3}:	60 00 00 00 	nop
-+    10000[0-9a-f]{3}:	38 63 10 00 	addi    r3,r3,4096
-+    10000[0-9a-f]{3}:	e8 a3 80 04 	ld      r5,-32764\(r3\)
- 
--0+10000140 <\.__tls_get_addr>:
--    10000140:	4e 80 00 20 	blr
-+0+10000[0-9a-f]{3} <\.__tls_get_addr>:
-+    10000[0-9a-f]{3}:	4e 80 00 20 	blr
---- binutils-2.23/ld/testsuite/ld-powerpc/tlsmark32.d
-+++ binutils-2.23/ld/testsuite/ld-powerpc/tlsmark32.d
-@@ -9,17 +9,17 @@
- 
- Disassembly of section \.text:
- 
--0+1800094 <_start>:
-- 1800094:	48 00 00 14 	b       18000a8 <_start\+0x14>
-- 1800098:	38 63 90 00 	addi    r3,r3,-28672
-- 180009c:	80 83 00 00 	lwz     r4,0\(r3\)
-- 18000a0:	3c 62 00 00 	addis   r3,r2,0
-- 18000a4:	48 00 00 0c 	b       18000b0 <_start\+0x1c>
-- 18000a8:	3c 62 00 00 	addis   r3,r2,0
-- 18000ac:	4b ff ff ec 	b       1800098 <_start\+0x4>
-- 18000b0:	38 63 10 00 	addi    r3,r3,4096
-- 18000b4:	80 83 80 00 	lwz     r4,-32768\(r3\)
-+0+18000[0-9a-f]{2} <_start>:
-+ 18000[0-9a-f]{2}:	48 00 00 14 	b       18000[0-9a-f]{2} <_start\+0x14>
-+ 18000[0-9a-f]{2}:	38 63 90 00 	addi    r3,r3,-28672
-+ 18000[0-9a-f]{2}:	80 83 00 00 	lwz     r4,0\(r3\)
-+ 18000[0-9a-f]{2}:	3c 62 00 00 	addis   r3,r2,0
-+ 18000[0-9a-f]{2}:	48 00 00 0c 	b       18000[0-9a-f]{2} <_start\+0x1c>
-+ 18000[0-9a-f]{2}:	3c 62 00 00 	addis   r3,r2,0
-+ 18000[0-9a-f]{2}:	4b ff ff ec 	b       18000[0-9a-f]{2} <_start\+0x4>
-+ 18000[0-9a-f]{2}:	38 63 10 00 	addi    r3,r3,4096
-+ 18000[0-9a-f]{2}:	80 83 80 00 	lwz     r4,-32768\(r3\)
- 
--0+18000b8 <__tls_get_addr>:
-- 18000b8:	4e 80 00 20 	blr
--#pass
-\ No newline at end of file
-+0+18000[0-9a-f]{2} <__tls_get_addr>:
-+ 18000[0-9a-f]{2}:	4e 80 00 20 	blr
-+#pass
---- binutils-2.23/ld/testsuite/ld-powerpc/tlsopt1.d
-+++ binutils-2.23/ld/testsuite/ld-powerpc/tlsopt1.d
-@@ -9,17 +9,17 @@
- 
- Disassembly of section \.text:
- 
--0+100000e8 <\.__tls_get_addr>:
--    100000e8:	4e 80 00 20 	blr
-+0+10000[0-9a-f]{3} <\.__tls_get_addr>:
-+    10000[0-9a-f]{3}:	4e 80 00 20 	blr
- 
- Disassembly of section \.no_opt1:
- 
--0+100000ec <\.no_opt1>:
--    100000ec:	38 62 80 08 	addi    r3,r2,-32760
--    100000f0:	2c 24 00 00 	cmpdi   r4,0
--    100000f4:	41 82 00 10 	beq-    .*
--    100000f8:	4b ff ff f1 	bl      100000e8 <\.__tls_get_addr>
--    100000fc:	60 00 00 00 	nop
--    10000100:	48 00 00 0c 	b       .*
--    10000104:	4b ff ff e5 	bl      100000e8 <\.__tls_get_addr>
--    10000108:	60 00 00 00 	nop
-+0+10000[0-9a-f]{3} <\.no_opt1>:
-+    10000[0-9a-f]{3}:	38 62 80 08 	addi    r3,r2,-32760
-+    10000[0-9a-f]{3}:	2c 24 00 00 	cmpdi   r4,0
-+    10000[0-9a-f]{3}:	41 82 00 10 	beq-    .*
-+    10000[0-9a-f]{3}:	4b ff ff f1 	bl      10000[0-9a-f]{3} <\.__tls_get_addr>
-+    10000[0-9a-f]{3}:	60 00 00 00 	nop
-+    10000[0-9a-f]{3}:	48 00 00 0c 	b       .*
-+    10000[0-9a-f]{3}:	4b ff ff e5 	bl      10000[0-9a-f]{3} <\.__tls_get_addr>
-+    10000[0-9a-f]{3}:	60 00 00 00 	nop
---- binutils-2.23/ld/testsuite/ld-powerpc/tlsopt1_32.d
-+++ binutils-2.23/ld/testsuite/ld-powerpc/tlsopt1_32.d
-@@ -9,16 +9,16 @@
- 
- Disassembly of section \.text:
- 
--0+1800094 <__tls_get_addr>:
-- 1800094:	4e 80 00 20 	blr
-+0+18000[0-9a-f]{2} <__tls_get_addr>:
-+ 18000[0-9a-f]{2}:	4e 80 00 20 	blr
- 
- Disassembly of section \.no_opt1:
- 
--0+1800098 <\.no_opt1>:
-- 1800098:	38 6d ff f4 	addi    r3,r13,-12
-- 180009c:	2c 04 00 00 	cmpwi   r4,0
-- 18000a0:	41 82 00 0c 	beq-    .*
-- 18000a4:	4b ff ff f1 	bl      1800094 <__tls_get_addr>
-- 18000a8:	48 00 00 08 	b       .*
-- 18000ac:	4b ff ff e9 	bl      1800094 <__tls_get_addr>
-+0+18000[0-9a-f]{2} <\.no_opt1>:
-+ 18000[0-9a-f]{2}:	38 6d ff f4 	addi    r3,r13,-12
-+ 18000[0-9a-f]{2}:	2c 04 00 00 	cmpwi   r4,0
-+ 18000[0-9a-f]{2}:	41 82 00 0c 	beq-    .*
-+ 18000[0-9a-f]{2}:	4b ff ff f1 	bl      18000[0-9a-f]{2} <__tls_get_addr>
-+ 18000[0-9a-f]{2}:	48 00 00 08 	b       .*
-+ 18000[0-9a-f]{2}:	4b ff ff e9 	bl      18000[0-9a-f]{2} <__tls_get_addr>
- #pass
---- binutils-2.23/ld/testsuite/ld-powerpc/tlsopt2.d
-+++ binutils-2.23/ld/testsuite/ld-powerpc/tlsopt2.d
-@@ -9,15 +9,15 @@
- 
- Disassembly of section \.text:
- 
--0+100000e8 <\.__tls_get_addr>:
--    100000e8:	4e 80 00 20 	blr
-+0+10000[0-9a-f]{3} <\.__tls_get_addr>:
-+    10000[0-9a-f]{3}:	4e 80 00 20 	blr
- 
- Disassembly of section \.no_opt2:
- 
--0+100000ec <\.no_opt2>:
--    100000ec:	38 62 80 08 	addi    r3,r2,-32760
--    100000f0:	2c 24 00 00 	cmpdi   r4,0
--    100000f4:	41 82 00 08 	beq-    .*
--    100000f8:	38 62 80 08 	addi    r3,r2,-32760
--    100000fc:	4b ff ff ed 	bl      100000e8 <\.__tls_get_addr>
--    10000100:	60 00 00 00 	nop
-+0+10000[0-9a-f]{3} <\.no_opt2>:
-+    10000[0-9a-f]{3}:	38 62 80 08 	addi    r3,r2,-32760
-+    10000[0-9a-f]{3}:	2c 24 00 00 	cmpdi   r4,0
-+    10000[0-9a-f]{3}:	41 82 00 08 	beq-    .*
-+    10000[0-9a-f]{3}:	38 62 80 08 	addi    r3,r2,-32760
-+    10000[0-9a-f]{3}:	4b ff ff ed 	bl      10000[0-9a-f]{3} <\.__tls_get_addr>
-+    10000[0-9a-f]{3}:	60 00 00 00 	nop
---- binutils-2.23/ld/testsuite/ld-powerpc/tlsopt2_32.d
-+++ binutils-2.23/ld/testsuite/ld-powerpc/tlsopt2_32.d
-@@ -9,15 +9,15 @@
- 
- Disassembly of section \.text:
- 
--0+1800094 <__tls_get_addr>:
-- 1800094:	4e 80 00 20 	blr
-+0+18000[0-9a-f]{2} <__tls_get_addr>:
-+ 18000[0-9a-f]{2}:	4e 80 00 20 	blr
- 
- Disassembly of section \.no_opt2:
- 
--0+1800098 <\.no_opt2>:
-- 1800098:	38 6d ff f4 	addi    r3,r13,-12
-- 180009c:	2c 04 00 00 	cmpwi   r4,0
-- 18000a0:	41 82 00 08 	beq-    .*
-- 18000a4:	38 6d ff f4 	addi    r3,r13,-12
-- 18000a8:	4b ff ff ed 	bl      1800094 <__tls_get_addr>
-+0+18000[0-9a-f]{2} <\.no_opt2>:
-+ 18000[0-9a-f]{2}:	38 6d ff f4 	addi    r3,r13,-12
-+ 18000[0-9a-f]{2}:	2c 04 00 00 	cmpwi   r4,0
-+ 18000[0-9a-f]{2}:	41 82 00 08 	beq-    .*
-+ 18000[0-9a-f]{2}:	38 6d ff f4 	addi    r3,r13,-12
-+ 18000[0-9a-f]{2}:	4b ff ff ed 	bl      18000[0-9a-f]{2} <__tls_get_addr>
- #pass
---- binutils-2.23/ld/testsuite/ld-powerpc/tlsopt3.d
-+++ binutils-2.23/ld/testsuite/ld-powerpc/tlsopt3.d
-@@ -9,18 +9,18 @@
- 
- Disassembly of section \.text:
- 
--00000000100000e8 <\.__tls_get_addr>:
--    100000e8:	4e 80 00 20 	blr
-+0000000010000[0-9a-f]{3} <\.__tls_get_addr>:
-+    10000[0-9a-f]{3}:	4e 80 00 20 	blr
- 
- Disassembly of section \.no_opt3:
- 
--00000000100000ec <\.no_opt3>:
--    100000ec:	38 62 80 08 	addi    r3,r2,-32760
--    100000f0:	48 00 00 0c 	b       .*
--    100000f4:	38 62 80 18 	addi    r3,r2,-32744
--    100000f8:	48 00 00 10 	b       .*
--    100000fc:	4b ff ff ed 	bl      100000e8 <\.__tls_get_addr>
--    10000100:	60 00 00 00 	nop
--    10000104:	48 00 00 0c 	b       .*
--    10000108:	4b ff ff e1 	bl      100000e8 <\.__tls_get_addr>
--    1000010c:	60 00 00 00 	nop
-+0000000010000[0-9a-f]{3} <\.no_opt3>:
-+    10000[0-9a-f]{3}:	38 62 80 08 	addi    r3,r2,-32760
-+    10000[0-9a-f]{3}:	48 00 00 0c 	b       .*
-+    10000[0-9a-f]{3}:	38 62 80 18 	addi    r3,r2,-32744
-+    10000[0-9a-f]{3}:	48 00 00 10 	b       .*
-+    10000[0-9a-f]{3}:	4b ff ff ed 	bl      10000[0-9a-f]{3} <\.__tls_get_addr>
-+    10000[0-9a-f]{3}:	60 00 00 00 	nop
-+    10000[0-9a-f]{3}:	48 00 00 0c 	b       .*
-+    10000[0-9a-f]{3}:	4b ff ff e1 	bl      10000[0-9a-f]{3} <\.__tls_get_addr>
-+    10000[0-9a-f]{3}:	60 00 00 00 	nop
---- binutils-2.23/ld/testsuite/ld-powerpc/tlsopt3_32.d
-+++ binutils-2.23/ld/testsuite/ld-powerpc/tlsopt3_32.d
-@@ -9,17 +9,17 @@
- 
- Disassembly of section \.text:
- 
--0+1800094 <__tls_get_addr>:
-- 1800094:	4e 80 00 20 	blr
-+0+18000[0-9a-f]{2} <__tls_get_addr>:
-+ 18000[0-9a-f]{2}:	4e 80 00 20 	blr
- 
- Disassembly of section \.no_opt3:
- 
--0+1800098 <\.no_opt3>:
-- 1800098:	38 6d ff ec 	addi    r3,r13,-20
-- 180009c:	48 00 00 0c 	b       .*
-- 18000a0:	38 6d ff f4 	addi    r3,r13,-12
-- 18000a4:	48 00 00 0c 	b       .*
-- 18000a8:	4b ff ff ed 	bl      1800094 <__tls_get_addr>
-- 18000ac:	48 00 00 08 	b       .*
-- 18000b0:	4b ff ff e5 	bl      1800094 <__tls_get_addr>
-+0+18000[0-9a-f]{2} <\.no_opt3>:
-+ 18000[0-9a-f]{2}:	38 6d ff ec 	addi    r3,r13,-20
-+ 18000[0-9a-f]{2}:	48 00 00 0c 	b       .*
-+ 18000[0-9a-f]{2}:	38 6d ff f4 	addi    r3,r13,-12
-+ 18000[0-9a-f]{2}:	48 00 00 0c 	b       .*
-+ 18000[0-9a-f]{2}:	4b ff ff ed 	bl      18000[0-9a-f]{2} <__tls_get_addr>
-+ 18000[0-9a-f]{2}:	48 00 00 08 	b       .*
-+ 18000[0-9a-f]{2}:	4b ff ff e5 	bl      18000[0-9a-f]{2} <__tls_get_addr>
- #pass
---- binutils-2.23/ld/testsuite/ld-powerpc/tlsopt4.d
-+++ binutils-2.23/ld/testsuite/ld-powerpc/tlsopt4.d
-@@ -9,40 +9,40 @@
- 
- Disassembly of section \.text:
- 
--0+100000e8 <\.__tls_get_addr>:
--    100000e8:	4e 80 00 20 	blr
-+0+10000[0-9a-f]{3} <\.__tls_get_addr>:
-+    10000[0-9a-f]{3}:	4e 80 00 20 	blr
- 
- Disassembly of section \.opt1:
- 
--0+100000ec <\.opt1>:
--    100000ec:	3c 6d 00 00 	addis   r3,r13,0
--    100000f0:	2c 24 00 00 	cmpdi   r4,0
--    100000f4:	41 82 00 10 	beq-    .*
--    100000f8:	60 00 00 00 	nop
--    100000fc:	38 63 90 10 	addi    r3,r3,-28656
--    10000100:	48 00 00 0c 	b       .*
--    10000104:	60 00 00 00 	nop
--    10000108:	38 63 90 10 	addi    r3,r3,-28656
-+0+10000[0-9a-f]{3} <\.opt1>:
-+    10000[0-9a-f]{3}:	3c 6d 00 00 	addis   r3,r13,0
-+    10000[0-9a-f]{3}:	2c 24 00 00 	cmpdi   r4,0
-+    10000[0-9a-f]{3}:	41 82 00 10 	beq-    .*
-+    10000[0-9a-f]{3}:	60 00 00 00 	nop
-+    10000[0-9a-f]{3}:	38 63 90 10 	addi    r3,r3,-28656
-+    10000[0-9a-f]{3}:	48 00 00 0c 	b       .*
-+    10000[0-9a-f]{3}:	60 00 00 00 	nop
-+    10000[0-9a-f]{3}:	38 63 90 10 	addi    r3,r3,-28656
- 
- Disassembly of section \.opt2:
- 
--0+1000010c <\.opt2>:
--    1000010c:	3c 6d 00 00 	addis   r3,r13,0
--    10000110:	2c 24 00 00 	cmpdi   r4,0
--    10000114:	41 82 00 08 	beq-    .*
--    10000118:	3c 6d 00 00 	addis   r3,r13,0
--    1000011c:	60 00 00 00 	nop
--    10000120:	38 63 90 10 	addi    r3,r3,-28656
-+0+10000[0-9a-f]{3} <\.opt2>:
-+    10000[0-9a-f]{3}:	3c 6d 00 00 	addis   r3,r13,0
-+    10000[0-9a-f]{3}:	2c 24 00 00 	cmpdi   r4,0
-+    10000[0-9a-f]{3}:	41 82 00 08 	beq-    .*
-+    10000[0-9a-f]{3}:	3c 6d 00 00 	addis   r3,r13,0
-+    10000[0-9a-f]{3}:	60 00 00 00 	nop
-+    10000[0-9a-f]{3}:	38 63 90 10 	addi    r3,r3,-28656
- 
- Disassembly of section \.opt3:
- 
--0+10000124 <\.opt3>:
--    10000124:	3c 6d 00 00 	addis   r3,r13,0
--    10000128:	48 00 00 0c 	b       .*
--    1000012c:	3c 6d 00 00 	addis   r3,r13,0
--    10000130:	48 00 00 10 	b       .*
--    10000134:	60 00 00 00 	nop
--    10000138:	38 63 90 10 	addi    r3,r3,-28656
--    1000013c:	48 00 00 0c 	b       .*
--    10000140:	60 00 00 00 	nop
--    10000144:	38 63 90 08 	addi    r3,r3,-28664
-+0+10000[0-9a-f]{3} <\.opt3>:
-+    10000[0-9a-f]{3}:	3c 6d 00 00 	addis   r3,r13,0
-+    10000[0-9a-f]{3}:	48 00 00 0c 	b       .*
-+    10000[0-9a-f]{3}:	3c 6d 00 00 	addis   r3,r13,0
-+    10000[0-9a-f]{3}:	48 00 00 10 	b       .*
-+    10000[0-9a-f]{3}:	60 00 00 00 	nop
-+    10000[0-9a-f]{3}:	38 63 90 10 	addi    r3,r3,-28656
-+    10000[0-9a-f]{3}:	48 00 00 0c 	b       .*
-+    10000[0-9a-f]{3}:	60 00 00 00 	nop
-+    10000[0-9a-f]{3}:	38 63 90 08 	addi    r3,r3,-28664
---- binutils-2.23/ld/testsuite/ld-powerpc/tlsopt4_32.d
-+++ binutils-2.23/ld/testsuite/ld-powerpc/tlsopt4_32.d
-@@ -9,36 +9,36 @@
- 
- Disassembly of section \.text:
- 
--0+1800094 <__tls_get_addr>:
-- 1800094:	4e 80 00 20 	blr
-+0+18000[0-9a-f]{2} <__tls_get_addr>:
-+ 18000[0-9a-f]{2}:	4e 80 00 20 	blr
- 
- Disassembly of section \.opt1:
- 
--0+1800098 <\.opt1>:
-- 1800098:	3c 62 00 00 	addis   r3,r2,0
-- 180009c:	2c 04 00 00 	cmpwi   r4,0
-- 18000a0:	41 82 00 0c 	beq-    .*
-- 18000a4:	38 63 90 10 	addi    r3,r3,-28656
-- 18000a8:	48 00 00 08 	b       .*
-- 18000ac:	38 63 90 10 	addi    r3,r3,-28656
-+0+18000[0-9a-f]{2} <\.opt1>:
-+ 18000[0-9a-f]{2}:	3c 62 00 00 	addis   r3,r2,0
-+ 18000[0-9a-f]{2}:	2c 04 00 00 	cmpwi   r4,0
-+ 18000[0-9a-f]{2}:	41 82 00 0c 	beq-    .*
-+ 18000[0-9a-f]{2}:	38 63 90 10 	addi    r3,r3,-28656
-+ 18000[0-9a-f]{2}:	48 00 00 08 	b       .*
-+ 18000[0-9a-f]{2}:	38 63 90 10 	addi    r3,r3,-28656
- 
- Disassembly of section \.opt2:
- 
--0+18000b0 <\.opt2>:
-- 18000b0:	3c 62 00 00 	addis   r3,r2,0
-- 18000b4:	2c 04 00 00 	cmpwi   r4,0
-- 18000b8:	41 82 00 08 	beq-    .*
-- 18000bc:	3c 62 00 00 	addis   r3,r2,0
-- 18000c0:	38 63 90 10 	addi    r3,r3,-28656
-+0+18000[0-9a-f]{2} <\.opt2>:
-+ 18000[0-9a-f]{2}:	3c 62 00 00 	addis   r3,r2,0
-+ 18000[0-9a-f]{2}:	2c 04 00 00 	cmpwi   r4,0
-+ 18000[0-9a-f]{2}:	41 82 00 08 	beq-    .*
-+ 18000[0-9a-f]{2}:	3c 62 00 00 	addis   r3,r2,0
-+ 18000[0-9a-f]{2}:	38 63 90 10 	addi    r3,r3,-28656
- 
- Disassembly of section \.opt3:
- 
--0+18000c4 <\.opt3>:
-- 18000c4:	3c 62 00 00 	addis   r3,r2,0
-- 18000c8:	48 00 00 0c 	b       .*
-- 18000cc:	3c 62 00 00 	addis   r3,r2,0
-- 18000d0:	48 00 00 0c 	b       .*
-- 18000d4:	38 63 90 10 	addi    r3,r3,-28656
-- 18000d8:	48 00 00 08 	b       .*
-- 18000dc:	38 63 90 08 	addi    r3,r3,-28664
-+0+18000[0-9a-f]{2} <\.opt3>:
-+ 18000[0-9a-f]{2}:	3c 62 00 00 	addis   r3,r2,0
-+ 18000[0-9a-f]{2}:	48 00 00 0c 	b       .*
-+ 18000[0-9a-f]{2}:	3c 62 00 00 	addis   r3,r2,0
-+ 18000[0-9a-f]{2}:	48 00 00 0c 	b       .*
-+ 18000[0-9a-f]{2}:	38 63 90 10 	addi    r3,r3,-28656
-+ 18000[0-9a-f]{2}:	48 00 00 08 	b       .*
-+ 18000[0-9a-f]{2}:	38 63 90 08 	addi    r3,r3,-28664
- #pass
---- binutils-2.23/ld/testsuite/ld-powerpc/tlsso32.d
-+++ binutils-2.23/ld/testsuite/ld-powerpc/tlsso32.d
-@@ -42,5 +42,5 @@ Disassembly of section \.got:
- #...
- .*:	4e 80 00 21 	blrl
- .* <_GLOBAL_OFFSET_TABLE_>:
--.*:	00 01 03 ec .*
-+.*:	00 01 [0-9a-f]{2} [0-9a-f]{2} .*
- #pass
---- binutils-2.23/ld/testsuite/ld-powerpc/tlsso32.g
-+++ binutils-2.23/ld/testsuite/ld-powerpc/tlsso32.g
-@@ -9,5 +9,5 @@
- Contents of section \.got:
- .* 00000000 00000000 00000000 00000000  .*
- .* 00000000 00000000 00000000 00000000  .*
--.* 00000000 4e800021 000103ec 00000000  .*
-+.* 00000000 4e800021 00010[0-9a-f]{3} 00000000  .*
- .* 00000000                             .*
---- binutils-2.23/ld/testsuite/ld-powerpc/tlsso32.r
-+++ binutils-2.23/ld/testsuite/ld-powerpc/tlsso32.r
-@@ -35,6 +35,7 @@ Program Headers:
-  +LOAD .* RWE 0x10000
-  +DYNAMIC .* RW +0x4
-  +TLS .* 0x0+1c 0x0+38 R +0x4
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- 
-  Section to Segment mapping:
-  +Segment Sections\.\.\.
-@@ -42,6 +43,7 @@ Program Headers:
-  +01 +\.tdata \.dynamic \.got \.plt 
-  +02 +\.dynamic 
-  +03 +\.tdata \.tbss 
-+ +04 +
- 
- Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 18 entries:
-  Offset +Info +Type +Sym\. Value +Symbol's Name \+ Addend
-@@ -52,9 +54,9 @@ Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 18 entries:
- [0-9a-f ]+R_PPC_TPREL16 +0+30 +le0 \+ 0
- [0-9a-f ]+R_PPC_TPREL16_HA +0+34 +le1 \+ 0
- [0-9a-f ]+R_PPC_TPREL16_LO +0+34 +le1 \+ 0
--[0-9a-f ]+R_PPC_TPREL16 +0+103d0 +\.tdata \+ 103e4
--[0-9a-f ]+R_PPC_TPREL16_HA +0+103d0 +\.tdata \+ 103e8
--[0-9a-f ]+R_PPC_TPREL16_LO +0+103d0 +\.tdata \+ 103e8
-+[0-9a-f ]+R_PPC_TPREL16 +0+103[df]0 +\.tdata \+ 10[0-9a-f]{3}
-+[0-9a-f ]+R_PPC_TPREL16_HA +0+103[df]0 +\.tdata \+ 10[0-9a-f]{3}
-+[0-9a-f ]+R_PPC_TPREL16_LO +0+103[df]0 +\.tdata \+ 10[0-9a-f]{3}
- [0-9a-f ]+R_PPC_DTPMOD32 +0
- [0-9a-f ]+R_PPC_DTPREL32 +0
- [0-9a-f ]+R_PPC_DTPMOD32 +0
---- binutils-2.23/ld/testsuite/ld-powerpc/tlstoc.g
-+++ binutils-2.23/ld/testsuite/ld-powerpc/tlstoc.g
-@@ -8,8 +8,8 @@
- .*: +file format elf64-powerpc
- 
- Contents of section \.got:
-- 100101a0 00000000 00000001 00000000 00000000  .*
-- 100101b0 00000000 00000001 00000000 00000000  .*
-- 100101c0 00000000 00000001 00000000 00000000  .*
-- 100101d0 00000000 00000001 00000000 00000000  .*
-- 100101e0 ffffffff ffff8060 00000000 00000000  .*
-+ 10010[0-9a-f]{3} 00000000 00000001 00000000 00000000  .*
-+ 10010[0-9a-f]{3} 00000000 00000001 00000000 00000000  .*
-+ 10010[0-9a-f]{3} 00000000 00000001 00000000 00000000  .*
-+ 10010[0-9a-f]{3} 00000000 00000001 00000000 00000000  .*
-+ 10010[0-9a-f]{3} ffffffff ffff8060 00000000 00000000  .*
---- binutils-2.23/ld/testsuite/ld-powerpc/tlstoc.t
-+++ binutils-2.23/ld/testsuite/ld-powerpc/tlstoc.t
-@@ -8,7 +8,7 @@
- .*: +file format elf64-powerpc
- 
- Contents of section \.tdata:
-- 10010148 00c0ffee 00000000 12345678 9abcdef0  .*
-- 10010158 23456789 abcdef01 3456789a bcdef012  .*
-- 10010168 456789ab cdef0123 56789abc def01234  .*
-- 10010178 6789abcd ef012345 789abcde f0123456  .*
-+ 10010180 00c0ffee 00000000 12345678 9abcdef0  .*
-+ 10010190 23456789 abcdef01 3456789a bcdef012  .*
-+ 100101a0 456789ab cdef0123 56789abc def01234  .*
-+ 100101b0 6789abcd ef012345 789abcde f0123456  .*
---- binutils-2.23/ld/testsuite/ld-powerpc/tlstocso.g
-+++ binutils-2.23/ld/testsuite/ld-powerpc/tlstocso.g
-@@ -7,7 +7,7 @@
- .*: +file format elf64-powerpc
- 
- Contents of section \.got:
--.* 00000000 000186c0 00000000 00000000  .*
-+.* 00000000 000186f8 00000000 00000000  .*
- .* 00000000 00000000 00000000 00000000  .*
- .* 00000000 00000000 00000000 00000000  .*
- .* 00000000 00000000 00000000 00000000  .*
---- binutils-2.23/ld/testsuite/ld-s390/tlsbin.rd
-+++ binutils-2.23/ld/testsuite/ld-s390/tlsbin.rd
-@@ -36,6 +36,7 @@ There are [0-9]+ program headers, starting at offset [0-9]+
-  +LOAD .* RW +0x1000
-  +DYNAMIC .* RW +0x4
-  +TLS .* 0x0+60 0x0+a0 R +0x20
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- 
-  Section to Segment mapping:
-  +Segment Sections...
-@@ -52,6 +53,7 @@ Program Headers:
-  +03 +.tdata .dynamic .got *
-  +04 +.dynamic *
-  +05 +.tdata .tbss *
-+ +06 +
- 
- Relocation section '.rela.dyn' at offset .* contains 4 entries:
-  Offset +Info +Type +Sym.Value +Sym. Name \+ Addend
---- binutils-2.23/ld/testsuite/ld-s390/tlsbin_64.rd
-+++ binutils-2.23/ld/testsuite/ld-s390/tlsbin_64.rd
-@@ -36,6 +36,7 @@ There are [0-9]+ program headers, starting at offset [0-9]+
-  +LOAD .* RW +0x1000
-  +DYNAMIC .* RW +0x8
-  +TLS .* 0x0+60 0x0+a0 R +0x20
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- 
-  Section to Segment mapping:
-  +Segment Sections...
-@@ -52,6 +53,7 @@ Program Headers:
-  +03 +.tdata .dynamic .got *
-  +04 +.dynamic *
-  +05 +.tdata .tbss *
-+ +06 +
- 
- Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 4 entries:
-  +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend
---- binutils-2.23/ld/testsuite/ld-s390/tlspic.rd
-+++ binutils-2.23/ld/testsuite/ld-s390/tlspic.rd
-@@ -39,6 +39,7 @@ Program Headers:
-  +LOAD .* RW +0x1000
-  +DYNAMIC .* RW +0x4
-  +TLS .* 0x0+60 0x0+80 R +0x20
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- 
-  Section to Segment mapping:
-  +Segment Sections...
-@@ -46,6 +47,7 @@ Program Headers:
-  +01 +.tdata .dynamic .got 
-  +02 +.dynamic 
-  +03 +.tdata .tbss 
-+ +04 +
- 
- Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 14 entries:
-  Offset +Info +Type +Sym.Value +Sym. Name \+ Addend
---- binutils-2.23/ld/testsuite/ld-s390/tlspic_64.rd
-+++ binutils-2.23/ld/testsuite/ld-s390/tlspic_64.rd
-@@ -39,6 +39,7 @@ Program Headers:
-  +LOAD .* RW +0x1000
-  +DYNAMIC .* RW +0x8
-  +TLS .* 0x0+60 0x0+80 R +0x20
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- 
-  Section to Segment mapping:
-  +Segment Sections...
-@@ -46,6 +47,7 @@ Program Headers:
-  +01 +.tdata .dynamic .got *
-  +02 +.dynamic *
-  +03 +.tdata .tbss *
-+ +04 +
- 
- Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 14 entries:
-  +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend
---- binutils-2.23/ld/testsuite/ld-scripts/empty-aligned.d
-+++ binutils-2.23/ld/testsuite/ld-scripts/empty-aligned.d
-@@ -8,7 +8,9 @@
- Program Headers:
-  +Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg +Align
-  +LOAD +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ [RWE ]+ +0x[0-9a-f]+
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- 
-  Section to Segment mapping:
-  +Segment Sections\.\.\.
-  +00 +.text 
-+ +01 +
---- binutils-2.23/ld/testsuite/ld-sh/tlsbin-2.d
-+++ binutils-2.23/ld/testsuite/ld-sh/tlsbin-2.d
-@@ -44,6 +44,7 @@ Program Headers:
-  +LOAD.*
-  +DYNAMIC.*
-  +TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+18 0x0+28 R +0x4
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- 
-  Section to Segment mapping:
-  +Segment Sections\.\.\.
-@@ -53,6 +54,7 @@ Program Headers:
-  +03 +\.tdata \.dynamic \.got *
-  +04 +\.dynamic *
-  +05 +\.tdata \.tbss *
-+ +06 +
- 
- Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 4 entries:
-  Offset +Info +Type +Sym\.Value +Sym\. Name \+ Addend
---- binutils-2.23/ld/testsuite/ld-sh/tlspic-2.d
-+++ binutils-2.23/ld/testsuite/ld-sh/tlspic-2.d
-@@ -32,7 +32,7 @@ Key to Flags:
- 
- Elf file type is DYN \(Shared object file\)
- Entry point 0x[0-9a-f]+
--There are 4 program headers, starting at offset [0-9]+
-+There are [0-9] program headers, starting at offset [0-9]+
- 
- Program Headers:
-  +Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align
-@@ -40,6 +40,7 @@ Program Headers:
-  +LOAD.*
-  +DYNAMIC.*
-  +TLS .* 0x0+18 0x0+20 R +0x4
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- 
-  Section to Segment mapping:
-  +Segment Sections\.\.\.
-@@ -47,6 +48,7 @@ Program Headers:
-  +01 +\.tdata \.dynamic \.got *
-  +02 +\.dynamic *
-  +03 +\.tdata \.tbss *
-+ +04 +
- 
- Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 10 entries:
-  Offset +Info +Type +Sym\.Value +Sym\. Name \+ Addend
---- binutils-2.23/ld/testsuite/ld-sparc/gotop32.rd
-+++ binutils-2.23/ld/testsuite/ld-sparc/gotop32.rd
-@@ -31,6 +31,7 @@ Program Headers:
-  +LOAD +0x0+ 0x0+ 0x0+ 0x0+2000 0x0+2000 R E 0x10000
-  +LOAD +0x0+2000 0x0+12000 0x0+12000 0x0+2000 0x0+2000 RW +0x10000
-  +DYNAMIC +0x0+2000 0x0+12000 0x0+12000 0x0+70 0x0+70 RW +0x4
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- #...
- 
- Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 1 entries:
---- binutils-2.23/ld/testsuite/ld-sparc/gotop64.rd
-+++ binutils-2.23/ld/testsuite/ld-sparc/gotop64.rd
-@@ -31,6 +31,7 @@ Program Headers:
-  +LOAD +0x0+ 0x0+ 0x0+ 0x0+2000 0x0+2000 R E 0x100000
-  +LOAD +0x0+2000 0x0+102000 0x0+102000 0x0+2000 0x0+2000 RW +0x100000
-  +DYNAMIC +0x0+2000 0x0+102000 0x0+102000 0x0+e0 0x0+e0 RW +0x8
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- #...
- 
- Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 1 entries:
---- binutils-2.23/ld/testsuite/ld-sparc/tlssunbin32.rd
-+++ binutils-2.23/ld/testsuite/ld-sparc/tlssunbin32.rd
-@@ -30,13 +30,14 @@ There are [0-9]+ program headers, starting at offset [0-9]+
- 
- Program Headers:
-  +Type +Offset +VirtAddr +PhysAddr +FileSiz MemSiz +Flg Align
-- +PHDR +0x0+34 0x0+10034 0x0+10034 0x0+c0 0x0+c0 R E 0x4
-- +INTERP +0x0+f4 0x0+100f4 0x0+100f4 0x0+11 0x0+11 R +0x1
-+ +PHDR +0x0+34 0x0+10034 0x0+10034 (0x[0-9a-f]+) \1 R E 0x4
-+ +INTERP +(0x[0-9a-f]+ ){3}0x0+11 0x0+11 R +0x1
- .*Requesting program interpreter.*
-  +LOAD .* R E 0x10000
-  +LOAD .* RW +0x10000
-  +DYNAMIC .* RW +0x4
-  +TLS .* 0x0+1060 0x0+10a0 R +0x4
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- #...
- 
- Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 4 entries:
---- binutils-2.23/ld/testsuite/ld-sparc/tlssunbin64.rd
-+++ binutils-2.23/ld/testsuite/ld-sparc/tlssunbin64.rd
-@@ -30,13 +30,14 @@ There are [0-9]+ program headers, starting at offset [0-9]+
- 
- Program Headers:
-  +Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align
-- +PHDR +0x0+40 0x0+100040 0x0+100040 0x0+150 0x0+150 R E 0x8
-- +INTERP +0x0+190 0x0+100190 0x0+100190 0x0+19 0x0+19 R +0x1
-+ +PHDR +0x0+40 0x0+100040 0x0+100040 (0x[0-9a-f]+) \1 R E 0x8
-+ +INTERP +0x0+([0-9a-f]+) (0x0+10+\1) \2 0x0+19 0x0+19 R +0x1
- .*Requesting program interpreter.*
-  +LOAD .* R E 0x100000
-  +LOAD .* RW +0x100000
-  +DYNAMIC .* RW +0x8
-  +TLS .* 0x0+60 0x0+a0 R +0x4
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- #...
- 
- Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 4 entries:
---- binutils-2.23/ld/testsuite/ld-sparc/tlssunnopic32.rd
-+++ binutils-2.23/ld/testsuite/ld-sparc/tlssunnopic32.rd
-@@ -32,6 +32,7 @@ Program Headers:
-  +LOAD .* RW +0x10000
-  +DYNAMIC .* RW +0x4
-  +TLS .* 0x0+ 0x0+24 R +0x4
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- #...
- 
- Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 12 entries:
---- binutils-2.23/ld/testsuite/ld-sparc/tlssunnopic64.rd
-+++ binutils-2.23/ld/testsuite/ld-sparc/tlssunnopic64.rd
-@@ -32,6 +32,7 @@ Program Headers:
-  +LOAD .* RW +0x100000
-  +DYNAMIC .* RW +0x8
-  +TLS .* 0x0+ 0x0+24 R +0x4
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- #...
- 
- Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 14 entries:
---- binutils-2.23/ld/testsuite/ld-sparc/tlssunpic32.rd
-+++ binutils-2.23/ld/testsuite/ld-sparc/tlssunpic32.rd
-@@ -36,6 +36,7 @@ Program Headers:
-  +LOAD +0x0+2000 0x0+12000 0x0+12000 0x0+184 0x0+184 RWE 0x10000
-  +DYNAMIC +0x0+2060 0x0+12060 0x0+12060 0x0+98 0x0+98 RW +0x4
-  +TLS +0x0+2000 0x0+12000 0x0+12000 0x0+60 0x0+80 R +0x4
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- #...
- 
- Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 14 entries:
---- binutils-2.23/ld/testsuite/ld-sparc/tlssunpic64.rd
-+++ binutils-2.23/ld/testsuite/ld-sparc/tlssunpic64.rd
-@@ -36,6 +36,7 @@ Program Headers:
-  +LOAD +0x0+2000 0x0+102000 0x0+102000 0x0+3a0 0x0+3a0 RWE 0x100000
-  +DYNAMIC +0x0+2060 0x0+102060 0x0+102060 0x0+130 0x0+130 RW +0x8
-  +TLS +0x0+2000 0x0+102000 0x0+102000 0x0+60 0x0+80 R +0x4
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- #...
- 
- Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 14 entries:
---- binutils-2.23/ld/testsuite/ld-x86-64/tlsgdesc.rd
-+++ binutils-2.23/ld/testsuite/ld-x86-64/tlsgdesc.rd
-@@ -36,12 +36,14 @@ Program Headers:
-  +LOAD.*
-  +LOAD.*
-  +DYNAMIC.*
-+ +PAX_FLAGS.*
- 
-  Section to Segment mapping:
-  +Segment Sections...
-  +00 +.hash .dynsym .dynstr .rela.dyn .rela.plt .plt .text *
-  +01 +.dynamic .got .got.plt *
-  +02 +.dynamic *
-+ +03 +
- 
- Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 8 entries:
-  +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend
---- binutils-2.23/ld/testsuite/ld-x86-64/tlspic.rd
-+++ binutils-2.23/ld/testsuite/ld-x86-64/tlspic.rd
-@@ -40,6 +40,7 @@ Program Headers:
-  +LOAD +0x0+11ac 0x0+2011ac 0x0+2011ac 0x0+244 0x0+244 RW +0x200000
-  +DYNAMIC +0x0+1210 0x0+201210 0x0+201210 0x0+130 0x0+130 RW +0x8
-  +TLS +0x0+11ac 0x0+2011ac 0x0+2011ac 0x0+60 0x0+80 R +0x1
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- 
-  Section to Segment mapping:
-  +Segment Sections...
-@@ -47,6 +48,7 @@ Program Headers:
-  +01 +.tdata .dynamic .got .got.plt *
-  +02 +.dynamic *
-  +03 +.tdata .tbss *
-+ +04 +
- 
- Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 14 entries:
-  +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend
diff --git a/pkgs/development/tools/misc/binutils/pt-pax-flags.patch b/pkgs/development/tools/misc/binutils/pt-pax-flags.patch
new file mode 100644
index 000000000000..3c060012ad0e
--- /dev/null
+++ b/pkgs/development/tools/misc/binutils/pt-pax-flags.patch
@@ -0,0 +1,233 @@
+--- binutils-2.15.94.0.2.2.orig/bfd/elf-bfd.h	2005-02-07 20:42:44.000000000 +0100
++++ binutils-2.15.94.0.2.2/bfd/elf-bfd.h	2005-02-20 13:13:17.362558200 +0100
+@@ -1266,6 +1266,9 @@
+   /* Should the PT_GNU_RELRO segment be emitted?  */
+   bfd_boolean relro;
+ 
++  /* Segment flags for the PT_PAX_FLAGS segment.  */
++  unsigned int pax_flags;
++
+   /* Symbol version definitions in external objects.  */
+   Elf_Internal_Verdef *verdef;
+ 
+--- binutils-2.17.50.0.18/bfd/elf.c.orig	2007-08-01 11:12:02.000000000 -0400
++++ binutils-2.17.50.0.18/bfd/elf.c	2007-08-01 14:27:36.086986774 -0400
+@@ -1085,6 +1085,7 @@
+     case PT_GNU_EH_FRAME: pt = "EH_FRAME"; break;
+     case PT_GNU_STACK: pt = "STACK"; break;
+     case PT_GNU_RELRO: pt = "RELRO"; break;
++    case PT_PAX_FLAGS: pt = "PAX_FLAGS"; break;
+     default: pt = NULL; break;
+     }
+   return pt;
+@@ -2346,6 +2347,9 @@
+     case PT_GNU_RELRO:
+       return _bfd_elf_make_section_from_phdr (abfd, hdr, hdr_index, "relro");
+ 
++    case PT_PAX_FLAGS:
++      return _bfd_elf_make_section_from_phdr (abfd, hdr, hdr_index, "pax_flags");
++
+     default:
+       /* Check for any processor-specific program segment types.  */
+       bed = get_elf_backend_data (abfd);
+@@ -3326,6 +3330,11 @@
+       ++segs;
+     }
+ 
++    {
++      /* We need a PT_PAX_FLAGS segment.  */
++      ++segs;
++    }
++
+   for (s = abfd->sections; s != NULL; s = s->next)
+     {
+       if ((s->flags & SEC_LOAD) != 0
+@@ -3945,6 +3954,20 @@
+ 	  pm = &m->next;
+ 	}
+ 
++      {
++        amt = sizeof (struct elf_segment_map);
++        m = bfd_zalloc (abfd, amt);
++        if (m == NULL)
++  	goto error_return;
++        m->next = NULL;
++        m->p_type = PT_PAX_FLAGS;
++        m->p_flags = elf_tdata (abfd)->pax_flags;
++        m->p_flags_valid = 1;
++  
++        *pm = m;
++        pm = &m->next;
++      }
++
+       free (sections);
+       elf_tdata (abfd)->segment_map = mfirst;
+     }
+@@ -5129,7 +5152,8 @@
+        5. PT_GNU_STACK segments do not include any sections.
+        6. PT_TLS segment includes only SHF_TLS sections.
+        7. SHF_TLS sections are only in PT_TLS or PT_LOAD segments.
+-       8. PT_DYNAMIC should not contain empty sections at the beginning
++       8. PT_PAX_FLAGS segments do not include any sections.
++       9. PT_DYNAMIC should not contain empty sections at the beginning
+ 	  (with the possible exception of .dynamic).  */
+ #define IS_SECTION_IN_INPUT_SEGMENT(section, segment, bed)		\
+   ((((segment->p_paddr							\
+@@ -5138,6 +5162,7 @@
+      && (section->flags & SEC_ALLOC) != 0)				\
+     || IS_COREFILE_NOTE (segment, section))				\
+    && segment->p_type != PT_GNU_STACK					\
++   && segment->p_type != PT_PAX_FLAGS					\
+    && (segment->p_type != PT_TLS					\
+        || (section->flags & SEC_THREAD_LOCAL))				\
+    && (segment->p_type == PT_LOAD					\
+--- binutils-2.23.52.0.1/bfd/elflink.c.orig	2013-02-27 21:28:03.000000000 +0100
++++ binutils-2.23.52.0.1/bfd/elflink.c	2013-03-01 17:32:44.922717879 +0100
+@@ -5764,18 +5764,32 @@
+       && ! (*bed->elf_backend_always_size_sections) (output_bfd, info))
+     return FALSE;
+ 
++  elf_tdata (output_bfd)->pax_flags = PF_NORANDEXEC;
++
++  if (info->execheap)
++    elf_tdata (output_bfd)->pax_flags |= PF_NOMPROTECT;
++  else if (info->noexecheap)
++    elf_tdata (output_bfd)->pax_flags |= PF_MPROTECT;
++
+   /* Determine any GNU_STACK segment requirements, after the backend
+      has had a chance to set a default segment size.  */
+   if (info->execstack)
++  {
+     elf_stack_flags (output_bfd) = PF_R | PF_W | PF_X;
++    elf_tdata (output_bfd)->pax_flags |= PF_EMUTRAMP;
++  }
+   else if (info->noexecstack)
++  {
+     elf_stack_flags (output_bfd) = PF_R | PF_W;
++    elf_tdata (output_bfd)->pax_flags |= PF_NOEMUTRAMP;
++  }
+   else
+     {
+       bfd *inputobj;
+       asection *notesec = NULL;
+       int exec = 0;
+ 
++      elf_tdata (output_bfd)->pax_flags |= PF_NOEMUTRAMP;
+       for (inputobj = info->input_bfds;
+ 	   inputobj;
+ 	   inputobj = inputobj->link_next)
+@@ -5789,7 +5803,11 @@
+ 	  if (s)
+ 	    {
+ 	      if (s->flags & SEC_CODE)
+-		exec = PF_X;
++		{
++		  elf_tdata (output_bfd)->pax_flags &= ~PF_NOEMUTRAMP;
++		  elf_tdata (output_bfd)->pax_flags |= PF_EMUTRAMP;
++		  exec = PF_X;
++		}
+ 	      notesec = s;
+ 	    }
+ 	  else if (bed->default_execstack)
+--- binutils-2.15.94.0.2.2.orig/binutils/readelf.c	2005-02-18 07:14:30.000000000 +0100
++++ binutils-2.15.94.0.2.2/binutils/readelf.c	2005-02-20 13:13:17.470541784 +0100
+@@ -2293,6 +2293,7 @@
+ 			return "GNU_EH_FRAME";
+     case PT_GNU_STACK:	return "GNU_STACK";
+     case PT_GNU_RELRO:  return "GNU_RELRO";
++    case PT_PAX_FLAGS:	return "PAX_FLAGS";
+ 
+     default:
+       if ((p_type >= PT_LOPROC) && (p_type <= PT_HIPROC))
+--- binutils-2.15.94.0.2.2.orig/include/bfdlink.h	2004-11-22 21:33:32.000000000 +0100
++++ binutils-2.15.94.0.2.2/include/bfdlink.h	2005-02-20 13:13:17.476540872 +0100
+@@ -313,6 +313,14 @@
+      flags.  */
+   unsigned int noexecstack: 1;
+ 
++  /* TRUE if PT_PAX_FLAGS segment should be created with PF_NOMPROTECT
++     flags.  */
++  unsigned int execheap: 1;
++
++  /* TRUE if PT_PAX_FLAGS segment should be created with PF_MPROTECT
++     flags.  */
++  unsigned int noexecheap: 1;
++
+   /* TRUE if PT_GNU_RELRO segment should be created.  */
+   unsigned int relro: 1;
+ 
+--- binutils-2.15.94.0.2.2.orig/include/elf/common.h	2004-11-22 21:33:32.000000000 +0100
++++ binutils-2.15.94.0.2.2/include/elf/common.h	2005-02-20 13:13:17.482539960 +0100
+@@ -423,6 +423,7 @@
+ #define PT_SUNW_EH_FRAME PT_GNU_EH_FRAME      /* Solaris uses the same value */
+ #define PT_GNU_STACK	(PT_LOOS + 0x474e551) /* Stack flags */
+ #define PT_GNU_RELRO	(PT_LOOS + 0x474e552) /* Read-only after relocation */
++#define PT_PAX_FLAGS   (PT_LOOS + 0x5041580) /* PaX flags */
+ 
+ /* Program segment permissions, in program header p_flags field.  */
+ 
+@@ -433,6 +434,19 @@
+ #define PF_MASKOS	0x0FF00000	/* New value, Oct 4, 1999 Draft */
+ #define PF_MASKPROC	0xF0000000	/* Processor-specific reserved bits */
+ 
++#define PF_PAGEEXEC        (1 << 4)    /* Enable  PAGEEXEC */
++#define PF_NOPAGEEXEC  (1 << 5)    /* Disable PAGEEXEC */
++#define PF_SEGMEXEC        (1 << 6)    /* Enable  SEGMEXEC */
++#define PF_NOSEGMEXEC  (1 << 7)    /* Disable SEGMEXEC */
++#define PF_MPROTECT        (1 << 8)    /* Enable  MPROTECT */
++#define PF_NOMPROTECT  (1 << 9)    /* Disable MPROTECT */
++#define PF_RANDEXEC        (1 << 10)   /* Enable  RANDEXEC */
++#define PF_NORANDEXEC  (1 << 11)   /* Disable RANDEXEC */
++#define PF_EMUTRAMP        (1 << 12)   /* Enable  EMUTRAMP */
++#define PF_NOEMUTRAMP  (1 << 13)   /* Disable EMUTRAMP */
++#define PF_RANDMMAP        (1 << 14)   /* Enable  RANDMMAP */
++#define PF_NORANDMMAP  (1 << 15)   /* Disable RANDMMAP */
++
+ /* Values for section header, sh_type field.  */
+ 
+ #define SHT_NULL	0		/* Section header table entry unused */
+--- binutils-2.18.50.0.1/ld/emultempl/elf32.em.orig	2007-09-08 19:34:12.000000000 +0200
++++ binutils-2.18.50.0.1/ld/emultempl/elf32.em	2007-09-15 21:41:35.688212063 +0200
+@@ -2139,6 +2139,16 @@
+ 	  link_info.noexecstack = TRUE;
+ 	  link_info.execstack = FALSE;
+ 	}
++      else if (strcmp (optarg, "execheap") == 0)
++	{
++	  link_info.execheap = TRUE;
++	  link_info.noexecheap = FALSE;
++	}
++      else if (strcmp (optarg, "noexecheap") == 0)
++	{
++	  link_info.noexecheap = TRUE;
++	  link_info.execheap = FALSE;
++	}
+ EOF
+ 
+   if test -n "$COMMONPAGESIZE"; then
+--- binutils-2.15.94.0.2.2.orig/ld/ldgram.y	2004-11-22 21:33:32.000000000 +0100
++++ binutils-2.15.94.0.2.2/ld/ldgram.y	2005-02-20 13:13:17.499537376 +0100
+@@ -1073,6 +1073,8 @@
+ 			    $$ = exp_intop (0x6474e550);
+ 			  else if (strcmp (s, "PT_GNU_STACK") == 0)
+ 			    $$ = exp_intop (0x6474e551);
++			  else if (strcmp (s, "PT_PAX_FLAGS") == 0)
++			    $$ = exp_intop (0x65041580);
+ 			  else
+ 			    {
+ 			      einfo (_("\
+--- binutils-2.26/ld/lexsup.c.orig	2015-11-13 09:27:42.000000000 +0100
++++ binutils-2.26/ld/lexsup.c	2016-01-26 21:08:41.787138458 +0100
+@@ -1793,8 +1793,12 @@
+   fprintf (file, _("\
+   -z muldefs                  Allow multiple definitions\n"));
+   fprintf (file, _("\
++  -z execheap                 Mark executable as requiring executable heap\n"));
++  fprintf (file, _("\
+   -z execstack                Mark executable as requiring executable stack\n"));
+   fprintf (file, _("\
++  -z noexecheap               Mark executable as not requiring executable heap\n"));
++  fprintf (file, _("\
+   -z noexecstack              Mark executable as not requiring executable stack\n"));
+ }
+ 
diff --git a/pkgs/development/tools/misc/patchelf/default.nix b/pkgs/development/tools/misc/patchelf/default.nix
index 5aa81e46bed1..7154166c2516 100644
--- a/pkgs/development/tools/misc/patchelf/default.nix
+++ b/pkgs/development/tools/misc/patchelf/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "patchelf-0.8";
+  name = "patchelf-0.9";
 
   src = fetchurl {
     url = "http://nixos.org/releases/patchelf/${name}/${name}.tar.bz2";
-    sha256 = "c99f84d124347340c36707089ec8f70530abd56e7827c54d506eb4cc097a17e7";
+    sha256 = "a0f65c1ba148890e9f2f7823f4bedf7ecad5417772f64f994004f59a39014f83";
   };
 
   setupHook = [ ./setup-hook.sh ];
diff --git a/pkgs/games/gsb/default.nix b/pkgs/games/gsb/default.nix
index 4c1a385baaf9..1c8f0334bf19 100644
--- a/pkgs/games/gsb/default.nix
+++ b/pkgs/games/gsb/default.nix
@@ -69,6 +69,7 @@ stdenv.mkDerivation rec {
     license = licenses.unfree;
     maintainers = with maintainers; [ jcumming ];
     platforms = [ "x86_64-linux" "i686-linux" ] ;
+    broken = true;
   };
 
 }
diff --git a/pkgs/games/zoom/default.nix b/pkgs/games/zoom/default.nix
index 200b9c24c7db..d6e79289525d 100644
--- a/pkgs/games/zoom/default.nix
+++ b/pkgs/games/zoom/default.nix
@@ -2,21 +2,26 @@
 
 # !!! assert freetype == xorg.freetype
 
-stdenv.mkDerivation {
+stdenv.mkDerivation rec {
   name = "zoom-1.1.5";
   
   src = fetchurl {
-    url = http://www.logicalshift.co.uk/unix/zoom/zoom-1.1.5.tar.gz;
+    url = "http://www.logicalshift.co.uk/unix/zoom/${name}.tar.gz";
     sha256 = "1g6van7f7sg3zfcz80mncnnbccyg2hnm0hq4x558vpsm0lf7z5pj";
   };
   
   buildInputs = [ perl expat xlibsWrapper freetype ];
   
-  # Zoom doesn't add the right directory in the include path.
-  CFLAGS = [ "-I" (freetype + "/include/freetype2") ];
+  NIX_CFLAGS_COMPILE = [
+    # Zoom doesn't add the right directory in the include path.
+    "-I" (freetype + "/include/freetype2")
+
+    # for gcc5; c11 inline semantics breaks the build
+    "-fgnu89-inline"
+  ];
 
   meta = with stdenv.lib; {
-    description = "Player for Z-Code, TADS and HUGO stories or games, usually text adventures ('interactive fiction')";
+    description = "Player for Z-Code, TADS and HUGO stories or games";
     longDescription = ''
       Zoom is a player for Z-Code, TADS and HUGO stories or games. These are
       usually text adventures ('interactive fiction'), and were first created
diff --git a/pkgs/misc/emulators/higan/0001-change-flags.diff b/pkgs/misc/emulators/higan/0001-change-flags.diff
index 78f4a248c5fd..9d7608b93281 100644
--- a/pkgs/misc/emulators/higan/0001-change-flags.diff
+++ b/pkgs/misc/emulators/higan/0001-change-flags.diff
@@ -11,15 +11,6 @@ diff -rupN higan_v095-source.orig/GNUmakefile higan_v095-source/GNUmakefile
  objects := libco
  
  # profile-guided optimization mode
-@@ -43,7 +44,7 @@ ifeq ($(platform),windows)
- else ifeq ($(platform),macosx)
-   flags += -march=native
- else ifeq ($(platform),linux)
--  flags += -march=native -fopenmp
-+  flags += -fopenmp
-   link += -fopenmp
-   link += -Wl,-export-dynamic
-   link += -lX11 -lXext -ldl
 diff -rupN higan_v095-source.orig/icarus/GNUmakefile higan_v095-source/icarus/GNUmakefile
 --- higan_v095-source.orig/icarus/GNUmakefile	2015-11-04 10:28:26.186486119 +0100
 +++ higan_v095-source/icarus/GNUmakefile	2015-11-04 10:28:48.755059317 +0100
diff --git a/pkgs/os-specific/linux/kernel/linux-rpi.nix b/pkgs/os-specific/linux/kernel/linux-rpi.nix
index 320d4994cf2f..777662718af6 100644
--- a/pkgs/os-specific/linux/kernel/linux-rpi.nix
+++ b/pkgs/os-specific/linux/kernel/linux-rpi.nix
@@ -2,17 +2,17 @@
 
 let
 
-  rev = "fe4a83540ec73dfc298f16f027277355470ea9a0";
+  rev = "f4b20d47d7df7927967fcd524324b145cfc9e2f9";
 
 in import ./generic.nix (args // rec {
-  version = "3.18.y-${rev}";
+  version = "4.1.y-${rev}";
 
-  modDirVersion = "3.18.7";
+  modDirVersion = "4.1.20-v7";
 
   src = fetchurl {
     url = "https://api.github.com/repos/raspberrypi/linux/tarball/${rev}";
     name = "linux-raspberrypi-${version}.tar.gz";
-    sha256 = "05gq40f038hxjqd3sdb1914g2bzw533dyxy59sgdpybs8801x2vb";
+    sha256 = "0x17hlbi7lpmmnp24dnkync5gzj57j84j0nlrcv1lv9fahjkqsm2";
   };
 
   features.iwlwifi = true;
diff --git a/pkgs/os-specific/linux/kernel/perf.nix b/pkgs/os-specific/linux/kernel/perf.nix
index 1e5c64ccb8a8..ad80d2ed93c2 100644
--- a/pkgs/os-specific/linux/kernel/perf.nix
+++ b/pkgs/os-specific/linux/kernel/perf.nix
@@ -28,7 +28,7 @@ stdenv.mkDerivation {
 
   # Note: we don't add elfutils to buildInputs, since it provides a
   # bad `ld' and other stuff.
-  NIX_CFLAGS_COMPILE = "-I${elfutils}/include -Wno-error=cpp";
+  NIX_CFLAGS_COMPILE = "-I${elfutils}/include -Wno-error=cpp -Wno-error=bool-compare";
   NIX_CFLAGS_LINK = "-L${elfutils}/lib";
 
   installFlags = "install install-man ASCIIDOC8=1";
diff --git a/pkgs/os-specific/linux/kexectools/default.nix b/pkgs/os-specific/linux/kexectools/default.nix
index 2199524154d9..d7d79b0257d7 100644
--- a/pkgs/os-specific/linux/kexectools/default.nix
+++ b/pkgs/os-specific/linux/kexectools/default.nix
@@ -2,14 +2,14 @@
 
 stdenv.mkDerivation rec {
   name = "kexec-tools-${version}";
-  version = "2.0.11";
+  version = "2.0.12";
 
   src = fetchurl {
     urls = [
       "mirror://kernel/linux/utils/kernel/kexec/${name}.tar.xz"
       "http://horms.net/projects/kexec/kexec-tools/${name}.tar.xz"
     ];
-    sha256 = "1qrfka9xvy77k0rg3k0cf7xai0f9vpgsbs4l3bs8r4nvzy37j2di";
+    sha256 = "03cj7w2l5fqn72xfhl4q6z0zbziwkp9bfn0gs7gaf9i44jv6gkhl";
   };
 
   buildInputs = [ zlib ];
diff --git a/pkgs/servers/nosql/arangodb/default.nix b/pkgs/servers/nosql/arangodb/default.nix
index 4ff12f630c9b..7ccd29bc783a 100644
--- a/pkgs/servers/nosql/arangodb/default.nix
+++ b/pkgs/servers/nosql/arangodb/default.nix
@@ -15,6 +15,8 @@ stdenv.mkDerivation rec {
     openssl zlib python gyp go readline
   ];
 
+  NIX_CFLAGS_COMPILE = "-Wno-error=strict-overflow";
+
   configureFlagsArray = [ "--with-openssl-lib=${openssl}/lib" ];
 
   patchPhase = ''
diff --git a/pkgs/servers/sql/mariadb/default.nix b/pkgs/servers/sql/mariadb/default.nix
index eb132a0be22f..9ca1a23ea345 100644
--- a/pkgs/servers/sql/mariadb/default.nix
+++ b/pkgs/servers/sql/mariadb/default.nix
@@ -64,7 +64,7 @@ stdenv.mkDerivation rec {
   ];
 
   # fails to find lex_token.h sometimes
-  enableParallelBuilding = true;
+  enableParallelBuilding = false;
 
   outputs = [ "out" "lib" ];
 
diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix
index 85c406d3703d..52f8f007b001 100644
--- a/pkgs/stdenv/darwin/default.nix
+++ b/pkgs/stdenv/darwin/default.nix
@@ -25,7 +25,8 @@ in rec {
   allPackages = import ../../..;
 
   commonPreHook = ''
-    export NIX_ENFORCE_PURITY=1
+    export NIX_ENFORCE_PURITY="''${NIX_ENFORCE_PURITY-1}"
+    export NIX_ENFORCE_NO_NATIVE="''${NIX_ENFORCE_NO_NATIVE-1}"
     export NIX_IGNORE_LD_THROUGH_GCC=1
     stripAllFlags=" " # the Darwin "strip" command doesn't know "-s"
     export MACOSX_DEPLOYMENT_TARGET=10.7
@@ -55,8 +56,7 @@ in rec {
   stageFun = step: last: {shell             ? "${bootstrapTools}/bin/sh",
                           overrides         ? (pkgs: {}),
                           extraPreHook      ? "",
-                          extraBuildInputs  ? with last.pkgs; [ xz darwin.CF libcxx ],
-                          extraInitialPath  ? [],
+                          extraBuildInputs,
                           allowedRequisites ? null}:
     let
       thisStdenv = import ../generic {
@@ -85,7 +85,7 @@ in rec {
           ${commonPreHook}
           ${extraPreHook}
         '';
-        initialPath  = extraInitialPath ++ [ bootstrapTools ];
+        initialPath  = [ bootstrapTools ];
         fetchurlBoot = import ../../build-support/fetchurl {
           stdenv = stage0.stdenv;
           curl   = bootstrapTools;
@@ -174,6 +174,8 @@ in rec {
       export PATH_LOCALE=${pkgs.darwin.locale}/share/locale
     '';
 
+    extraBuildInputs = with pkgs; [ xz darwin.CF libcxx ];
+
     allowedRequisites =
       [ bootstrapTools ] ++
       (with pkgs; [ xz libcxx libcxxabi icu ]) ++
@@ -203,9 +205,10 @@ in rec {
     # enables patchShebangs above. Unfortunately, patchShebangs ignores our $SHELL setting
     # and instead goes by $PATH, which happens to contain bootstrapTools. So it goes and
     # patches our shebangs back to point at bootstrapTools. This makes sure bash comes first.
-    extraInitialPath = [ pkgs.bash ];
+    extraBuildInputs = with pkgs; [ xz darwin.CF libcxx pkgs.bash ];
 
     extraPreHook = ''
+      export PATH=${pkgs.bash}/bin:$PATH
       export PATH_LOCALE=${pkgs.darwin.locale}/share/locale
     '';
 
@@ -236,7 +239,7 @@ in rec {
 
   stage4 = with stage3; stageFun 4 stage3 {
     shell = "${pkgs.bash}/bin/bash";
-    extraInitialPath = [ pkgs.bash ];
+    extraBuildInputs = with pkgs; [ xz darwin.CF libcxx pkgs.bash ];
     extraPreHook = ''
       export PATH_LOCALE=${pkgs.darwin.locale}/share/locale
     '';
diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh
index b49846fa050c..97eb855d3594 100644
--- a/pkgs/stdenv/generic/setup.sh
+++ b/pkgs/stdenv/generic/setup.sh
@@ -214,7 +214,6 @@ PATH=
 for i in $initialPath; do
     if [ "$i" = / ]; then i=; fi
     addToSearchPath PATH $i/bin
-    addToSearchPath PATH $i/sbin
 done
 
 if [ "$NIX_DEBUG" = 1 ]; then
@@ -262,6 +261,10 @@ findInputs() {
         source "$pkg"
     fi
 
+    if [ -d $1/bin ]; then
+        addToSearchPath _PATH $1/bin
+    fi
+
     if [ -f "$pkg/nix-support/setup-hook" ]; then
         source "$pkg/nix-support/setup-hook"
     fi
@@ -289,10 +292,6 @@ done
 _addToNativeEnv() {
     local pkg=$1
 
-    if [ -d $1/bin ]; then
-        addToSearchPath _PATH $1/bin
-    fi
-
     # Run the package-specific hooks set by the setup-hook scripts.
     runHook envHook "$pkg"
 }
@@ -304,13 +303,6 @@ done
 _addToCrossEnv() {
     local pkg=$1
 
-    # Some programs put important build scripts (freetype-config and similar)
-    # into their crossDrv bin path. Intentionally these should go after
-    # the nativePkgs in PATH.
-    if [ -d $1/bin ]; then
-        addToSearchPath _PATH $1/bin
-    fi
-
     # Run the package-specific hooks set by the setup-hook scripts.
     runHook crossEnvHook "$pkg"
 }
diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix
index 1135ad78acdc..f0b6ce7c9f3d 100644
--- a/pkgs/stdenv/linux/default.nix
+++ b/pkgs/stdenv/linux/default.nix
@@ -8,24 +8,22 @@
 { system ? builtins.currentSystem
 , allPackages ? import ../../..
 , platform ? null, config ? {}, lib ? (import ../../../lib)
-, customBootstrapFiles ? null }:
-
-rec {
-
-  bootstrapFiles =
-    if customBootstrapFiles != null then customBootstrapFiles
-    else if system == "i686-linux" then import ./bootstrap/i686.nix
+, bootstrapFiles ?
+    if system == "i686-linux" then import ./bootstrap/i686.nix
     else if system == "x86_64-linux" then import ./bootstrap/x86_64.nix
     else if system == "armv5tel-linux" then import ./bootstrap/armv5tel.nix
     else if system == "armv6l-linux" then import ./bootstrap/armv6l.nix
     else if system == "armv7l-linux" then import ./bootstrap/armv7l.nix
     else if system == "mips64el-linux" then import ./bootstrap/loongson2f.nix
-    else abort "unsupported platform for the pure Linux stdenv";
+    else abort "unsupported platform for the pure Linux stdenv"
+}:
 
+rec {
 
   commonPreHook =
     ''
-      export NIX_ENFORCE_PURITY=1
+      export NIX_ENFORCE_PURITY="''${NIX_ENFORCE_PURITY-1}"
+      export NIX_ENFORCE_NO_NATIVE="''${NIX_ENFORCE_NO_NATIVE-1}"
       ${if system == "x86_64-linux" then "NIX_LIB64_IN_SELF_RPATH=1" else ""}
       ${if system == "mips64el-linux" then "NIX_LIB32_IN_SELF_RPATH=1" else ""}
     '';
@@ -190,7 +188,7 @@ rec {
     name = "bootstrap-gcc-wrapper";
 
     overrides = pkgs: {
-      inherit (stage1.pkgs) perl binutils paxctl;
+      inherit (stage1.pkgs) perl binutils paxctl gnum4 bison;
       # This also contains the full, dynamically linked, final Glibc.
     };
   };
@@ -207,21 +205,16 @@ rec {
     name = "bootstrap-gcc-wrapper";
 
     overrides = pkgs: rec {
-      inherit (stage2.pkgs) binutils glibc perl patchelf linuxHeaders;
+      inherit (stage2.pkgs) binutils glibc perl patchelf linuxHeaders gnum4 bison;
       # Link GCC statically against GMP etc.  This makes sense because
       # these builds of the libraries are only used by GCC, so it
       # reduces the size of the stdenv closure.
       gmp = pkgs.gmp.override { stdenv = pkgs.makeStaticLibraries pkgs.stdenv; };
       mpfr = pkgs.mpfr.override { stdenv = pkgs.makeStaticLibraries pkgs.stdenv; };
       libmpc = pkgs.libmpc.override { stdenv = pkgs.makeStaticLibraries pkgs.stdenv; };
-      isl_0_11 = pkgs.isl_0_11.override { stdenv = pkgs.makeStaticLibraries pkgs.stdenv; };
-      cloog_0_18_0 = pkgs.cloog_0_18_0.override {
-        stdenv = pkgs.makeStaticLibraries pkgs.stdenv;
-        isl = isl_0_11;
-      };
+      isl_0_14 = pkgs.isl_0_14.override { stdenv = pkgs.makeStaticLibraries pkgs.stdenv; };
       gccPlain = pkgs.gcc.cc.override {
-        isl = isl_0_11;
-        cloog = cloog_0_18_0;
+        isl = isl_0_14;
       };
     };
     extraBuildInputs = [ stage2.pkgs.patchelf stage2.pkgs.paxctl ];
@@ -241,7 +234,7 @@ rec {
       # because gcc (since JAR support) already depends on zlib, and
       # then if we already have a zlib we want to use that for the
       # other purposes (binutils and top-level pkgs) too.
-      inherit (stage3.pkgs) gettext gnum4 gmp perl glibc zlib linuxHeaders;
+      inherit (stage3.pkgs) gettext gnum4 bison gmp perl glibc zlib linuxHeaders;
 
       gcc = lib.makeOverridable (import ../../build-support/cc-wrapper) {
         nativeTools = false;
@@ -310,51 +303,4 @@ rec {
     };
   };
 
-
-  testBootstrapTools = let
-    defaultPkgs = allPackages { inherit system platform; };
-  in derivation {
-    name = "test-bootstrap-tools";
-    inherit system;
-    builder = bootstrapFiles.busybox;
-    args = [ "ash" "-e" "-c" "eval \"$buildCommand\"" ];
-
-    buildCommand = ''
-      export PATH=${bootstrapTools}/bin
-
-      ls -l
-      mkdir $out
-      mkdir $out/bin
-      sed --version
-      find --version
-      diff --version
-      patch --version
-      make --version
-      awk --version
-      grep --version
-      gcc --version
-
-      ldlinux=$(echo ${bootstrapTools}/lib/ld-linux*.so.?)
-      export CPP="cpp -idirafter ${bootstrapTools}/include-glibc -B${bootstrapTools}"
-      export CC="gcc -idirafter ${bootstrapTools}/include-glibc -B${bootstrapTools} -Wl,-dynamic-linker,$ldlinux -Wl,-rpath,${bootstrapTools}/lib"
-      export CXX="g++ -idirafter ${bootstrapTools}/include-glibc -B${bootstrapTools} -Wl,-dynamic-linker,$ldlinux -Wl,-rpath,${bootstrapTools}/lib"
-
-      echo '#include <stdio.h>' >> foo.c
-      echo '#include <limits.h>' >> foo.c
-      echo 'int main() { printf("Hello World\\n"); return 0; }' >> foo.c
-      $CC -o $out/bin/foo foo.c
-      $out/bin/foo
-
-      echo '#include <iostream>' >> bar.cc
-      echo 'int main() { std::cout << "Hello World\\n"; }' >> bar.cc
-      $CXX -v -o $out/bin/bar bar.cc
-      $out/bin/bar
-
-      tar xvf ${defaultPkgs.hello.src}
-      cd hello-*
-      ./configure --prefix=$out
-      make
-      make install
-    '';
-  };
 }
diff --git a/pkgs/stdenv/linux/make-bootstrap-tools.nix b/pkgs/stdenv/linux/make-bootstrap-tools.nix
index 75dc009f5e67..68456942d40f 100644
--- a/pkgs/stdenv/linux/make-bootstrap-tools.nix
+++ b/pkgs/stdenv/linux/make-bootstrap-tools.nix
@@ -164,12 +164,57 @@ rec {
     '';
   };
 
-  test = ((import ./default.nix) {
+  bootstrapFiles = {
+    busybox = "${build}/on-server/busybox";
+    bootstrapTools = "${build}/on-server/bootstrap-tools.tar.xz";
+  };
+
+  bootstrapTools = (import ./default.nix {
+    inherit system bootstrapFiles;
+  }).bootstrapTools;
+
+  test = derivation {
+    name = "test-bootstrap-tools";
     inherit system;
+    builder = bootstrapFiles.busybox;
+    args = [ "ash" "-e" "-c" "eval \"$buildCommand\"" ];
 
-    customBootstrapFiles = {
-      busybox = "${build}/on-server/busybox";
-      bootstrapTools = "${build}/on-server/bootstrap-tools.tar.xz";
-    };
-  }).testBootstrapTools;
+    buildCommand = ''
+      export PATH=${bootstrapTools}/bin
+
+      ls -l
+      mkdir $out
+      mkdir $out/bin
+      sed --version
+      find --version
+      diff --version
+      patch --version
+      make --version
+      awk --version
+      grep --version
+      gcc --version
+
+      ldlinux=$(echo ${bootstrapTools}/lib/ld-linux*.so.?)
+      export CPP="cpp -idirafter ${bootstrapTools}/include-glibc -B${bootstrapTools}"
+      export CC="gcc -idirafter ${bootstrapTools}/include-glibc -B${bootstrapTools} -Wl,-dynamic-linker,$ldlinux -Wl,-rpath,${bootstrapTools}/lib"
+      export CXX="g++ -idirafter ${bootstrapTools}/include-glibc -B${bootstrapTools} -Wl,-dynamic-linker,$ldlinux -Wl,-rpath,${bootstrapTools}/lib"
+
+      echo '#include <stdio.h>' >> foo.c
+      echo '#include <limits.h>' >> foo.c
+      echo 'int main() { printf("Hello World\\n"); return 0; }' >> foo.c
+      $CC -o $out/bin/foo foo.c
+      $out/bin/foo
+
+      echo '#include <iostream>' >> bar.cc
+      echo 'int main() { std::cout << "Hello World\\n"; }' >> bar.cc
+      $CXX -v -o $out/bin/bar bar.cc
+      $out/bin/bar
+
+      tar xvf ${hello.src}
+      cd hello-*
+      ./configure --prefix=$out
+      make
+      make install
+    '';
+  };
 }
diff --git a/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh b/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh
index efec363c5c79..85e74aea89ef 100644
--- a/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh
+++ b/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh
@@ -23,7 +23,7 @@ for i in $out/bin/* $out/libexec/gcc/*/*/*; do
     if [ -z "${i##*/liblto*}" ]; then continue; fi
     echo patching "$i"
     LD_LIBRARY_PATH=$out/lib $LD_BINARY \
-        $out/bin/patchelf --set-interpreter $LD_BINARY --set-rpath $out/lib --force-rpath "$i"
+        ./patchelf --set-interpreter $LD_BINARY --set-rpath $out/lib --force-rpath "$i"
 done
 
 for i in $out/lib/librt-*.so $out/lib/libpcre*; do
diff --git a/pkgs/stdenv/native/default.nix b/pkgs/stdenv/native/default.nix
index bd90d580d3f5..291ef5a5079f 100644
--- a/pkgs/stdenv/native/default.nix
+++ b/pkgs/stdenv/native/default.nix
@@ -16,6 +16,7 @@ rec {
     # Disable purity tests; it's allowed (even needed) to link to
     # libraries outside the Nix store (like the C library).
     export NIX_ENFORCE_PURITY=
+    export NIX_ENFORCE_NO_NATIVE="''${NIX_ENFORCE_NO_NATIVE-1}"
   '';
 
   prehookFreeBSD = ''
diff --git a/pkgs/stdenv/nix/default.nix b/pkgs/stdenv/nix/default.nix
index 30ac92837cba..e58972e5c8a6 100644
--- a/pkgs/stdenv/nix/default.nix
+++ b/pkgs/stdenv/nix/default.nix
@@ -5,7 +5,8 @@ import ../generic rec {
 
   preHook =
     ''
-      export NIX_ENFORCE_PURITY=1
+      export NIX_ENFORCE_PURITY="''${NIX_ENFORCE_PURITY-1}"
+      export NIX_ENFORCE_NO_NATIVE="''${NIX_ENFORCE_NO_NATIVE-1}"
       export NIX_IGNORE_LD_THROUGH_GCC=1
     '';
 
diff --git a/pkgs/tools/filesystems/mtdutils/default.nix b/pkgs/tools/filesystems/mtdutils/default.nix
index 6e54de033d60..ed3850b9fdd6 100644
--- a/pkgs/tools/filesystems/mtdutils/default.nix
+++ b/pkgs/tools/filesystems/mtdutils/default.nix
@@ -1,13 +1,12 @@
-{stdenv, fetchgit, libuuid, lzo, zlib, acl}:
+{ stdenv, fetchurl, libuuid, lzo, zlib, acl }:
 
 stdenv.mkDerivation rec {
   name = "mtd-utils-${version}";
-  version = "1.5.1";
+  version = "1.5.2";
 
-  src = fetchgit {
-    url = git://git.infradead.org/mtd-utils.git;
-    rev = "refs/tags/v" + version;
-    sha256 = "1bjx42pwl789ara63c672chvgvmqhkj4y132gajqih6naq71f8g7";
+  src = fetchurl {
+    url = ftp://ftp.infradead.org/pub/mtd-utils/mtd-utils-1.5.2.tar.bz2;
+    sha256 = "007lhsd8yb34l899r4m37whhzdw815cz4fnjbpnblfha524p7dax";
   };
 
   patchPhase = ''
diff --git a/pkgs/tools/filesystems/udftools/default.nix b/pkgs/tools/filesystems/udftools/default.nix
index 329950f8969b..7cb924c6cf13 100644
--- a/pkgs/tools/filesystems/udftools/default.nix
+++ b/pkgs/tools/filesystems/udftools/default.nix
@@ -10,9 +10,15 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ ncurses readline ];
 
+  NIX_CFLAGS_COMPILE = "-std=gnu90";
+
   preConfigure = ''
     sed -e '1i#include <limits.h>' -i cdrwtool/cdrwtool.c -i pktsetup/pktsetup.c
     sed -e 's@[(]char[*][)]spm [+]=@spm = ((char*) spm) + @' -i wrudf/wrudf.c
+    sed -e '27i#include <string.h>' -i include/udf_endian.h
+    sed -e '38i#include <string.h>' -i wrudf/wrudf-cdrw.c
+    sed -e '12i#include <string.h>' -i wrudf/wrudf-cdr.c
+    sed -e '37i#include <stdlib.h>' -i wrudf/ide-pc.c
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/tools/graphics/netpbm/default.nix b/pkgs/tools/graphics/netpbm/default.nix
index e69a73ff321e..3b9f4e64d07d 100644
--- a/pkgs/tools/graphics/netpbm/default.nix
+++ b/pkgs/tools/graphics/netpbm/default.nix
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
     touch lib/standardppmdfont.c
   '';
 
-  enableParallelBuilding = true;
+  enableParallelBuilding = false;
 
   installPhase = ''
     make package pkgdir=$out
diff --git a/pkgs/tools/misc/findutils/change_echo_path.patch b/pkgs/tools/misc/findutils/change_echo_path.patch
deleted file mode 100644
index 5bbd9aea9ac3..000000000000
--- a/pkgs/tools/misc/findutils/change_echo_path.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -Naur findutils-4.2.30/xargs/xargs.c findutils-4.2.30_new/xargs/xargs.c
---- findutils-4.2.30/xargs/xargs.c	2007-02-27 11:21:08.000000000 +0100
-+++ findutils-4.2.30_new/xargs/xargs.c	2007-07-17 19:02:05.000000000 +0200
-@@ -402,7 +402,7 @@
-   int show_limits = 0;			/* --show-limits */
-   int always_run_command = 1;
-   char *input_file = "-"; /* "-" is stdin */
--  char *default_cmd = "/bin/echo";
-+  char *default_cmd = "echo";
-   int (*read_args) PARAMS ((void)) = read_line;
-   void (*act_on_init_result)(void) = noop;
-   int env_too_big = 0;
diff --git a/pkgs/tools/misc/findutils/default.nix b/pkgs/tools/misc/findutils/default.nix
index 16d53c9f436a..b6ab3985f239 100644
--- a/pkgs/tools/misc/findutils/default.nix
+++ b/pkgs/tools/misc/findutils/default.nix
@@ -1,27 +1,23 @@
-{stdenv, fetchurl, coreutils}:
+{ stdenv, fetchurl, coreutils }:
 
 stdenv.mkDerivation rec {
-  name = "findutils-4.4.2";
+  name = "findutils-4.6.0";
 
   src = fetchurl {
     url = "mirror://gnu/findutils/${name}.tar.gz";
-    sha256 = "0amn0bbwqvsvvsh6drfwz20ydc2czk374lzw5kksbh6bf78k4ks3";
+    sha256 = "178nn4dl7wbcw499czikirnkniwnx36argdnqgz4ik9i6zvwkm6y";
   };
 
-  nativeBuildInputs = [coreutils];
+  nativeBuildInputs = [ coreutils ];
 
-  patches = [ ./findutils-path.patch ./change_echo_path.patch ./disable-test-canonicalize.patch ];
-
-  doCheck = true;
+  doCheck = !stdenv.isDarwin;
 
   crossAttrs = {
     # http://osdir.com/ml/bug-findutils-gnu/2009-08/msg00026.html
     configureFlags = [ "gl_cv_func_wcwidth_works=yes" ];
   };
 
-  preConfigure = if stdenv.isCygwin then ''
-    sed -i gnulib/lib/fpending.h -e '/include <stdio_ext.h>/d'
-  '' else null;
+  enableParallelBuilding = true;
 
   meta = {
     homepage = http://www.gnu.org/software/findutils/;
diff --git a/pkgs/tools/misc/findutils/disable-test-canonicalize.patch b/pkgs/tools/misc/findutils/disable-test-canonicalize.patch
deleted file mode 100644
index 3a8d42eb5607..000000000000
--- a/pkgs/tools/misc/findutils/disable-test-canonicalize.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -ruN findutils-4.4.2/tests/test-canonicalize.sh findutils-4.4.2_edited/tests/test-canonicalize.sh
---- findutils-4.4.2/tests/test-canonicalize.sh	2008-12-23 12:50:15.000000000 +0000
-+++ findutils-4.4.2_edited/tests/test-canonicalize.sh	2015-06-14 10:51:19.000000000 +0000
-@@ -1,5 +1,8 @@
- #!/bin/sh
- 
-+# skipped because user might not have directory listing permission for all parents of TMPDIR
-+exit 77
-+
- tmpfiles=""
- trap 'rm -fr $tmpfiles' 1 2 3 15
- 
diff --git a/pkgs/tools/misc/findutils/findutils-path.patch b/pkgs/tools/misc/findutils/findutils-path.patch
deleted file mode 100644
index be8d85be3033..000000000000
--- a/pkgs/tools/misc/findutils/findutils-path.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -ruN findutils-4.2.20/locate/updatedb.sh findutils-4.2.20.new/locate/updatedb.sh
---- findutils-4.2.20/locate/updatedb.sh	2005-01-24 17:12:35.000000000 +0100
-+++ findutils-4.2.20.new/locate/updatedb.sh	2005-08-23 14:37:10.000000000 +0200
-@@ -141,7 +141,7 @@
- : ${code:=${LIBEXECDIR}/@code@}
- 
- 
--PATH=/bin:/usr/bin:${BINDIR}; export PATH
-+PATH=/bin:/usr/bin:${BINDIR}:${PATH}; export PATH
- 
- : ${PRUNEFS="nfs NFS proc afs proc smbfs autofs iso9660 ncpfs coda devpts ftpfs devfs mfs sysfs shfs"}
- 
diff --git a/pkgs/tools/misc/ipxe/default.nix b/pkgs/tools/misc/ipxe/default.nix
index e4c161b2e51c..4346d25ca07c 100644
--- a/pkgs/tools/misc/ipxe/default.nix
+++ b/pkgs/tools/misc/ipxe/default.nix
@@ -18,6 +18,8 @@ stdenv.mkDerivation {
 
   preConfigure = "cd src";
 
+  NIX_CFLAGS_COMPILE = "-Wno-error";
+
   makeFlags =
     [ "ECHO_E_BIN_ECHO=echo" "ECHO_E_BIN_ECHO_E=echo" # No /bin/echo here.
       "ISOLINUX_BIN_LIST=${syslinux}/share/syslinux/isolinux.bin"
diff --git a/pkgs/tools/misc/yad/default.nix b/pkgs/tools/misc/yad/default.nix
index d884d48f5214..2c8660a49139 100644
--- a/pkgs/tools/misc/yad/default.nix
+++ b/pkgs/tools/misc/yad/default.nix
@@ -13,10 +13,18 @@ stdenv.mkDerivation rec {
     "--enable-icon-browser"
   ];
 
+  # for gcc5: c11 inline semantics breaks the build
+  NIX_CFLAGS_COMPILE = "-fgnu89-inline";
+
   buildInputs = [ gtk2 ];
 
   nativeBuildInputs = [ pkgconfig intltool ];
 
+  postPatch = ''
+    sed -i src/file.c -e '21i#include <glib/gprintf.h>'
+    sed -i src/form.c -e '21i#include <stdlib.h>'
+  '';
+
   preFixup = "rm $out/share/icons/hicolor/icon-theme.cache";
 
   meta = {
diff --git a/pkgs/tools/networking/atftp/default.nix b/pkgs/tools/networking/atftp/default.nix
index eda7f7168760..5fff72a3b075 100644
--- a/pkgs/tools/networking/atftp/default.nix
+++ b/pkgs/tools/networking/atftp/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchurl, readline, tcp_wrappers, pcre, makeWrapper }:
+{ lib, stdenv, fetchurl, readline, tcp_wrappers, pcre, makeWrapper, gcc }:
 assert stdenv.isLinux;
 assert stdenv.cc.isGNU;
 let
@@ -15,7 +15,7 @@ stdenv.mkDerivation {
     url = "mirror://debian/pool/main/a/atftp/atftp_${version}.dfsg.orig.tar.gz";
     sha256 = "0nd5dl14d6z5abgcbxcn41rfn3syza6s57bbgh4aq3r9cxdmz08q";
   };
-  buildInputs = [ readline tcp_wrappers pcre makeWrapper ];
+  buildInputs = [ readline tcp_wrappers pcre makeWrapper gcc ];
   patches = [ debianPatch ];
   postInstall = ''
     wrapProgram $out/sbin/atftpd --prefix LD_LIBRARY_PATH : ${stdenv.cc.cc}/lib${if stdenv.system == "x86_64-linux" then "64" else ""}
diff --git a/pkgs/tools/networking/cadaver/default.nix b/pkgs/tools/networking/cadaver/default.nix
index a6752606da69..6bc96a5b8c72 100644
--- a/pkgs/tools/networking/cadaver/default.nix
+++ b/pkgs/tools/networking/cadaver/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, openssl }:
+{ stdenv, fetchurl, fetchpatch, openssl }:
 
 stdenv.mkDerivation rec {
   name = "cadaver-0.23.3";
@@ -8,11 +8,20 @@ stdenv.mkDerivation rec {
     sha256 = "1jizq69ifrjbjvz5y79wh1ny94gsdby4gdxwjad4bfih6a5fck7x";
   };
 
-  buildInputs = [openssl];
-  configureFlags = ["--with-ssl"];
+  patches = [
+    (fetchpatch {
+      url = https://projects.archlinux.org/svntogit/community.git/plain/trunk/disable-sslv2.patch?h=packages/cadaver;
+      name = "disable-sslv2.patch";
+      sha256 = "1qx65hv584wdarks51yhd3y38g54affkphm5wz27xiz4nhmbssrr";
+    })
+  ];
+
+  configureFlags = "--with-ssl";
+
+  buildInputs = [ openssl ];
 
   meta = with stdenv.lib; {
-    description = "A command-line WebDAV client for Unix";
+    description = "A command-line WebDAV client";
     homepage    = http://www.webdav.org/cadaver;
     maintainers = with maintainers; [ ianwookim ];
     license     = licenses.gpl2;
diff --git a/pkgs/tools/networking/curl/7.15.nix b/pkgs/tools/networking/curl/7.15.nix
index 356c9b4f32d2..56046d5423dd 100644
--- a/pkgs/tools/networking/curl/7.15.nix
+++ b/pkgs/tools/networking/curl/7.15.nix
@@ -74,5 +74,6 @@ stdenv.mkDerivation rec {
     homepage = "http://curl.haxx.se/";
     description = "A command line tool for transferring files with URL syntax";
     platforms = with stdenv.lib.platforms; allBut darwin;
+    broken = true;
   };
 }
diff --git a/pkgs/tools/networking/eggdrop/b34a33255f56bbd2317c26da12d702796d67ed50.patch b/pkgs/tools/networking/eggdrop/b34a33255f56bbd2317c26da12d702796d67ed50.patch
new file mode 100644
index 000000000000..03277838e887
--- /dev/null
+++ b/pkgs/tools/networking/eggdrop/b34a33255f56bbd2317c26da12d702796d67ed50.patch
@@ -0,0 +1,36 @@
+From b34a33255f56bbd2317c26da12d702796d67ed50 Mon Sep 17 00:00:00 2001
+From: Geo Van Osterom <george.vo@alum.rpi.edu>
+Date: Thu, 22 Oct 2015 00:12:42 -0400
+Subject: [PATCH] Fix gcc 5 compile errors
+
+---
+ src/net.c     | 2 +-
+ src/tclhash.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/net.c b/src/net.c
+index a1937de..c369fda 100644
+--- a/src/net.c
++++ b/src/net.c
+@@ -560,7 +560,7 @@ int open_address_listen(sockname_t *addr)
+ /* Returns a socket number for a listening socket that will accept any
+  * connection -- port # is returned in port
+  */
+-inline int open_listen(int *port)
++extern inline int open_listen(int *port)
+ {
+   int sock;
+   sockname_t name;
+diff --git a/src/tclhash.c b/src/tclhash.c
+index 9729acb..22c3d05 100644
+--- a/src/tclhash.c
++++ b/src/tclhash.c
+@@ -113,7 +113,7 @@ static inline void tcl_bind_list_delete(tcl_bind_list_t *tl)
+   nfree(tl);
+ }
+
+-inline void garbage_collect_tclhash(void)
++extern inline void garbage_collect_tclhash(void)
+ {
+   tcl_bind_list_t *tl, *tl_next, *tl_prev;
+   tcl_bind_mask_t *tm, *tm_next, *tm_prev;
diff --git a/pkgs/tools/networking/eggdrop/default.nix b/pkgs/tools/networking/eggdrop/default.nix
index cf7fb20df68b..623b42d6fc1b 100644
--- a/pkgs/tools/networking/eggdrop/default.nix
+++ b/pkgs/tools/networking/eggdrop/default.nix
@@ -11,6 +11,11 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ tcl ];
 
+  patches = [
+    # https://github.com/eggheads/eggdrop/issues/123
+    ./b34a33255f56bbd2317c26da12d702796d67ed50.patch
+  ];
+
   preConfigure = ''
     prefix=$out/eggdrop
     mkdir -p $prefix
diff --git a/pkgs/tools/networking/pingtcp/default.nix b/pkgs/tools/networking/pingtcp/default.nix
index 4d99eaaeff66..a1b1f549ee4a 100644
--- a/pkgs/tools/networking/pingtcp/default.nix
+++ b/pkgs/tools/networking/pingtcp/default.nix
@@ -13,11 +13,6 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  postPatch = ''
-    substituteInPlace {.,pfcquirks}/CMakeLists.txt \
-      --replace "-march=native" ""
-  '';
-
   enableParallelBuilding = true;
 
   doCheck = false;
diff --git a/pkgs/tools/security/crackxls/default.nix b/pkgs/tools/security/crackxls/default.nix
index c8ea45a39dbe..f4c92ac701f4 100644
--- a/pkgs/tools/security/crackxls/default.nix
+++ b/pkgs/tools/security/crackxls/default.nix
@@ -13,12 +13,6 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ pkgconfig autoconf automake openssl libgsf gmp ];
 
-  patchPhase = ''
-    substituteInPlace Makefile.in \
-      --replace '-march=native' "" \
-      --replace '-mtune=native' ""
-  '';
-
   installPhase =
   ''
     mkdir -p $out/bin
diff --git a/pkgs/tools/security/haka/default.nix b/pkgs/tools/security/haka/default.nix
index d040aaa6aea8..8f856213e8cf 100644
--- a/pkgs/tools/security/haka/default.nix
+++ b/pkgs/tools/security/haka/default.nix
@@ -13,6 +13,8 @@ stdenv.mkDerivation rec {
     sha1 = "87625ed32841cc0b3aa92aa49397ce71ce434bc2";
   };
 
+  NIX_CFLAGS_COMPILE = "-Wno-error";
+
   preConfigure = ''
     sed -i 's,/etc,'$out'/etc,' src/haka/haka.c
     sed -i 's,/etc,'$out'/etc,' src/haka/CMakeLists.txt
diff --git a/pkgs/tools/security/tpm-tools/03-fix-bool-error-parseStringWithValues.patch b/pkgs/tools/security/tpm-tools/03-fix-bool-error-parseStringWithValues.patch
new file mode 100644
index 000000000000..87f7b8e815b3
--- /dev/null
+++ b/pkgs/tools/security/tpm-tools/03-fix-bool-error-parseStringWithValues.patch
@@ -0,0 +1,30 @@
+Title: Fix boolean comparison error (and FTBFS with gcc-5)
+Date: 2015-06-28
+Author: Pierre Chifflier <pollux@debian.org>
+Bug-Debian: http://bugs.debian.org/778147
+Index: tpm-tools/src/tpm_mgmt/tpm_nvcommon.c
+===================================================================
+--- tpm-tools.orig/src/tpm_mgmt/tpm_nvcommon.c
++++ tpm-tools/src/tpm_mgmt/tpm_nvcommon.c
+@@ -140,8 +140,8 @@ int parseStringWithValues(const char *aA
+						 aArg);
+					return -1;
+				}
+-				if (!aArg[offset+numbytes] == '|' &&
+-				    !aArg[offset+numbytes] == 0) {
++				if (!(aArg[offset+numbytes] == '|' ||
++				      aArg[offset+numbytes] == 0)) {
+					logError(_("Illegal character following "
+                                                    "hexadecimal number in %s\n"),
+						 aArg + offset);
+@@ -164,8 +164,8 @@ int parseStringWithValues(const char *aA
+				return -1;
+			}
+
+-			if (!aArg[offset+numbytes] == '|' &&
+-			    !aArg[offset+numbytes] == 0) {
++			if (!(aArg[offset+numbytes] == '|' ||
++			      aArg[offset+numbytes] == 0)) {
+				logError(_("Illegal character following decimal "
+				           "number in %s\n"),
+					 aArg + offset);
diff --git a/pkgs/tools/security/tpm-tools/default.nix b/pkgs/tools/security/tpm-tools/default.nix
index a17bff9e32c8..264beae9dc4b 100644
--- a/pkgs/tools/security/tpm-tools/default.nix
+++ b/pkgs/tools/security/tpm-tools/default.nix
@@ -13,6 +13,8 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ trousers openssl opencryptoki ];
 
+  patches = [ ./03-fix-bool-error-parseStringWithValues.patch ];
+
   meta = with stdenv.lib; {
     description = "Management tools for TPM hardware";
     longDescription = ''
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 67c547e0f059..380b698236f1 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -112,7 +112,7 @@ in
       postUnpackHooks+=(_ensureNewerSources)
       _ensureNewerSources() {
         '${findutils}/bin/find' "$sourceRoot" \
-          '!' -newermt '${year}-01-01' -exec touch -d '${year}-01-02' '{}' '+'
+          '!' -newermt '${year}-01-01' -exec touch -h -d '${year}-01-02' '{}' '+'
       }
     '');
 
@@ -506,7 +506,9 @@ in
 
   at = callPackage ../tools/system/at { };
 
-  atftp = callPackage ../tools/networking/atftp {};
+  atftp = callPackage ../tools/networking/atftp {
+    gcc = gcc49;
+  };
 
   autogen = callPackage ../development/tools/misc/autogen { };
 
@@ -2085,12 +2087,10 @@ in
 
   nodejs-5_x = callPackage ../development/web/nodejs/v5.nix {
     libtool = darwin.cctools;
-    openssl = openssl_1_0_2;
   };
 
   nodejs-4_x = callPackage ../development/web/nodejs/v4.nix {
     libtool = darwin.cctools;
-    openssl = openssl_1_0_2;
   };
 
   nodejs-0_10 = callPackage ../development/web/nodejs/v0_10.nix {
@@ -3889,7 +3889,9 @@ in
 
   avra = callPackage ../development/compilers/avra { };
 
-  bigloo = callPackage ../development/compilers/bigloo { };
+  bigloo = callPackage ../development/compilers/bigloo {
+    stdenv = overrideCC stdenv gcc49;
+  };
 
   boo = callPackage ../development/compilers/boo {
     inherit (gnome) gtksourceview;
@@ -3976,7 +3978,7 @@ in
 
   gambit = callPackage ../development/compilers/gambit { };
 
-  gcc = gcc49;
+  gcc = gcc5;
 
   gcc_multi =
     if system == "x86_64-linux" then lowPrio (
@@ -4037,13 +4039,6 @@ in
     cross = crossSystem;
   };
 
-  gcc44 = lowPrio (wrapCC (makeOverridable (import ../development/compilers/gcc/4.4) {
-    inherit fetchurl stdenv gmp mpfr /* ppl cloogppl */
-      gettext which noSysDirs;
-    texinfo = texinfo4;
-    profiledCompiler = true;
-  }));
-
   gcc45 = lowPrio (wrapCC (callPackage ../development/compilers/gcc/4.5 {
     inherit noSysDirs;
     texinfo = texinfo4;
@@ -4127,7 +4122,7 @@ in
     isl = isl_0_14;
   }));
 
-  gfortran = if !stdenv.isDarwin then gfortran49
+  gfortran = if !stdenv.isDarwin then gfortran5
              else callPackage ../development/compilers/gcc/gfortran-darwin.nix {
     inherit (darwin) Libsystem;
   };
@@ -4148,6 +4143,14 @@ in
     profiledCompiler = false;
   });
 
+  gfortran5 = wrapCC (gcc5.cc.override {
+    name = "gfortran";
+    langFortran = true;
+    langCC = false;
+    langC = false;
+    profiledCompiler = false;
+  });
+
   gcj = gcj49;
   gcj49 = wrapCC (gcc49.cc.override {
     name = "gcj";
@@ -4199,17 +4202,6 @@ in
     profiledCompiler = false;
   });
 
-  ghdl = wrapCC (import ../development/compilers/gcc/4.3 {
-    inherit stdenv fetchurl gmp mpfr noSysDirs gnat;
-    texinfo = texinfo4;
-    name = "ghdl";
-    langVhdl = true;
-    langCC = false;
-    langC = false;
-    profiledCompiler = false;
-    enableMultilib = false;
-  });
-
   ghdl_mcode = callPackage ../development/compilers/ghdl { };
 
   gcl = callPackage ../development/compilers/gcl {
@@ -5621,7 +5613,9 @@ in
 
   avrdude = callPackage ../development/tools/misc/avrdude { };
 
-  avarice = callPackage ../development/tools/misc/avarice { };
+  avarice = callPackage ../development/tools/misc/avarice {
+    gcc = gcc49;
+  };
 
   babeltrace = callPackage ../development/tools/misc/babeltrace { };
 
@@ -8252,7 +8246,7 @@ in
 
   wolfssl = callPackage ../development/libraries/wolfssl { };
 
-  openssl = openssl_1_0_1;
+  openssl = openssl_1_0_2;
 
   inherit (callPackages ../development/libraries/openssl {
       fetchurl = fetchurlBoot;
@@ -11404,6 +11398,7 @@ in
   afterstep = callPackage ../applications/window-managers/afterstep {
     fltk = fltk13;
     gtk = gtk2;
+    stdenv = overrideCC stdenv gcc49;
   };
 
   ahoviewer = callPackage ../applications/graphics/ahoviewer { };
@@ -15331,7 +15326,9 @@ in
     motif = lesstif;
   };
 
-  archimedes = callPackage ../applications/science/electronics/archimedes { };
+  archimedes = callPackage ../applications/science/electronics/archimedes {
+    stdenv = overrideCC stdenv gcc49;
+  };
 
   emboss = callPackage ../applications/science/biology/emboss { };
 
diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix
index 8870565701a4..c7b9b43d8809 100644
--- a/pkgs/top-level/perl-packages.nix
+++ b/pkgs/top-level/perl-packages.nix
@@ -1436,7 +1436,7 @@ let self = _self // overrides; _self = with self; {
       sha256 = "1297d3ed6616cacb4eb57860e3e743f3890111e7a63ca08849930f42f1360532";
     };
     buildInputs = [ TestDeep TestWarn ];
-    propagatedBuildInputs = [ HTMLParser self."if" ];
+    propagatedBuildInputs = [ HTMLParser ];
     meta = {
       homepage = https://metacpan.org/module/CGI;
       description = "Handle Common Gateway Interface requests and responses";
@@ -1733,6 +1733,11 @@ let self = _self // overrides; _self = with self; {
       url = "mirror://cpan/authors/id/D/DR/DROLSKY/${name}.tar.gz";
       sha256 = "09ifd6v0c94vr20n9yr1dxgcp7hyscqq851szdip7y24bd26nlbc";
     };
+    buildInputs = [ ModuleBuild ];
+    meta = {
+      description = "Provide utility methods for factory classes";
+      license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
+    };
   };
 
   ClassInspector = buildPerlPackage {
@@ -3036,7 +3041,8 @@ let self = _self // overrides; _self = with self; {
       url = mirror://cpan/authors/id/D/DR/DROLSKY/DateTime-Format-ICal-0.09.tar.gz;
       sha256 = "8b09f6539f5e9c0df0e6135031699ed4ef9eef8165fc80aefeecc817ef997c33";
     };
-    propagatedBuildInputs = [ DateTime DateTimeEventICal DateTimeSet DateTimeTimeZone ParamsValidate ];
+    buildInputs = [ ModuleBuild ];
+    propagatedBuildInputs = [ DateTime DateTimeEventICal DateTimeSet DateTimeTimeZone ];
     meta = {
       description = "Parse and format iCal datetime and duration strings";
       license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
@@ -3199,7 +3205,7 @@ let self = _self // overrides; _self = with self; {
       url = mirror://cpan/authors/id/R/RO/ROKR/DateTimeX-Easy-0.089.tar.gz;
       sha256 = "17e6d202e7ac6049523048e97bb8f195e3c79208570da1504f4313584e487a79";
     };
-    buildInputs = [ TestMost ];
+    buildInputs = [ TestMost ModuleBuild ];
     propagatedBuildInputs = [ DateTime DateTimeFormatFlexible DateTimeFormatICal DateTimeFormatNatural TimeDate ];
     doCheck = false;
     meta = {
@@ -3243,6 +3249,15 @@ let self = _self // overrides; _self = with self; {
     propagatedBuildInputs = [ IOCaptureOutput ];
   };
 
+  DevelCheckOS = buildPerlPackage rec {
+    name = "Devel-CheckOS-1.76";
+    src = fetchurl {
+      url = "mirror://cpan/authors/id/D/DC/DCANTRELL/${name}.tar.gz";
+      sha256 = "f83fb4cb8de060f607214b1e88c98ac6c4e065371e646fe896f16ea887aecb0c";
+    };
+    propagatedBuildInputs = [ DataCompare FileFindRule ];
+  };
+
   DevelDProf = buildPerlPackage {
     name = "Devel-DProf-20110802.00";
     src = fetchurl {
@@ -3638,14 +3653,15 @@ let self = _self // overrides; _self = with self; {
   };
 
   DevelSymdump = buildPerlPackage rec {
-    name = "Devel-Symdump-2.11";
+    name = "Devel-Symdump-2.15";
     src = fetchurl {
       url = "mirror://cpan/authors/id/A/AN/ANDK/${name}.tar.gz";
-      sha256 = "0i5m2w8rsmp5lqi1y5y6b6938pidpz9hg92xahrshaddph00358i";
+      sha256 = "76c2a90d31318204ecf1977f0217ce57b142e6681fe2b99fb8789efc5dd86f41";
+    };
+    meta = {
+      description = "Dump symbol names or the symbol table";
+      license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
     };
-    propagatedBuildInputs = [
-      TestPod /* cyclic dependency: TestPodCoverage */
-    ];
   };
 
   Digest = buildPerlPackage {
@@ -5983,18 +5999,7 @@ let self = _self // overrides; _self = with self; {
     };
   };
 
-  "if" = buildPerlPackage rec {
-    name = "if-0.0606";
-    src = fetchurl {
-      url = "mirror://cpan/authors/id/R/RJ/RJBS/${name}.tar.gz";
-      sha256 = "63d69282d6c4c9e76370b78d770ca720cea88cfe5ee5b612709240fc6078d50e";
-    };
-    meta = {
-      description = "C<use> a Perl module if a condition holds (also can C<no> a module)";
-      license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
-      maintainers = [ maintainers.rycee ];
-    };
-  };
+  "if" = null;
 
   # For backwards compatibility.
   if_ = self."if";
@@ -6727,13 +6732,15 @@ let self = _self // overrides; _self = with self; {
     };
   };
 
-  ListMoreUtils = buildPerlPackage {
-    name = "List-MoreUtils-0.33";
+  ListMoreUtils = buildPerlPackage rec {
+    name = "List-MoreUtils-0.413";
     src = fetchurl {
-      url = mirror://cpan/authors/id/A/AD/ADAMK/List-MoreUtils-0.33.tar.gz;
-      sha256 = "1bcljhhsk5g0xykvgbxz10ilmj02s58ydiy3g8hbzdr29i20np1i";
+      url = "mirror://cpan/authors/id/R/RE/REHSACK/${name}.tar.gz";
+      sha256 = "4d6429d5672ce74a59d6490320252cb8b5b8285db8fe9c6551a4162e5375ef37";
     };
+    propagatedBuildInputs = [ ExporterTiny ];
     meta = {
+      homepage = https://metacpan.org/release/List-MoreUtils;
       description = "Provide the stuff missing in List::Util";
       license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
     };
@@ -7647,11 +7654,11 @@ let self = _self // overrides; _self = with self; {
     };
   };
 
-  ModulePluggable = buildPerlPackage {
-    name = "Module-Pluggable-5.1";
+  ModulePluggable = buildPerlPackage rec {
+    name = "Module-Pluggable-5.2";
     src = fetchurl {
-      url = mirror://cpan/authors/id/S/SI/SIMONW/Module-Pluggable-5.1.tar.gz;
-      sha256 = "0vwi433pk7n1ia5wy67j3545jvmjf1hb4jwcvzrz25mv8d03bp72";
+      url = "mirror://cpan/authors/id/S/SI/SIMONW/${name}.tar.gz";
+      sha256 = "b3f2ad45e4fd10b3fb90d912d78d8b795ab295480db56dc64e86b9fa75c5a6df";
     };
     patches = [
       # !!! merge this patch into Perl itself (which contains Module::Pluggable as well)
@@ -7691,6 +7698,7 @@ let self = _self // overrides; _self = with self; {
       url = mirror://cpan/authors/id/Z/ZE/ZEFRAM/Module-Runtime-0.014.tar.gz;
       sha256 = "19326f094jmjs6mgpwkyisid54k67w34br8yfh0gvaaml87gwi2c";
     };
+    buildInputs = [ ModuleBuild ];
     meta = {
       homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
       description = "Runtime module handling";
@@ -8099,15 +8107,16 @@ let self = _self // overrides; _self = with self; {
     };
   };
 
-  MooseXDaemonize = buildPerlPackage {
-    name = "MooseX-Daemonize-0.15";
+  MooseXDaemonize = buildPerlPackage rec {
+    name = "MooseX-Daemonize-0.21";
     src = fetchurl {
-      url = mirror://cpan/authors/id/M/MI/MICHAELR/MooseX-Daemonize-0.15.tar.gz;
-      sha256 = "1h6rzdmk68q4p0nh2bzmwwvr5iaf7pvdfrpwdxmr3z5pc64wajvd";
+      url = "mirror://cpan/authors/id/E/ET/ETHER/${name}.tar.gz";
+      sha256 = "111f391221d00f8b09cdcc6c806ab114324cf7f529d12f627fb97d054da42225";
     };
-    buildInputs = [ TestMoose ];
-    propagatedBuildInputs = [ Moose MooseXGetopt MooseXTypesPathClass ];
+    buildInputs = [ DevelCheckOS ModuleBuildTiny Moose TestFatal ];
+    propagatedBuildInputs = [ Moose MooseXGetopt MooseXTypesPathClass namespaceautoclean ];
     meta = {
+      homepage = https://github.com/moose/MooseX-Daemonize;
       description = "Role for daemonizing your Moose based application";
       license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
     };
@@ -8390,7 +8399,7 @@ let self = _self // overrides; _self = with self; {
       url = "mirror://cpan/authors/id/E/ET/ETHER/${name}.tar.gz";
       sha256 = "e9e8c36284cf1adc6563c980c0a4f0a7df720dbaaece0dd6be66b975dde5db7a";
     };
-    buildInputs = [ ModuleBuildTiny Moose TestFatal TestRequires self."if" ];
+    buildInputs = [ ModuleBuildTiny Moose TestFatal TestRequires ];
     propagatedBuildInputs = [ CarpClan Moose SubExporterForMethods SubName namespaceautoclean ];
     meta = {
       homepage = https://github.com/moose/MooseX-Types;
@@ -8407,7 +8416,7 @@ let self = _self // overrides; _self = with self; {
       sha256 = "ff0c963f5e8304acb5f64bdf9ba1f19284311148e1a8f0d1f81f123f9950f5f2";
     };
     buildInputs = [ ModuleBuildTiny TestDeep TestWarnings perl ];
-    propagatedBuildInputs = [ MooseXTypes self."if" ];
+    propagatedBuildInputs = [ MooseXTypes ];
     meta = {
       homepage = https://github.com/moose/MooseX-Types-Common;
       description = "A library of commonly used type constraints";
@@ -9712,13 +9721,11 @@ let self = _self // overrides; _self = with self; {
     };
   };
 
-  PadWalker = buildPerlPackage {
-    name = "PadWalker-1.98";
+  PadWalker = buildPerlPackage rec {
+    name = "PadWalker-2.2";
     src = fetchurl {
-      url = mirror://cpan/authors/id/R/RO/ROBIN/PadWalker-1.98.tar.gz;
-      sha256 = "0v2pldb5awflf10w1p9pwn8w37lkpfc2h459gd9zz6p57883ibw0";
-    };
-    meta = {
+      url = "mirror://cpan/authors/id/R/RO/ROBIN/${name}.tar.gz";
+      sha256 = "fc1df2084522e29e892da393f3719d2c1be0da022fdd89cff4b814167aecfea3";
     };
   };
 
@@ -10516,22 +10523,20 @@ let self = _self // overrides; _self = with self; {
   };
 
   SQLTranslator = buildPerlPackage rec {
-    name = "SQL-Translator-0.11020";
+    name = "SQL-Translator-0.11021";
     src = fetchurl {
       url = "mirror://cpan/authors/id/I/IL/ILMARI/${name}.tar.gz";
-      sha256 = "18mqnppwk1076sxcink5ajk75ysway0bd049hwxvk8md39x0y7ar";
+      sha256 = "64cb38a9f78367bc115359a999003bbeb3c32cc75bba8306ec1a938fc441bfd1";
     };
-    propagatedBuildInputs = [
-      ClassBase ClassDataInheritable ClassMakeMethods DigestSHA1 CarpClan IOStringy
-      ParseRecDescent ClassAccessor DBI FileShareDir XMLWriter YAML TestDifferences
-      TemplateToolkit GraphViz XMLLibXML TestPod TextRecordParser HTMLParser
-      SpreadsheetParseExcel Graph GD Moo TryTiny PackageVariant
-    ];
+    buildInputs = [ JSON TestDifferences TestException XMLWriter YAML ];
+    propagatedBuildInputs = [ CarpClan DBI FileShareDir ListMoreUtils Moo PackageVariant ParseRecDescent TryTiny ];
     meta = {
+      description = "SQL DDL transformations and more";
+      license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
       platforms = stdenv.lib.platforms.linux;
     };
   };
-  
+
   PackageVariant = buildPerlPackage {
     name = "Package-Variant-1.002002";
     src = fetchurl {
@@ -11770,17 +11775,17 @@ let self = _self // overrides; _self = with self; {
     };
   };
 
-  TestMemoryCycle = buildPerlPackage {
-    name = "Test-Memory-Cycle-1.04";
+  TestMemoryCycle = buildPerlPackage rec {
+    name = "Test-Memory-Cycle-1.06";
     src = fetchurl {
-      url = mirror://cpan/authors/id/P/PE/PETDANCE/Test-Memory-Cycle-1.04.tar.gz;
-      sha256 = "09qj48gmj25xgm0k12n1xx7chdk9gdy3sck4pabvzs0v00nmv9p5";
+      url = "mirror://cpan/authors/id/P/PE/PETDANCE/${name}.tar.gz";
+      sha256 = "9d53ddfdc964cd8454cb0da4c695b6a3ae47b45839291c34cb9d8d1cfaab3202";
     };
     propagatedBuildInputs = [ DevelCycle PadWalker ];
     meta = {
       description = "Verifies code hasn't left circular references";
       maintainers = with maintainers; [ ocharles ];
-      platforms   = stdenv.lib.platforms.unix;
+      platforms = stdenv.lib.platforms.unix;
     };
   };
 
@@ -11812,13 +11817,18 @@ let self = _self // overrides; _self = with self; {
     };
   };
 
-  TestMockObject = buildPerlPackage {
-    name = "Test-MockObject-1.09";
+  TestMockObject = buildPerlPackage rec {
+    name = "Test-MockObject-1.20150527";
     src = fetchurl {
-      url = mirror://cpan/authors/id/C/CH/CHROMATIC/Test-MockObject-1.09.tar.gz;
-      sha256 = "1cz385x0jrkj84nmfs6qyzwwvv8m9v8r2isagfj1zxvhdw49wdyy";
+      url = "mirror://cpan/authors/id/C/CH/CHROMATIC/${name}.tar.gz";
+      sha256 = "adf1357a9014b3a397ff7ecbf1835dec376a67a37bb2e788734a627e17dc1d98";
+    };
+    buildInputs = [ TestException TestWarn CGI ];
+    propagatedBuildInputs = [ UNIVERSALcan UNIVERSALisa ];
+    meta = {
+      description = "Perl extension for emulating troublesome interfaces";
+      license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
     };
-    propagatedBuildInputs = [TestException UNIVERSALisa UNIVERSALcan];
   };
 
   TestMoose = Moose;
@@ -12147,7 +12157,7 @@ let self = _self // overrides; _self = with self; {
       url = "mirror://cpan/authors/id/E/ET/ETHER/${name}.tar.gz";
       sha256 = "ae2b68b1b5616704598ce07f5118efe42dc4605834453b7b2be14e26f9cc9a08";
     };
-    buildInputs = [ TestTester CPANMetaCheck ModuleMetadata self."if" ];
+    buildInputs = [ TestTester CPANMetaCheck ModuleMetadata ];
     meta = {
       homepage = https://github.com/karenetheridge/Test-Warnings;
       description = "Test for warnings and the lack of them";
@@ -12176,6 +12186,7 @@ let self = _self // overrides; _self = with self; {
       url = mirror://cpan/authors/id/P/PE/PETDANCE/Test-WWW-Mechanize-1.44.tar.gz;
       sha256 = "062pj242vsc73bw11jqpap92ax9wzc9f2m4xhyp1wzrwkfchpl2q";
     };
+    buildInputs = [ CGI ];
     propagatedBuildInputs = [ CarpAssertMore HTMLTree HTTPServerSimple LWP TestLongString URI WWWMechanize ];
     meta = {
       homepage = https://github.com/petdance/test-www-mechanize;
@@ -12218,7 +12229,7 @@ let self = _self // overrides; _self = with self; {
       url = mirror://cpan/authors/id/L/LB/LBROCARD/Test-WWW-Mechanize-PSGI-0.35.tar.gz;
       sha256 = "1hih8s49zf38bisvhnhzrrj0zwyiivkrbs7nmmdqm1qqy27wv7pc";
     };
-    buildInputs = [ TestPod ];
+    buildInputs = [ TestPod CGI ];
     propagatedBuildInputs = [ Plack TestWWWMechanize TryTiny ];
     meta = {
       description = "Test PSGI programs using WWW::Mechanize";
diff --git a/pkgs/top-level/release.nix b/pkgs/top-level/release.nix
index b46b58956262..cc1e9b791f77 100644
--- a/pkgs/top-level/release.nix
+++ b/pkgs/top-level/release.nix
@@ -120,7 +120,6 @@ let
       gajim = linux;
       gawk = all;
       gcc = linux;
-      gcc44 = linux;
       gcj = linux;
       ghostscript = linux;
       ghostscriptX = linux;