summary refs log tree commit diff
path: root/pkgs/development/compilers
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-07-21 11:05:58 +0200
committerEelco Dolstra <edolstra@gmail.com>2017-07-21 11:05:58 +0200
commita13802b2c8568426a6d31ab08aaaf2965010a6ce (patch)
treed3bbadb2a5cae436931440b754b96c3ced2771be /pkgs/development/compilers
parent15f6dcb668dcb6b4bfe33f47091273f978dcc0bf (diff)
parent581637ba5a512e1179cdaf0108931fca32892b32 (diff)
downloadnixpkgs-a13802b2c8568426a6d31ab08aaaf2965010a6ce.tar
nixpkgs-a13802b2c8568426a6d31ab08aaaf2965010a6ce.tar.gz
nixpkgs-a13802b2c8568426a6d31ab08aaaf2965010a6ce.tar.bz2
nixpkgs-a13802b2c8568426a6d31ab08aaaf2965010a6ce.tar.lz
nixpkgs-a13802b2c8568426a6d31ab08aaaf2965010a6ce.tar.xz
nixpkgs-a13802b2c8568426a6d31ab08aaaf2965010a6ce.tar.zst
nixpkgs-a13802b2c8568426a6d31ab08aaaf2965010a6ce.zip
Merge remote-tracking branch 'origin/master' into gcc-6
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r--pkgs/development/compilers/ccl/default.nix1
-rw-r--r--pkgs/development/compilers/compcert/default.nix4
-rw-r--r--pkgs/development/compilers/crystal/default.nix16
-rw-r--r--pkgs/development/compilers/dale/default.nix2
-rw-r--r--pkgs/development/compilers/dale/link-llvm.patch10
-rw-r--r--pkgs/development/compilers/gambit/bootstrap.nix41
-rw-r--r--pkgs/development/compilers/gambit/default.nix76
-rw-r--r--pkgs/development/compilers/gcc/4.5/default.nix2
-rw-r--r--pkgs/development/compilers/gcc/4.8/default.nix2
-rw-r--r--pkgs/development/compilers/gcc/4.9/default.nix2
-rw-r--r--pkgs/development/compilers/gcc/5/default.nix6
-rw-r--r--pkgs/development/compilers/gcc/6/darwin-const-correct.patch25
-rw-r--r--pkgs/development/compilers/gcc/6/default.nix11
-rw-r--r--pkgs/development/compilers/gcc/snapshot/default.nix2
-rw-r--r--pkgs/development/compilers/gerbil/default.nix25
-rw-r--r--pkgs/development/compilers/ghc/8.2.1.nix6
-rw-r--r--pkgs/development/compilers/ghc/head.nix22
-rw-r--r--pkgs/development/compilers/go/1.6.nix1
-rw-r--r--pkgs/development/compilers/go/fix-systime-1.6.patch45
-rw-r--r--pkgs/development/compilers/haxe/default.nix98
-rw-r--r--pkgs/development/compilers/haxe/hxcpp.nix52
-rw-r--r--pkgs/development/compilers/haxe/setup-hook.sh2
-rw-r--r--pkgs/development/compilers/julia/0.5.nix2
-rw-r--r--pkgs/development/compilers/llvm/4/clang/default.nix4
-rw-r--r--pkgs/development/compilers/llvm/4/default.nix31
-rw-r--r--pkgs/development/compilers/llvm/4/libc++/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/4/libc++abi.nix2
-rw-r--r--pkgs/development/compilers/llvm/4/lld.nix2
-rw-r--r--pkgs/development/compilers/llvm/4/lldb.nix2
-rw-r--r--pkgs/development/compilers/llvm/4/llvm.nix15
-rw-r--r--pkgs/development/compilers/llvm/4/openmp.nix2
-rw-r--r--pkgs/development/compilers/mono/5.0.nix7
-rw-r--r--pkgs/development/compilers/mono/generic-cmake.nix93
-rw-r--r--pkgs/development/compilers/mono/pkgconfig-before-gac-5x.patch65
-rw-r--r--pkgs/development/compilers/neko/default.nix6
-rw-r--r--pkgs/development/compilers/ocaml/4.04.nix4
-rw-r--r--pkgs/development/compilers/ocaml/4.05.nix9
-rw-r--r--pkgs/development/compilers/openjdk-darwin/8.nix2
-rw-r--r--pkgs/development/compilers/openjdk-darwin/default.nix2
-rw-r--r--pkgs/development/compilers/openjdk/7.nix2
-rw-r--r--pkgs/development/compilers/openjdk/8.nix2
-rw-r--r--pkgs/development/compilers/oraclejdk/jdk-linux-base.nix57
-rw-r--r--pkgs/development/compilers/oraclejdk/jdk8cpu-linux.nix1
-rw-r--r--pkgs/development/compilers/oraclejdk/jdk8psu-linux.nix1
-rw-r--r--pkgs/development/compilers/ponyc/default.nix4
-rw-r--r--pkgs/development/compilers/ponyc/pony-stable.nix8
-rw-r--r--pkgs/development/compilers/purescript/psc-package/default.nix4
-rw-r--r--pkgs/development/compilers/reason/default.nix4
-rw-r--r--pkgs/development/compilers/rust/nightlyBin.nix4
-rw-r--r--pkgs/development/compilers/rust/rustc.nix3
-rw-r--r--pkgs/development/compilers/sbcl/default.nix4
-rw-r--r--pkgs/development/compilers/solc/default.nix30
-rw-r--r--pkgs/development/compilers/swift/patches/build-script-pax.patch3
-rw-r--r--pkgs/development/compilers/tinycc/default.nix6
-rw-r--r--pkgs/development/compilers/wla-dx/default.nix7
-rw-r--r--pkgs/development/compilers/zulu/default.nix39
56 files changed, 617 insertions, 263 deletions
diff --git a/pkgs/development/compilers/ccl/default.nix b/pkgs/development/compilers/ccl/default.nix
index 3e1784424e3..76caf12ffd3 100644
--- a/pkgs/development/compilers/ccl/default.nix
+++ b/pkgs/development/compilers/ccl/default.nix
@@ -68,6 +68,7 @@ stdenv.mkDerivation rec {
     mkdir -p "$out/bin"
     echo -e '#!/bin/sh\n'"$out/share/ccl-installation/${CCL_RUNTIME}"' "$@"\n' > "$out"/bin/"${CCL_RUNTIME}"
     chmod a+x "$out"/bin/"${CCL_RUNTIME}"
+    ln -s "$out"/bin/"${CCL_RUNTIME}" "$out"/bin/ccl
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/compilers/compcert/default.nix b/pkgs/development/compilers/compcert/default.nix
index 8086a9f9749..f519776b689 100644
--- a/pkgs/development/compilers/compcert/default.nix
+++ b/pkgs/development/compilers/compcert/default.nix
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
   configurePhase = ''
     substituteInPlace ./configure --replace '{toolprefix}gcc' '{toolprefix}cc'
     ./configure -clightgen -prefix $out -toolprefix ${tools}/bin/ '' +
-    (if stdenv.isDarwin then "ia32-macosx" else "ia32-linux");
+    (if stdenv.isDarwin then "x86_64-macosx" else "x86_64-linux");
 
   installTargets = "documentation install";
 
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
     mkdir -p $lib/share/doc/compcert
     mv doc/html $lib/share/doc/compcert/
     mkdir -p $lib/lib/coq/${coq.coq-version}/user-contrib/compcert/
-    mv backend cfrontend common cparser driver flocq x86 x86_32 lib \
+    mv backend cfrontend common cparser driver flocq x86 x86_64 lib \
       $lib/lib/coq/${coq.coq-version}/user-contrib/compcert/
   '';
 
diff --git a/pkgs/development/compilers/crystal/default.nix b/pkgs/development/compilers/crystal/default.nix
index 8bad8f6f4d3..115c686d7de 100644
--- a/pkgs/development/compilers/crystal/default.nix
+++ b/pkgs/development/compilers/crystal/default.nix
@@ -1,7 +1,7 @@
-{ stdenv, fetchurl, boehmgc, libatomic_ops, pcre, libevent, libiconv, llvm_39, makeWrapper }:
+{ stdenv, fetchurl, boehmgc, libatomic_ops, pcre, libevent, libiconv, llvm_4, makeWrapper }:
 
 stdenv.mkDerivation rec {
-  version = "0.22.0";
+  version = "0.23.0";
   name = "crystal-${version}-1";
   arch =
     {
@@ -14,20 +14,20 @@ stdenv.mkDerivation rec {
     url = "https://github.com/crystal-lang/crystal/releases/download/${version}/crystal-${version}-1-${arch}.tar.gz";
     sha256 =
       {
-        "x86_64-linux" = "03c1nmjibz8f7yhrczd49gmccx4ivqz121c64hl384w69227p7bq";
-        "i686-linux" = "1s8gpmxa9wpcc2a9csl205lcpipn1i7gwybapby3q34y7xnq9160";
-        "x86_64-darwin" = "1bnfxb0hbkx4qlkc1l88sdhcnhacqzy31hh7ksz0prah83g6vbxa";
+        "x86_64-linux" = "0nhs7swbll8hrk15kmmywngkhij80x62axiskb1gjmiwvzhlh0qx";
+        "i686-linux" = "03xp8d3lqflzzm26lpdn4yavj87qzgd6xyrqxp2pn9ybwrq8fx8a";
+        "x86_64-darwin" = "1prz6c1gs8z7dgpdy2id2mjn1c8f5p2bf9b39985bav448njbyjz";
       }."${stdenv.system}" or (throw "system ${stdenv.system} not supported");
   };
 
   src = fetchurl {
     url = "https://github.com/crystal-lang/crystal/archive/${version}.tar.gz";
-    sha256 = "0iw5i4hjzfxykwfdyzix23pgm3gxd79r9yss3abvva8cf7ci37sv";
+    sha256 = "05ymwmjkl1b4m888p725kybpiap5ag2vj8l07d59j02inm5r0rcv";
   };
 
   # crystal on Darwin needs libiconv to build
   buildInputs = [
-    boehmgc libatomic_ops pcre libevent llvm_39 makeWrapper
+    boehmgc libatomic_ops pcre libevent llvm_4 makeWrapper
   ] ++ stdenv.lib.optionals stdenv.isDarwin [
     libiconv
   ];
@@ -86,6 +86,8 @@ stdenv.mkDerivation rec {
     install -Dm644 etc/completion.bash $out/share/bash-completion/completions/crystal
     install -Dm644 etc/completion.zsh $out/share/zsh/site-functions/_crystal
 
+    install -Dm644 man/crystal.1 $out/share/man/man1/crystal.1
+
     install -Dm644 LICENSE $out/share/licenses/crystal/LICENSE
   '';
 
diff --git a/pkgs/development/compilers/dale/default.nix b/pkgs/development/compilers/dale/default.nix
index 6d9adaa1518..3538f85a75f 100644
--- a/pkgs/development/compilers/dale/default.nix
+++ b/pkgs/development/compilers/dale/default.nix
@@ -23,6 +23,8 @@ in stdenv.mkDerivation {
   buildInputs = [ cmake pkgconfig libffi llvm_35 ]
              ++ stdenv.lib.optional doCheck perl;
 
+  patches = [ ./link-llvm.patch ];
+
   inherit doCheck;
 
   checkTarget = "tests";
diff --git a/pkgs/development/compilers/dale/link-llvm.patch b/pkgs/development/compilers/dale/link-llvm.patch
new file mode 100644
index 00000000000..3facec91874
--- /dev/null
+++ b/pkgs/development/compilers/dale/link-llvm.patch
@@ -0,0 +1,10 @@
+--- dale-39e16d8e89fa070de65a673d4462e783d530f95a-src.org/CMakeLists.txt	2017-06-22 08:01:05.839531242 +0100
++++ dale-39e16d8e89fa070de65a673d4462e783d530f95a-src/CMakeLists.txt	2017-06-22 07:59:11.777566801 +0100
+@@ -78,6 +78,7 @@
+ execute_process (COMMAND ${LLVM_CONFIG} --libs
+                  OUTPUT_VARIABLE LLVM_LIBS
+                  OUTPUT_STRIP_TRAILING_WHITESPACE)
++STRING(REGEX REPLACE " " ";" LLVM_LIBS "${LLVM_LIBS}")
+ if (${D_LLVM_VERSION_MINOR} GREATER 4)
+     execute_process (COMMAND ${LLVM_CONFIG} --system-libs
+                      OUTPUT_VARIABLE LLVM_SYSTEM_LIBS
diff --git a/pkgs/development/compilers/gambit/bootstrap.nix b/pkgs/development/compilers/gambit/bootstrap.nix
new file mode 100644
index 00000000000..65fb20aa260
--- /dev/null
+++ b/pkgs/development/compilers/gambit/bootstrap.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchurl, autoconf, ... }:
+
+stdenv.mkDerivation rec {
+  name    = "gambit-bootstrap-${version}";
+  version = "4.8.8";
+  tarball_version = "v4_8_8";
+
+  src = fetchurl {
+    url    = "http://www.iro.umontreal.ca/~gambit/download/gambit/v4.8/source/gambit-${tarball_version}-devel.tgz";
+    sha256 = "075k2z04d6svxqf9paj3xvp0mm0xzy0vbma1y61s0lkywdim8xjz";
+  };
+
+  buildInputs = [ autoconf ];
+
+  configurePhase = ''
+    ./configure --prefix=$out --enable-single-host
+  '';
+
+  buildPhase = ''
+    # Copy the (configured) sources now, not later, so we don't have to filter out
+    # all the intermediate build products.
+    mkdir -p $out ; cp -rp . $out/
+
+    # build the gsc-boot* compiler
+    make bootstrap
+  '';
+
+  installPhase = ''
+    cp -fa ./ $out/
+  '';
+
+  forceShare = [ "info" ];
+
+  meta = {
+    description = "Optimizing Scheme to C compiler, bootstrap step";
+    homepage    = "http://gambitscheme.org";
+    license     = stdenv.lib.licenses.lgpl2;
+    platforms   = stdenv.lib.platforms.linux;
+    maintainers = with stdenv.lib.maintainers; [ thoughtpolice raskin fare ];
+  };
+}
diff --git a/pkgs/development/compilers/gambit/default.nix b/pkgs/development/compilers/gambit/default.nix
index 7e17cee9abd..58b08ebd4fb 100644
--- a/pkgs/development/compilers/gambit/default.nix
+++ b/pkgs/development/compilers/gambit/default.nix
@@ -1,31 +1,75 @@
-{ stdenv, fetchurl, openssl }:
+{ stdenv, fetchurl, fetchgit, git, openssl, autoconf, pkgs }:
 
 stdenv.mkDerivation rec {
   name    = "gambit-${version}";
-  version = "4.8.6";
-  devver  = "4_8_6";
+  version = "4.8.8-f3ffeb6";
+  bootstrap = import ./bootstrap.nix ( pkgs );
 
-  src = fetchurl {
-    url    = "http://www.iro.umontreal.ca/~gambit/download/gambit/v4.8/source/gambit-v${devver}-devel.tgz";
-    sha256 = "0j3ka76cfb007rlcc3nv5p1s6vh31cwp87hwwabawf16vs1jb7bl";
+#  devver  = "4_8_8";
+#  src = fetchurl {
+#    url    = "http://www.iro.umontreal.ca/~gambit/download/gambit/v4.8/source/gambit-v${version}-devel.tgz";
+#    sha256 = "0j3ka76cfb007rlcc3nv5p1s6vh31cwp87hwwabawf16vs1jb7bl";
+#  };
+  src = fetchgit {
+    url = "https://github.com/feeley/gambit.git";
+    rev = "f3ffeb695aeea80c18c1b9ef276b57898c780dca";
+    sha256 = "1lqixsrgk9z2gj6z1nkys0pfd3m5zjxrp3gvqn2wpr9h7hjb8x06";
   };
 
-  configureFlags = [
-    "--enable-single-host"
-    "--enable-shared"
-    "--enable-absolute-shared-libs"
-    "--enable-c-opt=-O6" "--enable-gcc-opts" "--enable-inline-jumps"
-    "--enable-thread-system=posix" "--enable-dynamic-tls"
-    "--enable-openssl"
-  ];
+  buildInputs = [ openssl git autoconf bootstrap ];
 
-  buildInputs = [ openssl ];
+  configurePhase = ''
+    options=(
+      --prefix=$out
+      --enable-single-host
+      --enable-c-opt=-O2
+      --enable-gcc-opts
+      --enable-shared
+      --enable-absolute-shared-libs # Yes, NixOS will want an absolute path, and fix it.
+      --enable-poll
+      --enable-openssl
+
+      #--enable-multiple-versions # Nope, NixOS already does version multiplexing
+      #--enable-guide
+      #--enable-track-scheme
+      #--enable-high-res-timing
+      #--enable-max-processors=4
+      #--enable-multiple-vms
+      #--enable-dynamic-tls
+      #--enable-multiple-vms
+      #--enable-multiple-threaded-vms  ## when SMP branch is merged in
+      #--enable-thread-system=posix    ## default when --enable-multiple-vms is on.
+      #--enable-profile
+      #--enable-coverage
+      #--enable-inline-jumps
+      #--enable-char-size=1" ; default is 4
+    )
+    ./configure ''${options[@]}
+  '';
+
+  buildPhase = ''
+    # Make bootstrap compiler, from release bootstrap
+    mkdir -p boot/wip-compiler &&
+    cp -rp ${bootstrap}/. boot/wip-compiler/. &&
+    chmod -R u+w boot &&
+    cd boot/wip-compiler && \
+    cp ../../gsc/makefile.in ../../gsc/*.scm gsc && \
+    (cd gsc && make bootclean ) &&
+    make bootstrap &&
+    cd ../.. &&
+    cp boot/wip-compiler/gsc/gsc gsc-boot &&
+
+    # Now use the bootstrap compiler to build the real thing!
+    make -j2 from-scratch
+  '';
+
+  doCheck = true;
 
   meta = {
     description = "Optimizing Scheme to C compiler";
     homepage    = "http://gambitscheme.org";
     license     = stdenv.lib.licenses.lgpl2;
     platforms   = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ thoughtpolice raskin ];
+    maintainers = with stdenv.lib.maintainers; [ thoughtpolice raskin fare ];
   };
 }
diff --git a/pkgs/development/compilers/gcc/4.5/default.nix b/pkgs/development/compilers/gcc/4.5/default.nix
index 67981ad1056..69197b923c3 100644
--- a/pkgs/development/compilers/gcc/4.5/default.nix
+++ b/pkgs/development/compilers/gcc/4.5/default.nix
@@ -283,7 +283,7 @@ stdenv.mkDerivation ({
     NM_FOR_TARGET = "${targetPlatform.config}-nm";
     CXX_FOR_TARGET = "${targetPlatform.config}-g++";
     # If we are making a cross compiler, cross != null
-    NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else "";
+    NIX_CC_CROSS = optionalString (targetPlatform == hostPlatform) builtins.toString stdenv.cc;
     dontStrip = true;
     configureFlags = ''
       ${if enableMultilib then "" else "--disable-multilib"}
diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix
index de9d3165b55..38ff23f86a6 100644
--- a/pkgs/development/compilers/gcc/4.8/default.nix
+++ b/pkgs/development/compilers/gcc/4.8/default.nix
@@ -401,7 +401,7 @@ stdenv.mkDerivation ({
     NM_FOR_TARGET = "${targetPlatform.config}-nm";
     CXX_FOR_TARGET = "${targetPlatform.config}-g++";
     # If we are making a cross compiler, cross != null
-    NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else "";
+    NIX_CC_CROSS = optionalString (targetPlatform == hostPlatform) builtins.toString stdenv.cc;
     dontStrip = true;
     configureFlags = ''
       ${if enableMultilib then "" else "--disable-multilib"}
diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix
index c5bebdf3300..04e67e44f77 100644
--- a/pkgs/development/compilers/gcc/4.9/default.nix
+++ b/pkgs/development/compilers/gcc/4.9/default.nix
@@ -407,7 +407,7 @@ stdenv.mkDerivation ({
     NM_FOR_TARGET = "${targetPlatform.config}-nm";
     CXX_FOR_TARGET = "${targetPlatform.config}-g++";
     # If we are making a cross compiler, cross != null
-    NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else "";
+    NIX_CC_CROSS = optionalString (targetPlatform == hostPlatform) builtins.toString stdenv.cc;
     dontStrip = true;
     configureFlags = ''
       ${if enableMultilib then "" else "--disable-multilib"}
diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix
index b4a74300d36..e95ef92c3f6 100644
--- a/pkgs/development/compilers/gcc/5/default.nix
+++ b/pkgs/development/compilers/gcc/5/default.nix
@@ -35,6 +35,7 @@
 , cloog # unused; just for compat with gcc4, as we override the parameter on some places
 , darwin ? null
 , buildPlatform, hostPlatform, targetPlatform
+, buildPackages
 }:
 
 assert langJava     -> zip != null && unzip != null
@@ -312,6 +313,7 @@ stdenv.mkDerivation ({
     ++ (optionals langJava [ boehmgc zip unzip ])
     ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs))
     ++ (optionals (targetPlatform != hostPlatform) [binutils])
+    ++ (optionals (buildPlatform != hostPlatform) [buildPackages.stdenv.cc])
     ++ (optionals langAda [gnatboot])
     ++ (optionals langVhdl [gnat])
 
@@ -422,7 +424,7 @@ stdenv.mkDerivation ({
     NM_FOR_TARGET = "${targetPlatform.config}-nm";
     CXX_FOR_TARGET = "${targetPlatform.config}-g++";
     # If we are making a cross compiler, cross != null
-    NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else "";
+    NIX_CC_CROSS = optionalString (targetPlatform == hostPlatform) builtins.toString stdenv.cc;
     dontStrip = true;
     configureFlags = ''
       ${if enableMultilib then "" else "--disable-multilib"}
@@ -449,6 +451,8 @@ stdenv.mkDerivation ({
         )
       }
       ${if langAda then " --enable-libada" else ""}
+      --build=${buildPlatform.config}
+      --host=${hostPlatform.config}
       --target=${targetPlatform.config}
       ${xwithArch}
       ${xwithCpu}
diff --git a/pkgs/development/compilers/gcc/6/darwin-const-correct.patch b/pkgs/development/compilers/gcc/6/darwin-const-correct.patch
deleted file mode 100644
index a9b9b85acab..00000000000
--- a/pkgs/development/compilers/gcc/6/darwin-const-correct.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 5972cd58bde3bc8bacfe994e5b127c411241f255 Mon Sep 17 00:00:00 2001
-From: law <law@138bc75d-0d04-0410-961f-82ee72b054a4>
-Date: Tue, 3 Jan 2017 05:36:40 +0000
-Subject: [PATCH] 	* config/darwin-driver.c (darwin_driver_init):
- Const-correctness 	fixes for first_period and second_period variables.
-
-git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244010 138bc75d-0d04-0410-961f-82ee72b054a4
----
-diff --git a/gcc/config/darwin-driver.c b/gcc/config/darwin-driver.c
-index 0c4f0cd..e3ed79d 100644
---- a/gcc/config/darwin-driver.c
-+++ b/gcc/config/darwin-driver.c
-@@ -299,10 +299,10 @@ darwin_driver_init (unsigned int *decoded_options_count,
-   if (vers_string != NULL)
-     {
-       char *asm_major = NULL;
--      char *first_period = strchr(vers_string, '.');
-+      const char *first_period = strchr(vers_string, '.');
-       if (first_period != NULL)
- 	{
--	  char *second_period = strchr(first_period+1, '.');
-+	  const char *second_period = strchr(first_period+1, '.');
- 	  if (second_period  != NULL)
- 	    asm_major = xstrndup (vers_string, second_period-vers_string);
- 	  else
diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix
index 057acf9794e..b091fd1ae37 100644
--- a/pkgs/development/compilers/gcc/6/default.nix
+++ b/pkgs/development/compilers/gcc/6/default.nix
@@ -58,7 +58,7 @@ assert langGo -> langCC;
 with stdenv.lib;
 with builtins;
 
-let version = "6.3.0";
+let version = "6.4.0";
 
     # Whether building a cross-compiler for GNU/Hurd.
     crossGNU = targetPlatform != hostPlatform && targetPlatform.config == "i586-pc-gnu";
@@ -72,8 +72,7 @@ let version = "6.3.0";
       # The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its
       # target libraries and tools.
       ++ optional langAda ../gnat-cflags.patch
-      ++ optional langFortran ../gfortran-driving.patch
-      ++ optional hostPlatform.isDarwin ./darwin-const-correct.patch; # Kill this after 6.3.0
+      ++ optional langFortran ../gfortran-driving.patch;
 
     javaEcj = fetchurl {
       # The `$(top_srcdir)/ecj.jar' file is automatically picked up at
@@ -213,8 +212,8 @@ stdenv.mkDerivation ({
   builder = ../builder.sh;
 
   src = fetchurl {
-    url = "mirror://gnu/gcc/gcc-${version}/gcc-${version}.tar.bz2";
-    sha256 = "17xjz30jb65hcf714vn9gcxvrrji8j20xm7n33qg1ywhyzryfsph";
+    url = "mirror://gnu/gcc/gcc-${version}/gcc-${version}.tar.xz";
+    sha256 = "1m0lr7938lw5d773dkvwld90hjlcq2282517d1gwvrfzmwgg42w5";
   };
 
   inherit patches;
@@ -404,7 +403,7 @@ stdenv.mkDerivation ({
     NM_FOR_TARGET = "${targetPlatform.config}-nm";
     CXX_FOR_TARGET = "${targetPlatform.config}-g++";
     # If we are making a cross compiler, cross != null
-    NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else "";
+    NIX_CC_CROSS = optionalString (targetPlatform == hostPlatform) builtins.toString stdenv.cc;
     dontStrip = true;
     configureFlags = ''
       ${if enableMultilib then "" else "--disable-multilib"}
diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix
index bb2c9d8a5c0..f3d8d27d90c 100644
--- a/pkgs/development/compilers/gcc/snapshot/default.nix
+++ b/pkgs/development/compilers/gcc/snapshot/default.nix
@@ -405,7 +405,7 @@ stdenv.mkDerivation ({
     NM_FOR_TARGET = "${targetPlatform.config}-nm";
     CXX_FOR_TARGET = "${targetPlatform.config}-g++";
     # If we are making a cross compiler, cross != null
-    NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else "";
+    NIX_CC_CROSS = optionalString (targetPlatform == hostPlatform) builtins.toString stdenv.cc;
     dontStrip = true;
     configureFlags = ''
       ${if enableMultilib then "" else "--disable-multilib"}
diff --git a/pkgs/development/compilers/gerbil/default.nix b/pkgs/development/compilers/gerbil/default.nix
index 7ea403715a5..22047b663d0 100644
--- a/pkgs/development/compilers/gerbil/default.nix
+++ b/pkgs/development/compilers/gerbil/default.nix
@@ -1,15 +1,22 @@
-{ stdenv, fetchurl, fetchgit, gambit, openssl, zlib, coreutils, rsync, bash }:
+{ stdenv, fetchurl, fetchgit, gambit,
+  coreutils, rsync, bash,
+  openssl, zlib, sqlite, libxml2, libyaml, libmysql, lmdb, leveldb }:
 
 stdenv.mkDerivation rec {
   name    = "gerbil-${version}";
 
-  version = "0.11";
-  src = fetchurl {
-    url    = "https://github.com/vyzo/gerbil/archive/v${version}.tar.gz";
-    sha256 = "0mqg6cqdcf5qr7vk79x5zkls7z2wm8i3lhwn0b7i0g1m6yyyyff7";
+  version = "0.12-DEV";
+  src = fetchgit {
+    url = "https://github.com/vyzo/gerbil.git";
+    rev = "3657b6e940ea248e0b312f276590e38ff68997e7";
+    sha256 = "11ys7082ghkm4yikz4qxmv3jpxcr42jfi0jhjw1mpzbqdg6004w2";
   };
 
-  buildInputs = [ gambit openssl zlib coreutils rsync bash ];
+  buildInputs = [
+    gambit openssl
+    coreutils rsync bash
+    zlib openssl zlib sqlite libxml2 libyaml libmysql lmdb leveldb
+  ];
 
   postPatch = ''
     patchShebangs .
@@ -21,7 +28,13 @@ stdenv.mkDerivation rec {
 
   buildPhase = ''
     runHook preBuild
+
+    # Enable all optional libraries
+    substituteInPlace "src/std/build-features.ss" --replace '#f' '#t'
+
+    # Build, replacing make by build.sh
     ( cd src && sh build.sh )
+
     runHook postBuild
   '';
 
diff --git a/pkgs/development/compilers/ghc/8.2.1.nix b/pkgs/development/compilers/ghc/8.2.1.nix
index 6b0cdf4fbdc..92014200c61 100644
--- a/pkgs/development/compilers/ghc/8.2.1.nix
+++ b/pkgs/development/compilers/ghc/8.2.1.nix
@@ -9,8 +9,8 @@
 
 let
   inherit (bootPkgs) ghc;
-  version = "8.2.1-rc2";
-  preReleaseName = "ghc-8.2.0.20170507";
+  version = "8.2.1-rc3";
+  preReleaseName = "ghc-8.2.0.20170704";
   commonBuildInputs = [ alex autoconf automake ghc happy hscolour perl python3 sphinx ];
   commonPreConfigure =  ''
     sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
@@ -27,7 +27,7 @@ in stdenv.mkDerivation (rec {
 
   src = fetchurl {
     url = "https://downloads.haskell.org/~ghc/${version}/${preReleaseName}-src.tar.xz";
-    sha256 = "1hy3l6nzkyhzwy9mii4zs51jv048zwvdqk1q3188jznz35392zrn";
+    sha256 = "0ccfybbjrmd8yzqbfdqvb6clz2kd005wi8sx3mfjmbkmxv0l4jry";
   };
 
   postPatch = "patchShebangs .";
diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix
index 3e1aada22eb..f199048353c 100644
--- a/pkgs/development/compilers/ghc/head.nix
+++ b/pkgs/development/compilers/ghc/head.nix
@@ -15,8 +15,6 @@ let
   version = "8.1.20170106";
   rev = "b4f2afe70ddbd0576b4eba3f82ba1ddc52e9b3bd";
 
-  outputs = [ "out" "doc" ];
-
   commonPreConfigure =  ''
     echo ${version} >VERSION
     echo ${rev} >GIT_COMMIT_ID
@@ -77,6 +75,8 @@ in stdenv.mkDerivation (rec {
     done
   '';
 
+  outputs = [ "out" "doc" ];
+
   passthru = {
     inherit bootPkgs;
   } // stdenv.lib.optionalAttrs (targetPlatform != buildPlatform) {
@@ -101,26 +101,26 @@ in stdenv.mkDerivation (rec {
   '';
 
   configureFlags = [
-    "CC=${stdenv.ccCross}/bin/${cross.config}-cc"
-    "LD=${stdenv.binutils}/bin/${cross.config}-ld"
-    "AR=${stdenv.binutils}/bin/${cross.config}-ar"
-    "NM=${stdenv.binutils}/bin/${cross.config}-nm"
-    "RANLIB=${stdenv.binutils}/bin/${cross.config}-ranlib"
+    "CC=${stdenv.cc}/bin/${cross.config}-cc"
+    "LD=${stdenv.cc}/bin/${cross.config}-ld"
+    "AR=${stdenv.cc}/bin/${cross.config}-ar"
+    "NM=${stdenv.cc}/bin/${cross.config}-nm"
+    "RANLIB=${stdenv.cc}/bin/${cross.config}-ranlib"
     "--target=${cross.config}"
     "--enable-bootstrap-with-devel-snapshot"
   ] ++
     # fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
     lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space";
 
-  buildInputs = commonBuildInputs ++ [ stdenv.ccCross stdenv.binutils ];
+  buildInputs = commonBuildInputs;
 
-  dontSetConfigureCross = true;
+  configurePlatforms = [];
 
   passthru = {
     inherit bootPkgs cross;
 
-    cc = "${stdenv.ccCross}/bin/${cross.config}-cc";
+    cc = "${stdenv.cc}/bin/${cross.config}-cc";
 
-    ld = "${stdenv.binutils}/bin/${cross.config}-ld";
+    ld = "${stdenv.cc}/bin/${cross.config}-ld";
   };
 })
diff --git a/pkgs/development/compilers/go/1.6.nix b/pkgs/development/compilers/go/1.6.nix
index 4a777d7b4f1..61408c0ebb3 100644
--- a/pkgs/development/compilers/go/1.6.nix
+++ b/pkgs/development/compilers/go/1.6.nix
@@ -113,6 +113,7 @@ stdenv.mkDerivation rec {
   patches = [
     ./remove-tools-1.5.patch
     ./creds-test.patch
+    ./fix-systime-1.6.patch
 
     # This test checks for the wrong thing with recent tzdata. It's been fixed in master but the patch
     # actually works on old versions too.
diff --git a/pkgs/development/compilers/go/fix-systime-1.6.patch b/pkgs/development/compilers/go/fix-systime-1.6.patch
new file mode 100644
index 00000000000..e4a3932001e
--- /dev/null
+++ b/pkgs/development/compilers/go/fix-systime-1.6.patch
@@ -0,0 +1,45 @@
+diff --git a/src/runtime/sys_darwin_amd64.s b/src/runtime/sys_darwin_amd64.s
+index e09b906ba5..fa8ff2f65c 100644
+--- a/src/runtime/sys_darwin_amd64.s
++++ b/src/runtime/sys_darwin_amd64.s
+@@ -157,6 +157,7 @@ systime:
+ 	// Fall back to system call (usually first call in this thread).
+ 	MOVQ	SP, DI
+ 	MOVQ	$0, SI
++	MOVQ	$0, DX  // required as of Sierra; Issue 16570
+ 	MOVL	$(0x2000000+116), AX
+ 	SYSCALL
+ 	CMPQ	AX, $0
+diff --git a/src/syscall/syscall_darwin_amd64.go b/src/syscall/syscall_darwin_amd64.go
+index 70b53b87f4..79083117b6 100644
+--- a/src/syscall/syscall_darwin_amd64.go
++++ b/src/syscall/syscall_darwin_amd64.go
+@@ -26,14 +26,21 @@ func NsecToTimeval(nsec int64) (tv Timeval) {
+ }
+ 
+ //sysnb	gettimeofday(tp *Timeval) (sec int64, usec int32, err error)
+-func Gettimeofday(tv *Timeval) (err error) {
+-	// The tv passed to gettimeofday must be non-nil
+-	// but is otherwise unused.  The answers come back
+-	// in the two registers.
++func Gettimeofday(tv *Timeval) error {
++	// The tv passed to gettimeofday must be non-nil.
++	// Before macOS Sierra (10.12), tv was otherwise unused and
++	// the answers came back in the two registers.
++	// As of Sierra, gettimeofday return zeros and populates
++	// tv itself.
+ 	sec, usec, err := gettimeofday(tv)
+-	tv.Sec = sec
+-	tv.Usec = usec
+-	return err
++	if err != nil {
++		return err
++	}
++	if sec != 0 || usec != 0 {
++		tv.Sec = sec
++		tv.Usec = usec
++	}
++	return nil
+ }
+ 
+ func SetKevent(k *Kevent_t, fd, mode, flags int) {
diff --git a/pkgs/development/compilers/haxe/default.nix b/pkgs/development/compilers/haxe/default.nix
index 684c6d25daa..ca41545eb45 100644
--- a/pkgs/development/compilers/haxe/default.nix
+++ b/pkgs/development/compilers/haxe/default.nix
@@ -1,40 +1,82 @@
-{ stdenv, fetchgit, ocaml, zlib, pcre, neko, camlp4 }:
+{ stdenv, fetchgit, bash, coreutils, ocaml, zlib, pcre, neko, camlp4 }:
 
-stdenv.mkDerivation {
-  name = "haxe-3.4.2";
+let
+  generic = { version, sha256, prePatch }:
+    stdenv.mkDerivation rec {
+      name = "haxe-${version}";
 
-  buildInputs = [ocaml zlib pcre neko camlp4];
+      buildInputs = [ocaml zlib pcre neko camlp4];
 
-  src = fetchgit {
-    url = "https://github.com/HaxeFoundation/haxe.git";
-    sha256 = "1m5fp183agqv8h3ynhxw4kndkpq2d6arysmirv3zl3vz5crmpwqd";
-    fetchSubmodules = true;
+      src = fetchgit {
+        url = https://github.com/HaxeFoundation/haxe.git;
+        inherit sha256;
+        fetchSubmodules = true;
+        rev = "refs/tags/${version}";
+      };
 
-    # Tag 3.4.2
-    rev = "890f8c70cf23ce6f9fe0fdd0ee514a9699433ca7";
-  };
+      inherit prePatch;
+
+      buildFlags = [ "all" "tools" ];
 
-  prePatch = ''
-    sed -i -e 's|"/usr/lib/haxe/std/";|"'"$out/lib/haxe/std/"'";\n&|g' src/main.ml
-  '';
+      installPhase = ''
+        install -vd "$out/bin" "$out/lib/haxe/std"
+        cp -vr haxe haxelib std "$out/lib/haxe"
 
-  buildFlags = [ "all" "tools" ];
+        # make wrappers which provide a temporary HAXELIB_PATH with symlinks to multiple repositories HAXELIB_PATH may point to
+        for name in haxe haxelib; do
+        cat > $out/bin/$name <<EOF
+        #!{bash}/bin/bash
 
-  installPhase = ''
-    install -vd "$out/bin" "$out/lib/haxe/std"
-    install -vt "$out/bin" haxe haxelib
-    cp -vr std "$out/lib/haxe"
-  '';
+        if [[ "\$HAXELIB_PATH" =~ : ]]; then
+          NEW_HAXELIB_PATH="\$(${coreutils}/bin/mktemp -d)"
 
-  setupHook = ./setup-hook.sh;
+          IFS=':' read -ra libs <<< "\$HAXELIB_PATH"
+          for libdir in "\''${libs[@]}"; do
+            for lib in "\$libdir"/*; do
+              if [ ! -e "\$NEW_HAXELIB_PATH/\$(${coreutils}/bin/basename "\$lib")" ]; then
+                ${coreutils}/bin/ln -s "--target-directory=\$NEW_HAXELIB_PATH" "\$lib"
+              fi
+            done
+          done
+          export HAXELIB_PATH="\$NEW_HAXELIB_PATH"
+          $out/lib/haxe/$name "\$@"
+          rm -rf "\$NEW_HAXELIB_PATH"
+        else
+          exec $out/lib/haxe/$name "\$@"
+        fi
+        EOF
+        chmod +x $out/bin/$name
+        done
+      '';
 
-  dontStrip = true;
+      setupHook = ./setup-hook.sh;
 
-  meta = with stdenv.lib; {
-    description = "Programming language targeting JavaScript, Flash, NekoVM, PHP, C++";
-    homepage = https://haxe.org;
-    license = with licenses; [ gpl2 bsd2 /*?*/ ];  # -> docs/license.txt
-    maintainers = [ maintainers.marcweber ];
-    platforms = platforms.linux ++ platforms.darwin;
+      dontStrip = true;
+
+      meta = with stdenv.lib; {
+        description = "Programming language targeting JavaScript, Flash, NekoVM, PHP, C++";
+        homepage = https://haxe.org;
+        license = with licenses; [ gpl2 bsd2 /*?*/ ];  # -> docs/license.txt
+        maintainers = [ maintainers.marcweber ];
+        platforms = platforms.linux ++ platforms.darwin;
+      };
+    };
+in {
+  # this old version is required to compile some libraries
+  haxe_3_2 = generic {
+    version = "3.2.1";
+    sha256 = "1x9ay5a2llq46fww3k07jxx8h1vfpyxb522snc6702a050ki5vz3";
+    prePatch = ''
+      sed -i -e 's|"/usr/lib/haxe/std/";|"'"$out/lib/haxe/std/"'";\n&|g' main.ml
+      sed -i -e 's|"neko"|"${neko}/bin/neko"|g' extra/haxelib_src/src/tools/haxelib/Main.hx
+    '';
+  };
+  haxe_3_4 = generic {
+    version = "3.4.2";
+    sha256 = "1m5fp183agqv8h3ynhxw4kndkpq2d6arysmirv3zl3vz5crmpwqd";
+    prePatch = ''
+      sed -i -e 's|"/usr/lib/haxe/std/";|"'"$out/lib/haxe/std/"'";\n&|g' src/main.ml
+      sed -i -e 's|"neko"|"${neko}/bin/neko"|g' extra/haxelib_src/src/haxelib/client/Main.hx
+    '';
   };
 }
diff --git a/pkgs/development/compilers/haxe/hxcpp.nix b/pkgs/development/compilers/haxe/hxcpp.nix
deleted file mode 100644
index 56b43fc128e..00000000000
--- a/pkgs/development/compilers/haxe/hxcpp.nix
+++ /dev/null
@@ -1,52 +0,0 @@
-{ stdenv, fetchzip, haxe, neko, pcre, sqlite, zlib }:
-
-stdenv.mkDerivation rec {
-  name = "hxcpp-3.2.27";
-
-  src = let
-    zipFile = stdenv.lib.replaceChars ["."] [","] name;
-  in fetchzip {
-    inherit name;
-    url = "http://lib.haxe.org/files/3.0/${zipFile}.zip";
-    sha256 = "1hw4kr1f8q7f4fkzis7kvkm7h1cxhv6cf5v1iq7rvxs2fxiys7fr";
-  };
-
-  NIX_LDFLAGS = "-lpcre -lz -lsqlite3";
-
-  outputs = [ "out" "lib" ];
-
-  patchPhase = ''
-    rm -rf bin lib project/thirdparty project/libs/sqlite/sqlite3.[ch]
-    find . -name '*.n' -delete
-    sed -i -re '/(PCRE|ZLIB)_DIR|\<sqlite3\.c\>/d' project/Build.xml
-    sed -i -e 's/mFromFile = "@";/mFromFile = "";/' tools/hxcpp/Linker.hx
-    sed -i -e '/dll_ext/s,HX_CSTRING("./"),HX_CSTRING("'"$lib"'/"),' \
-      src/hx/Lib.cpp
-  '';
-
-  buildInputs = [ haxe neko pcre sqlite zlib ];
-
-  targetArch = "linux-m${if stdenv.is64bit then "64" else "32"}";
-
-  buildPhase = ''
-    haxe -neko project/build.n -cp tools/build -main Build
-    haxe -neko run.n -cp tools/run -main RunMain
-    haxe -neko hxcpp.n -cp tools/hxcpp -main BuildTool
-    (cd project && neko build.n "ndll-$targetArch")
-  '';
-
-  installPhase = ''
-    for i in bin/Linux*/*.dso; do
-      install -vD "$i" "$lib/$(basename "$i")"
-    done
-    find *.n toolchain/*.xml build-tool/BuildCommon.xml src include \
-      -type f -exec install -vD -m 0644 {} "$out/lib/haxe/hxcpp/{}" \;
-  '';
-
-  meta = {
-    homepage = "http://lib.haxe.org/p/hxcpp";
-    description = "Runtime support library for the Haxe C++ backend";
-    license = stdenv.lib.licenses.bsd2;
-    platforms = stdenv.lib.platforms.linux;
-  };
-}
diff --git a/pkgs/development/compilers/haxe/setup-hook.sh b/pkgs/development/compilers/haxe/setup-hook.sh
index a29e04a989b..21cc0206859 100644
--- a/pkgs/development/compilers/haxe/setup-hook.sh
+++ b/pkgs/development/compilers/haxe/setup-hook.sh
@@ -1,5 +1,7 @@
 addHaxeLibPath() {
+  if [ ! -d "$1/lib/haxe/std" ]; then
     addToSearchPath HAXELIB_PATH "$1/lib/haxe"
+  fi
 }
 
 envHooks+=(addHaxeLibPath)
diff --git a/pkgs/development/compilers/julia/0.5.nix b/pkgs/development/compilers/julia/0.5.nix
index 1ee4dea51e3..6e379091703 100644
--- a/pkgs/development/compilers/julia/0.5.nix
+++ b/pkgs/development/compilers/julia/0.5.nix
@@ -155,7 +155,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  doCheck = true;
+  doCheck = !stdenv.isDarwin;
   checkTarget = "testall";
   # Julia's tests require read/write access to $HOME
   preCheck = ''
diff --git a/pkgs/development/compilers/llvm/4/clang/default.nix b/pkgs/development/compilers/llvm/4/clang/default.nix
index 64dbaa21dd4..8d40ee3c8aa 100644
--- a/pkgs/development/compilers/llvm/4/clang/default.nix
+++ b/pkgs/development/compilers/llvm/4/clang/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetch, cmake, libxml2, libedit, llvm, version, release_version, clang-tools-extra_src, python
 , fixDarwinDylibNames
-, enableManpages ? true
+, enableManpages ? false
 }:
 
 let
@@ -9,7 +9,7 @@ let
     name = "clang-${version}";
 
     unpackPhase = ''
-      unpackFile ${fetch "cfe" "12n99m60aa680cir3ql56s1jsv6lp61hq4w9rabf4c6vpn7gi9ff"}
+      unpackFile ${fetch "cfe" "16vnv3msnvx33dydd17k2cq0icndi1a06bg5vcxkrhjjb1rqlwv1"}
       mv cfe-${version}* clang
       sourceRoot=$PWD/clang
       unpackFile ${clang-tools-extra_src}
diff --git a/pkgs/development/compilers/llvm/4/default.nix b/pkgs/development/compilers/llvm/4/default.nix
index 15918f9c1eb..9e5bccff355 100644
--- a/pkgs/development/compilers/llvm/4/default.nix
+++ b/pkgs/development/compilers/llvm/4/default.nix
@@ -1,8 +1,8 @@
-{ newScope, stdenv, cmake, libxml2, python2, isl, fetchurl, overrideCC, wrapCC, darwin, ccWrapperFun }:
+{ lowPrio, newScope, stdenv, cmake, libxml2, python2, isl, fetchurl, overrideCC, wrapCC, darwin, ccWrapperFun }:
 let
   callPackage = newScope (self // { inherit stdenv cmake libxml2 python2 isl release_version version fetch; });
 
-  release_version = "4.0.0";
+  release_version = "4.0.1";
   version = release_version; # differentiating these is important for rc's
 
   fetch = name: sha256: fetchurl {
@@ -10,17 +10,28 @@ let
     inherit sha256;
   };
 
-  compiler-rt_src = fetch "compiler-rt" "059ipqq27gd928ay06f1ck3vw6y5h5z4zd766x8k0k7jpqimpwnk";
-  clang-tools-extra_src = fetch "clang-tools-extra" "16bwckgcxfn56mbqjlxi7fxja0zm9hjfa6s3ncm3dz98n5zd7ds1";
+  compiler-rt_src = fetch "compiler-rt" "0h5lpv1z554szi4r4blbskhwrkd78ir50v3ng8xvk1s86fa7gj53";
+  clang-tools-extra_src = fetch "clang-tools-extra" "1dhmp7ccfpr42bmvk3kp37ngjpf3a9m5d4kkpsn7d00hzi7fdl9m";
+
+  # Add man output without introducing extra dependencies.
+  overrideManOutput = drv:
+    let drv-manpages = drv.override { enableManpages = true; }; in
+    drv // { man = drv-manpages.man; /*outputs = drv.outputs ++ ["man"];*/ };
+
+  llvm = callPackage ./llvm.nix {
+    inherit compiler-rt_src stdenv;
+  };
+
+  clang-unwrapped = callPackage ./clang {
+    inherit clang-tools-extra_src stdenv;
+  };
 
   self = {
-    llvm = callPackage ./llvm.nix {
-      inherit compiler-rt_src stdenv;
-    };
+    llvm = overrideManOutput llvm;
+    clang-unwrapped = overrideManOutput clang-unwrapped;
 
-    clang-unwrapped = callPackage ./clang {
-      inherit clang-tools-extra_src stdenv;
-    };
+    llvm-manpages = lowPrio self.llvm.man;
+    clang-manpages = lowPrio self.clang-unwrapped.man;
 
     clang = wrapCC self.clang-unwrapped;
 
diff --git a/pkgs/development/compilers/llvm/4/libc++/default.nix b/pkgs/development/compilers/llvm/4/libc++/default.nix
index a43826d7a31..b74d2fb89dc 100644
--- a/pkgs/development/compilers/llvm/4/libc++/default.nix
+++ b/pkgs/development/compilers/llvm/4/libc++/default.nix
@@ -3,7 +3,7 @@
 stdenv.mkDerivation rec {
   name = "libc++-${version}";
 
-  src = fetch "libcxx" "15ngfcjc3pjakpwfq7d4n546jj0rgfdv5rpb1qv9xgv9mp236kag";
+  src = fetch "libcxx" "0k6cmjcxnp2pyl8xwy1wkyyckkmdrjddim94yf1gzjbjy9qi22jj";
 
   postUnpack = ''
     unpackFile ${libcxxabi.src}
diff --git a/pkgs/development/compilers/llvm/4/libc++abi.nix b/pkgs/development/compilers/llvm/4/libc++abi.nix
index 3a0e996fb9a..6a3d9110136 100644
--- a/pkgs/development/compilers/llvm/4/libc++abi.nix
+++ b/pkgs/development/compilers/llvm/4/libc++abi.nix
@@ -3,7 +3,7 @@
 stdenv.mkDerivation {
   name = "libc++abi-${version}";
 
-  src = fetch "libcxxabi" "1n416kv27anabg9jsw6331r28ic30xk46p381lx2vbb2jrhwpafw";
+  src = fetch "libcxxabi" "0cqvzallxh0nwiijsf6i4d5ds9m5ijfzywg7376ncv50i64if24g";
 
   nativeBuildInputs = [ cmake ];
   buildInputs = stdenv.lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD) libunwind;
diff --git a/pkgs/development/compilers/llvm/4/lld.nix b/pkgs/development/compilers/llvm/4/lld.nix
index f9cd72b4200..776109ee74d 100644
--- a/pkgs/development/compilers/llvm/4/lld.nix
+++ b/pkgs/development/compilers/llvm/4/lld.nix
@@ -10,7 +10,7 @@
 stdenv.mkDerivation {
   name = "lld-${version}";
 
-  src = fetch "lld" "00km1qawk146pyjqa6aphcdzgkzrmg6cgk0ikg4661ffp5bn9q1k";
+  src = fetch "lld" "1v9nkpr158j4yd4zmi6rpnfxkp78r1fapr8wji9s6v176gji1kk3";
 
   nativeBuildInputs = [ cmake ];
   buildInputs = [ llvm ];
diff --git a/pkgs/development/compilers/llvm/4/lldb.nix b/pkgs/development/compilers/llvm/4/lldb.nix
index a3c46a4c7e9..7d33179913b 100644
--- a/pkgs/development/compilers/llvm/4/lldb.nix
+++ b/pkgs/development/compilers/llvm/4/lldb.nix
@@ -17,7 +17,7 @@
 stdenv.mkDerivation {
   name = "lldb-${version}";
 
-  src = fetch "lldb" "0g83hbw1r4gd0z8hlph9i34xs6dlcc69vz3h2bqwkhb2qq2qzg9d";
+  src = fetch "lldb" "0yy43a27zx3r51b6gkv3v2mdiqcq3mf0ngki47ya0i30v3gx4cl4";
 
   patches = [ ./lldb-libedit.patch ];
   postPatch = ''
diff --git a/pkgs/development/compilers/llvm/4/llvm.nix b/pkgs/development/compilers/llvm/4/llvm.nix
index 98c24495355..abfac1cce14 100644
--- a/pkgs/development/compilers/llvm/4/llvm.nix
+++ b/pkgs/development/compilers/llvm/4/llvm.nix
@@ -16,13 +16,13 @@
 , compiler-rt_src
 , libcxxabi
 , debugVersion ? false
-, enableManpages ? true
+, enableManpages ? false
 , enableSharedLibraries ? true
 , darwin
 }:
 
 let
-  src = fetch "llvm" "1giklnw71wzsgbqg9wb5x7dxnbj39m6zpfvskvzvhwvfz4fm244d";
+  src = fetch "llvm" "0l9bf7kdwhlj0kq1hawpyxhna1062z3h7qcz2y8nfl9dz2qksy6s";
   shlib = if stdenv.isDarwin then "dylib" else "so";
 
   # Used when creating a version-suffixed symlink of libLLVM.dylib
@@ -64,13 +64,6 @@ in stdenv.mkDerivation rec {
   + stdenv.lib.optionalString (enableSharedLibraries) ''
     substitute '${./llvm-outputs.patch}' ./llvm-outputs.patch --subst-var lib
     patch -p1 < ./llvm-outputs.patch
-  ''
-  # Remove broken tests: (https://bugs.llvm.org//show_bug.cgi?id=31610)
-  + ''
-    rm test/CodeGen/AMDGPU/invalid-opencl-version-metadata1.ll
-    rm test/CodeGen/AMDGPU/invalid-opencl-version-metadata2.ll
-    rm test/CodeGen/AMDGPU/invalid-opencl-version-metadata3.ll
-    rm test/CodeGen/AMDGPU/runtime-metadata.ll
   '';
 
   # hacky fix: created binaries need to be run before installation
@@ -123,11 +116,11 @@ in stdenv.mkDerivation rec {
   + stdenv.lib.optionalString enableSharedLibraries ''
     moveToOutput "lib/libLLVM-*" "$lib"
     moveToOutput "lib/libLLVM.${shlib}" "$lib"
-    substituteInPlace "$out/lib/cmake/llvm/LLVMExports-release.cmake" \
+    substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \
       --replace "\''${_IMPORT_PREFIX}/lib/libLLVM-" "$lib/lib/libLLVM-"
   ''
   + stdenv.lib.optionalString (stdenv.isDarwin && enableSharedLibraries) ''
-    substituteInPlace "$out/lib/cmake/llvm/LLVMExports-release.cmake" \
+    substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \
       --replace "\''${_IMPORT_PREFIX}/lib/libLLVM.dylib" "$lib/lib/libLLVM.dylib"
     install_name_tool -id $lib/lib/libLLVM.dylib $lib/lib/libLLVM.dylib
     install_name_tool -change @rpath/libLLVM.dylib $lib/lib/libLLVM.dylib $out/bin/llvm-config
diff --git a/pkgs/development/compilers/llvm/4/openmp.nix b/pkgs/development/compilers/llvm/4/openmp.nix
index 197e9a78465..0bdf5c71e1f 100644
--- a/pkgs/development/compilers/llvm/4/openmp.nix
+++ b/pkgs/development/compilers/llvm/4/openmp.nix
@@ -10,7 +10,7 @@
 stdenv.mkDerivation {
   name = "openmp-${version}";
 
-  src = fetch "openmp" "09kf41zgv551fnv628kqhlwgqkd2bkiwii9gqi6q12djgdddhmfv";
+  src = fetch "openmp" "195dykamd39yhi5az7nqj3ksqhb3wq30l93jnfkxl0061qbknsgc";
 
   nativeBuildInputs = [ cmake perl ];
   buildInputs = [ llvm ];
diff --git a/pkgs/development/compilers/mono/5.0.nix b/pkgs/development/compilers/mono/5.0.nix
new file mode 100644
index 00000000000..911ba0ae02a
--- /dev/null
+++ b/pkgs/development/compilers/mono/5.0.nix
@@ -0,0 +1,7 @@
+{ stdenv, callPackage, Foundation, libobjc }:
+
+callPackage ./generic-cmake.nix (rec {
+  inherit Foundation libobjc;
+  version = "5.0.1.1";
+  sha256 = "064pgsmanpybpbhpam9jv9n8aicx6mlyb7a91yzh3kcksmqsxmj8";
+})
diff --git a/pkgs/development/compilers/mono/generic-cmake.nix b/pkgs/development/compilers/mono/generic-cmake.nix
new file mode 100644
index 00000000000..f6e3f5a0100
--- /dev/null
+++ b/pkgs/development/compilers/mono/generic-cmake.nix
@@ -0,0 +1,93 @@
+{ stdenv, fetchurl, bison, pkgconfig, glib, gettext, perl, libgdiplus, libX11, callPackage, ncurses, zlib, withLLVM ? false, cacert, Foundation, libobjc, python, version, sha256, autoconf, libtool, automake, cmake, which }:
+
+let
+  llvm     = callPackage ./llvm.nix { };
+in
+stdenv.mkDerivation rec {
+  name = "mono-${version}";
+
+  src = fetchurl {
+    inherit sha256;
+    url = "http://download.mono-project.com/sources/mono/${name}.tar.bz2";
+  };
+
+  buildInputs =
+    [ bison pkgconfig glib gettext perl libgdiplus libX11 ncurses zlib python autoconf libtool automake cmake which
+    ]
+    ++ (stdenv.lib.optionals stdenv.isDarwin [ Foundation libobjc ]);
+
+  propagatedBuildInputs = [glib];
+
+  NIX_LDFLAGS = if stdenv.isDarwin then "" else "-lgcc_s" ;
+
+  # To overcome the bug https://bugzilla.novell.com/show_bug.cgi?id=644723
+  dontDisableStatic = true;
+
+  # In fact I think this line does not help at all to what I
+  # wanted to achieve: have mono to find libgdiplus automatically
+  configureFlags = [
+    "--x-includes=${libX11.dev}/include"
+    "--x-libraries=${libX11.out}/lib"
+    "--with-libgdiplus=${libgdiplus}/lib/libgdiplus.so"
+  ]
+  ++ stdenv.lib.optionals withLLVM [
+    "--enable-llvm"
+    "--enable-llvmloaded"
+    "--with-llvm=${llvm}"
+  ];
+
+  configurePhase = ''
+    patchShebangs ./
+    ./autogen.sh --prefix $out
+  '';
+
+  # Attempt to fix this error when running "mcs --version":
+  # The file /nix/store/xxx-mono-2.4.2.1/lib/mscorlib.dll is an invalid CIL image
+  dontStrip = true;
+
+  # Parallel building doesn't work, as shows http://hydra.nixos.org/build/2983601
+  enableParallelBuilding = false;
+
+  # We want pkg-config to take priority over the dlls in the Mono framework and the GAC
+  # because we control pkg-config
+  patches = [ ./pkgconfig-before-gac.patch ];
+
+  # Patch all the necessary scripts. Also, if we're using LLVM, we fix the default
+  # LLVM path to point into the Mono LLVM build, since it's private anyway.
+  preBuild = ''
+    makeFlagsArray=(INSTALL=`type -tp install`)
+    substituteInPlace mcs/class/corlib/System/Environment.cs --replace /usr/share "$out/share"
+  '' + stdenv.lib.optionalString withLLVM ''
+    substituteInPlace mono/mini/aot-compiler.c --replace "llvm_path = g_strdup (\"\")" "llvm_path = g_strdup (\"${llvm}/bin/\")"
+  '';
+
+  # Fix mono DLLMap so it can find libX11 and gdiplus to run winforms apps
+  # Other items in the DLLMap may need to be pointed to their store locations, I don't think this is exhaustive
+  # http://www.mono-project.com/Config_DllMap
+  postBuild = ''
+    find . -name 'config' -type f | xargs \
+    sed -i -e "s@libX11.so.6@${libX11.out}/lib/libX11.so.6@g" \
+           -e "s@/.*libgdiplus.so@${libgdiplus}/lib/libgdiplus.so@g" \
+  '';
+
+  # Without this, any Mono application attempting to open an SSL connection will throw with
+  # The authentication or decryption has failed.
+  # ---> Mono.Security.Protocol.Tls.TlsException: Invalid certificate received from server.
+  postInstall = ''
+    echo "Updating Mono key store"
+    $out/bin/cert-sync ${cacert}/etc/ssl/certs/ca-bundle.crt
+  ''
+  # According to [1], gmcs is just mcs
+  # [1] https://github.com/mono/mono/blob/master/scripts/gmcs.in
+  + ''
+    ln -s $out/bin/mcs $out/bin/gmcs
+  '';
+
+  meta = {
+    homepage = http://mono-project.com/;
+    description = "Cross platform, open source .NET development framework";
+    platforms = with stdenv.lib.platforms; darwin ++ linux;
+    maintainers = with stdenv.lib.maintainers; [ viric thoughtpolice obadz vrthra ];
+    license = stdenv.lib.licenses.free; # Combination of LGPL/X11/GPL ?
+  };
+}
diff --git a/pkgs/development/compilers/mono/pkgconfig-before-gac-5x.patch b/pkgs/development/compilers/mono/pkgconfig-before-gac-5x.patch
new file mode 100644
index 00000000000..1b9c59402bf
--- /dev/null
+++ b/pkgs/development/compilers/mono/pkgconfig-before-gac-5x.patch
@@ -0,0 +1,65 @@
+diff -Naur mono-5.0.0/mcs/tools/xbuild/data/3.5/Microsoft.Common.targets.old mono-5.0.0/mcs/tools/xbuild/data/3.5/Microsoft.Common.targets
+--- mono-5.0.0/mcs/tools/xbuild/data/3.5/Microsoft.Common.targets.old	2017-04-24 23:45:18.348116305 +0200
++++ mono-5.0.0/mcs/tools/xbuild/data/3.5/Microsoft.Common.targets	2017-04-24 23:45:11.407051755 +0200
+@@ -167,8 +167,8 @@
+ 			$(ReferencePath);
+ 			@(AdditionalReferencePath);
+ 			{HintPathFromItem};
+-			{TargetFrameworkDirectory};
+ 			{PkgConfig};
++			{TargetFrameworkDirectory};
+ 			{GAC};
+ 			{RawFileName};
+ 			$(OutDir)
+diff -Naur mono-5.0.0/mcs/tools/xbuild/data/4.0/Microsoft.Common.targets.old mono-5.0.0/mcs/tools/xbuild/data/4.0/Microsoft.Common.targets
+--- mono-5.0.0/mcs/tools/xbuild/data/4.0/Microsoft.Common.targets.old	2017-04-24 23:49:53.019616196 +0200
++++ mono-5.0.0/mcs/tools/xbuild/data/4.0/Microsoft.Common.targets	2017-04-24 23:50:05.709729585 +0200
+@@ -232,8 +232,8 @@
+ 			$(ReferencePath);
+ 			@(AdditionalReferencePath);
+ 			{HintPathFromItem};
+-			{TargetFrameworkDirectory};
+ 			{PkgConfig};
++			{TargetFrameworkDirectory};
+ 			{GAC};
+ 			{RawFileName};
+ 			$(OutDir)
+diff -Naur mono-5.0.0/mcs/tools/xbuild/data/2.0/Microsoft.Common.targets.old mono-5.0.0/mcs/tools/xbuild/data/2.0/Microsoft.Common.targets
+--- mono-5.0.0/mcs/tools/xbuild/data/2.0/Microsoft.Common.targets.old	2017-04-24 23:52:33.200037047 +0200
++++ mono-5.0.0/mcs/tools/xbuild/data/2.0/Microsoft.Common.targets	2017-04-24 23:52:43.281125802 +0200
+@@ -139,8 +139,8 @@
+ 			$(ReferencePath);
+ 			@(AdditionalReferencePath);
+ 			{HintPathFromItem};
+-			{TargetFrameworkDirectory};
+ 			{PkgConfig};
++			{TargetFrameworkDirectory};
+ 			{GAC};
+ 			{RawFileName};
+ 			$(OutDir)
+diff -Naur mono-5.0.0/mcs/tools/xbuild/data/14.0/Microsoft.Common.targets.old mono-5.0.0/mcs/tools/xbuild/data/14.0/Microsoft.Common.targets
+--- mono-5.0.0/mcs/tools/xbuild/data/14.0/Microsoft.Common.targets.old	2017-04-24 23:54:02.585821594 +0200
++++ mono-5.0.0/mcs/tools/xbuild/data/14.0/Microsoft.Common.targets	2017-04-24 23:54:09.313880438 +0200
+@@ -234,8 +234,8 @@
+ 			$(ReferencePath);
+ 			@(AdditionalReferencePath);
+ 			{HintPathFromItem};
+-			{TargetFrameworkDirectory};
+ 			{PkgConfig};
++			{TargetFrameworkDirectory};
+ 			{GAC};
+ 			{RawFileName};
+ 			$(OutDir)
+diff -Naur mono-5.0.0/mcs/tools/xbuild/data/12.0/Microsoft.Common.targets.old mono-5.0.0/mcs/tools/xbuild/data/12.0/Microsoft.Common.targets
+--- mono-5.0.0/mcs/tools/xbuild/data/12.0/Microsoft.Common.targets.old	2017-04-24 23:55:46.244895155 +0200
++++ mono-5.0.0/mcs/tools/xbuild/data/12.0/Microsoft.Common.targets	2017-04-24 23:55:51.998961342 +0200
+@@ -232,8 +232,8 @@
+ 			$(ReferencePath);
+ 			@(AdditionalReferencePath);
+ 			{HintPathFromItem};
+-			{TargetFrameworkDirectory};
+ 			{PkgConfig};
++			{TargetFrameworkDirectory};
+ 			{GAC};
+ 			{RawFileName};
+ 			$(OutDir)
diff --git a/pkgs/development/compilers/neko/default.nix b/pkgs/development/compilers/neko/default.nix
index 493748d369b..e90f3af704d 100644
--- a/pkgs/development/compilers/neko/default.nix
+++ b/pkgs/development/compilers/neko/default.nix
@@ -24,6 +24,12 @@ stdenv.mkDerivation rec {
           + "fe87462d9c7a6ee27e28f5be5e4fc0ac87b34574.patch";
       sha256 = "1jbmq6j32vg3qv20dbh82cp54886lgrh7gkcqins8a2y4l4dl3sc";
     })
+    # https://github.com/HaxeFoundation/neko/pull/165
+    (fetchpatch {
+      url = "https://github.com/HaxeFoundation/neko/commit/"
+          + "c6d9c6d796200990b3b6a53a4dc716c9192398e6.patch";
+      sha256 = "1pq0qhhb9gbhc3zbgylwp0amhwsz0q0ggpj6v2xgv0hfy7d63rcd";
+    })
   ];
 
   buildInputs =
diff --git a/pkgs/development/compilers/ocaml/4.04.nix b/pkgs/development/compilers/ocaml/4.04.nix
index a63034d700d..4f49bcf8072 100644
--- a/pkgs/development/compilers/ocaml/4.04.nix
+++ b/pkgs/development/compilers/ocaml/4.04.nix
@@ -1,8 +1,8 @@
 import ./generic.nix {
   major_version = "4";
   minor_version = "04";
-  patch_version = "1";
-  sha256 = "11f2kcldpad9h5ihi1crad5lvv2501iccb2g4c8m197fnjac8b12";
+  patch_version = "2";
+  sha256 = "0bhgjzi78l10824qga85nlh18jg9lb6aiamf9dah1cs6jhzfsn6i";
 
   # If the executable is stipped it does not work
   dontStrip = true;
diff --git a/pkgs/development/compilers/ocaml/4.05.nix b/pkgs/development/compilers/ocaml/4.05.nix
new file mode 100644
index 00000000000..a63b06a9f62
--- /dev/null
+++ b/pkgs/development/compilers/ocaml/4.05.nix
@@ -0,0 +1,9 @@
+import ./generic.nix {
+  major_version = "4";
+  minor_version = "05";
+  patch_version = "0";
+  sha256 = "1y9fw1ci9pwnbbrr9nwr8cq8vypcxwdf4akvxard3mxl2jx2g984";
+
+  # If the executable is stipped it does not work
+  dontStrip = true;
+}
diff --git a/pkgs/development/compilers/openjdk-darwin/8.nix b/pkgs/development/compilers/openjdk-darwin/8.nix
index 51effd2c784..691829c7788 100644
--- a/pkgs/development/compilers/openjdk-darwin/8.nix
+++ b/pkgs/development/compilers/openjdk-darwin/8.nix
@@ -33,7 +33,7 @@ let
       # any package that depends on the JRE has $CLASSPATH set up
       # properly.
       mkdir -p $out/nix-support
-      echo -n "${setJavaClassPath}" > $out/nix-support/propagated-native-build-inputs
+      printLines ${setJavaClassPath} > $out/nix-support/propagated-native-build-inputs
 
       install_name_tool -change /usr/X11/lib/libfreetype.6.dylib ${freetype}/lib/libfreetype.6.dylib $out/jre/lib/libfontmanager.dylib
 
diff --git a/pkgs/development/compilers/openjdk-darwin/default.nix b/pkgs/development/compilers/openjdk-darwin/default.nix
index 10a9eb2b366..8ce0835fcb6 100644
--- a/pkgs/development/compilers/openjdk-darwin/default.nix
+++ b/pkgs/development/compilers/openjdk-darwin/default.nix
@@ -23,7 +23,7 @@ let
       # any package that depends on the JRE has $CLASSPATH set up
       # properly.
       mkdir -p $out/nix-support
-      echo -n "${setJavaClassPath}" > $out/nix-support/propagated-native-build-inputs
+      printLines ${setJavaClassPath} > $out/nix-support/propagated-native-build-inputs
 
       install_name_tool -change /usr/X11/lib/libfreetype.6.dylib ${freetype}/lib/libfreetype.6.dylib $out/jre/lib/libfontmanager.dylib
 
diff --git a/pkgs/development/compilers/openjdk/7.nix b/pkgs/development/compilers/openjdk/7.nix
index 6dcbb0a330f..9ef7d26b2ef 100644
--- a/pkgs/development/compilers/openjdk/7.nix
+++ b/pkgs/development/compilers/openjdk/7.nix
@@ -190,7 +190,7 @@ let
       # any package that depends on the JRE has $CLASSPATH set up
       # properly.
       mkdir -p $jre/nix-support
-      echo -n "${setJavaClassPath}" > $jre/nix-support/propagated-native-build-inputs
+      printLines ${setJavaClassPath} > $jre/nix-support/propagated-native-build-inputs
 
       # Set JAVA_HOME automatically.
       mkdir -p $out/nix-support
diff --git a/pkgs/development/compilers/openjdk/8.nix b/pkgs/development/compilers/openjdk/8.nix
index e157249fb2f..8dbace8dda1 100644
--- a/pkgs/development/compilers/openjdk/8.nix
+++ b/pkgs/development/compilers/openjdk/8.nix
@@ -202,7 +202,7 @@ let
       # any package that depends on the JRE has $CLASSPATH set up
       # properly.
       mkdir -p $jre/nix-support
-      echo -n "${setJavaClassPath}" > $jre/nix-support/propagated-native-build-inputs
+      printLines ${setJavaClassPath} > $jre/nix-support/propagated-native-build-inputs
 
       # Set JAVA_HOME automatically.
       mkdir -p $out/nix-support
diff --git a/pkgs/development/compilers/oraclejdk/jdk-linux-base.nix b/pkgs/development/compilers/oraclejdk/jdk-linux-base.nix
index 8fe775de146..08fd724f773 100644
--- a/pkgs/development/compilers/oraclejdk/jdk-linux-base.nix
+++ b/pkgs/development/compilers/oraclejdk/jdk-linux-base.nix
@@ -3,6 +3,7 @@
 , downloadUrl
 , sha256_i686
 , sha256_x86_64
+, sha256_armv7l
 , jceName
 , jceDownloadUrl
 , sha256JCE
@@ -34,10 +35,13 @@
 , setJavaClassPath
 }:
 
-assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
+assert stdenv.system == "i686-linux"
+    || stdenv.system == "x86_64-linux"
+    || stdenv.system == "armv7l-linux";
 assert swingSupport -> xorg != null;
 
 let
+  abortArch = abort "jdk requires i686-linux, x86_64-linux, or armv7l-linux";
 
   /**
    * The JRE libraries are in directories that depend on the CPU.
@@ -47,8 +51,10 @@ let
       "i386"
     else if stdenv.system == "x86_64-linux" then
       "amd64"
+    else if stdenv.system == "armv7l-linux" then
+      "arm"
     else
-      abort "jdk requires i686-linux or x86_64 linux";
+      abortArch;
 
   jce =
     if installjce then
@@ -59,6 +65,14 @@ let
       }
     else
       "";
+
+  rSubPaths = [
+    "lib/${architecture}/jli"
+    "lib/${architecture}/server"
+    "lib/${architecture}/xawt"
+    "lib/${architecture}"
+  ];
+
 in
 
 let result = stdenv.mkDerivation rec {
@@ -78,8 +92,14 @@ let result = stdenv.mkDerivation rec {
         url = downloadUrl;
         sha256 = sha256_x86_64;
       }
+    else if stdenv.system == "armv7l-linux" then
+      requireFile {
+        name = "jdk-${productVersion}u${patchVersion}-linux-arm32-vfp-hflt.tar.gz";
+        url = downloadUrl;
+        sha256 = sha256_armv7l;
+      }
     else
-      abort "jdk requires i686-linux or x86_64 linux";
+      abortArch;
 
   nativeBuildInputs = [ file ]
     ++ stdenv.lib.optional installjce unzip;
@@ -134,18 +154,6 @@ let result = stdenv.mkDerivation rec {
       cp -v UnlimitedJCEPolicy*/*.jar $jrePath/lib/security
     fi
 
-    rpath=$rpath''${rpath:+:}$jrePath/lib/${architecture}/jli
-    rpath=$rpath''${rpath:+:}$jrePath/lib/${architecture}/server
-    rpath=$rpath''${rpath:+:}$jrePath/lib/${architecture}/xawt
-    rpath=$rpath''${rpath:+:}$jrePath/lib/${architecture}
-
-    # set all the dynamic linkers
-    find $out -type f -perm -0100 \
-        -exec patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
-        --set-rpath "$rpath" {} \;
-
-    find $out -name "*.so" -exec patchelf --set-rpath "$rpath" {} \;
-
     if test -z "$pluginSupport"; then
       rm -f $out/bin/javaws
       if test -n "$installjdk"; then
@@ -157,17 +165,28 @@ let result = stdenv.mkDerivation rec {
     ln -s $jrePath/lib/${architecture}/libnpjp2.so $jrePath/lib/${architecture}/plugins
 
     mkdir -p $out/nix-support
-    echo -n "${setJavaClassPath}" > $out/nix-support/propagated-native-build-inputs
+    printLines ${setJavaClassPath} > $out/nix-support/propagated-native-build-inputs
 
     # Set JAVA_HOME automatically.
     cat <<EOF >> $out/nix-support/setup-hook
     if [ -z "\$JAVA_HOME" ]; then export JAVA_HOME=$out; fi
     EOF
+  '';
+
+  postFixup = ''
+    rpath+="''${rpath:+:}${stdenv.lib.concatStringsSep ":" (map (a: "$jrePath/${a}") rSubPaths)}"
+
+    # set all the dynamic linkers
+    find $out -type f -perm -0100 \
+        -exec patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+        --set-rpath "$rpath" {} \;
+
+    find $out -name "*.so" -exec patchelf --set-rpath "$rpath" {} \;
 
     # Oracle Java Mission Control needs to know where libgtk-x11 and related is
-    if test -n "$installjdk"; then
+    if test -n "$installjdk" -a -x $out/bin/jmc; then
       wrapProgram "$out/bin/jmc" \
-          --suffix-each LD_LIBRARY_PATH ':' "${rpath}"
+          --suffix-each LD_LIBRARY_PATH ':' "$rpath"
     fi
   '';
 
@@ -192,7 +211,7 @@ let result = stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     license = licenses.unfree;
-    platforms = [ "i686-linux" "x86_64-linux" ]; # some inherit jre.meta.platforms
+    platforms = [ "i686-linux" "x86_64-linux" "armv7l-linux" ]; # some inherit jre.meta.platforms
   };
 
 }; in result
diff --git a/pkgs/development/compilers/oraclejdk/jdk8cpu-linux.nix b/pkgs/development/compilers/oraclejdk/jdk8cpu-linux.nix
index 8e93f76ff18..1c761d58603 100644
--- a/pkgs/development/compilers/oraclejdk/jdk8cpu-linux.nix
+++ b/pkgs/development/compilers/oraclejdk/jdk8cpu-linux.nix
@@ -4,6 +4,7 @@ import ./jdk-linux-base.nix {
   downloadUrl = http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html;
   sha256_i686 = "0m3i1n1im1nlwb06wlsdajv19cd3zhrjkw8zbyjfznydn6qs4s80";
   sha256_x86_64 = "0dhj623ya01glcl3iir9ajifcrf6awhvpk936x9cxfj8zfyibck2";
+  sha256_armv7l = "0ja97nqn4x0ji16c7r6i9nnnj3745br7qlbj97jg1s8m2wk7f9jd";
   jceName = "jce_policy-8.zip";
   jceDownloadUrl = http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html;
   sha256JCE = "0n8b6b8qmwb14lllk2lk1q1ahd3za9fnjigz5xn65mpg48whl0pk";
diff --git a/pkgs/development/compilers/oraclejdk/jdk8psu-linux.nix b/pkgs/development/compilers/oraclejdk/jdk8psu-linux.nix
index 8e93f76ff18..1c761d58603 100644
--- a/pkgs/development/compilers/oraclejdk/jdk8psu-linux.nix
+++ b/pkgs/development/compilers/oraclejdk/jdk8psu-linux.nix
@@ -4,6 +4,7 @@ import ./jdk-linux-base.nix {
   downloadUrl = http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html;
   sha256_i686 = "0m3i1n1im1nlwb06wlsdajv19cd3zhrjkw8zbyjfznydn6qs4s80";
   sha256_x86_64 = "0dhj623ya01glcl3iir9ajifcrf6awhvpk936x9cxfj8zfyibck2";
+  sha256_armv7l = "0ja97nqn4x0ji16c7r6i9nnnj3745br7qlbj97jg1s8m2wk7f9jd";
   jceName = "jce_policy-8.zip";
   jceDownloadUrl = http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html;
   sha256JCE = "0n8b6b8qmwb14lllk2lk1q1ahd3za9fnjigz5xn65mpg48whl0pk";
diff --git a/pkgs/development/compilers/ponyc/default.nix b/pkgs/development/compilers/ponyc/default.nix
index 6b7f87b1e95..6e393426b7a 100644
--- a/pkgs/development/compilers/ponyc/default.nix
+++ b/pkgs/development/compilers/ponyc/default.nix
@@ -3,13 +3,13 @@
 
 stdenv.mkDerivation ( rec {
   name = "ponyc-${version}";
-  version = "0.14.0";
+  version = "0.15.0";
 
   src = fetchFromGitHub {
     owner = "ponylang";
     repo = "ponyc";
     rev = version;
-    sha256 = "0zzr3mmjp7010d3jfly6lbwaib546praml97kgj92yixahnwz533";
+    sha256 = "02hmn066jswaij2ib0faabm2i9cqz562z6s0vakgwnxyrk4qayif";
   };
 
   buildInputs = [ llvm makeWrapper which ];
diff --git a/pkgs/development/compilers/ponyc/pony-stable.nix b/pkgs/development/compilers/ponyc/pony-stable.nix
index 9bee8e299c0..c91d9d603d5 100644
--- a/pkgs/development/compilers/ponyc/pony-stable.nix
+++ b/pkgs/development/compilers/ponyc/pony-stable.nix
@@ -1,13 +1,13 @@
 {stdenv, fetchFromGitHub, ponyc }:
 
 stdenv.mkDerivation {
-  name = "pony-stable-unstable-2017-03-30";
+  name = "pony-stable-unstable-2017-04-20";
 
   src = fetchFromGitHub {
-    owner = "jemc";
+    owner = "ponylang";
     repo = "pony-stable";
-    rev = "39890c7f11f79009630de6b551bd076868f7f5a2";
-    sha256 = "1w15dg4l03zzncpllwww8jhsj7z1wgvhf89n7agr9f1w9m2zpskc";
+    rev = "b2ea566b02ec40480f888652b04eaa5f191a241e";
+    sha256 = "1bixkxccsrnyip3yp42r14rbhk832pvzwbkh6ash4ip2isxa6b19";
   };
 
   buildInputs = [ ponyc ];
diff --git a/pkgs/development/compilers/purescript/psc-package/default.nix b/pkgs/development/compilers/purescript/psc-package/default.nix
index 70ef8b63277..306eaa93958 100644
--- a/pkgs/development/compilers/purescript/psc-package/default.nix
+++ b/pkgs/development/compilers/purescript/psc-package/default.nix
@@ -4,13 +4,13 @@ with lib;
 
 mkDerivation rec {
   pname = "psc-package";
-  version = "0.1.1";
+  version = "0.2.0";
 
   src = fetchFromGitHub {
     owner = "purescript";
     repo = pname;
     rev = "v${version}";
-    sha256 = "078xjn10yq4i0ff78bxscvxhn29p3s7iwv3pjyqxzlhaymn5949l";
+    sha256 = "0vid8vc8n8xj0qa4gnm1any9s18rdh7yn960vgix17r7a3bdndwb";
   };
 
   isLibrary = false;
diff --git a/pkgs/development/compilers/reason/default.nix b/pkgs/development/compilers/reason/default.nix
index 7bd4750551f..e364f536c88 100644
--- a/pkgs/development/compilers/reason/default.nix
+++ b/pkgs/development/compilers/reason/default.nix
@@ -2,12 +2,12 @@
   ocaml, opam, topkg, menhir, merlin_extend, ppx_tools_versioned, utop }:
 
 let 
-  version = "1.13.4";
+  version = "2.0.0";
   src = fetchFromGitHub {
     owner = "facebook";
     repo = "reason";
     rev = version;
-    sha256 = "03r2ciikgwaq1dkzgzc8n7h7y0q95ajh6n9bb2n5bpgfhwkr1wqi";
+    sha256 = "0l3lwfvppplah707rq5nqjav2354lq6d7xfflfigkzhn74hlx6iy";
   };
   meta = with stdenv.lib; {
     homepage = https://facebook.github.io/reason/;
diff --git a/pkgs/development/compilers/rust/nightlyBin.nix b/pkgs/development/compilers/rust/nightlyBin.nix
index bdb11bd5b52..af06835c5de 100644
--- a/pkgs/development/compilers/rust/nightlyBin.nix
+++ b/pkgs/development/compilers/rust/nightlyBin.nix
@@ -7,7 +7,7 @@ let
 
   bootstrapHash =
     if stdenv.system == "x86_64-linux"
-    then "21f38f46bf16373d3240a38b775e1acff9bb429f1570a4d4da8b3000315d0085"
+    then "0svlm4bxsdhdn4jsv46f278kid23a9w978q2137qrba4xnyb06kf"
     else throw "missing bootstrap hash for platform ${stdenv.system}";
 
   src = fetchurl {
@@ -15,7 +15,7 @@ let
      sha256 = bootstrapHash;
   };
 
-  version = "2017-05-30";
+  version = "2017-06-26";
 in import ./binaryBuild.nix
   { inherit stdenv fetchurl makeWrapper cacert zlib buildRustPackage curl;
     inherit version src platform;
diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix
index 4e0d0971cb6..28863e450a7 100644
--- a/pkgs/development/compilers/rust/rustc.nix
+++ b/pkgs/development/compilers/rust/rustc.nix
@@ -10,6 +10,7 @@
 , targetPatches
 , targetToolchains
 , doCheck ? true
+, buildPlatform, hostPlatform
 } @ args:
 
 let
@@ -137,7 +138,7 @@ stdenv.mkDerivation {
 
   inherit doCheck;
 
-  dontSetConfigureCross = true;
+  configurePlatforms = [];
 
   # https://github.com/NixOS/nixpkgs/pull/21742#issuecomment-272305764
   # https://github.com/rust-lang/rust/issues/30181
diff --git a/pkgs/development/compilers/sbcl/default.nix b/pkgs/development/compilers/sbcl/default.nix
index dcd110954c1..3bd1982baa5 100644
--- a/pkgs/development/compilers/sbcl/default.nix
+++ b/pkgs/development/compilers/sbcl/default.nix
@@ -9,11 +9,11 @@
 
 stdenv.mkDerivation rec {
   name    = "sbcl-${version}";
-  version = "1.3.17";
+  version = "1.3.19";
 
   src = fetchurl {
     url    = "mirror://sourceforge/project/sbcl/sbcl/${version}/${name}-source.tar.bz2";
-    sha256 = "1bqd39cqcv129zxvp3w3z1x46m9g9nmgslnlrvcsbqwd69vgbfcl";
+    sha256 = "0660gw43myikpa6n2qjhjxz61ilqazva4v8shljgwymag99risxm";
   };
 
   patchPhase = ''
diff --git a/pkgs/development/compilers/solc/default.nix b/pkgs/development/compilers/solc/default.nix
index 3ed5a2bef72..714f06d0b53 100644
--- a/pkgs/development/compilers/solc/default.nix
+++ b/pkgs/development/compilers/solc/default.nix
@@ -1,30 +1,35 @@
 { stdenv, fetchzip, fetchgit, boost, cmake }:
 
-let jsoncpp = fetchzip {
-  url = https://github.com/open-source-parsers/jsoncpp/archive/1.7.7.tar.gz;
-  sha256 = "0jz93zv17ir7lbxb3dv8ph2n916rajs8i96immwx9vb45pqid3n0";
-}; in
-
-let commit = "68ef5810593e7c8092ed41d5f474dd43141624eb"; in
+let
+  version = "0.4.13";
+  rev = "0fb4cb1ab9bb4b6cc72e28cc5a1753ad14781f14";
+  sha256 = "0rhrm0bmk5s2358j40yx7dzr1938q17dchzflrxw6y7yvkhscxrm";
+  jsoncppURL = https://github.com/open-source-parsers/jsoncpp/archive/1.7.7.tar.gz;
+  jsoncpp = fetchzip {
+    url = jsoncppURL;
+    sha256 = "0jz93zv17ir7lbxb3dv8ph2n916rajs8i96immwx9vb45pqid3n0";
+  };
+in
 
-stdenv.mkDerivation rec {
-  version = "0.4.11";
+stdenv.mkDerivation {
   name = "solc-${version}";
 
   # Cannot use `fetchFromGitHub' because of submodules
   src = fetchgit {
     url = "https://github.com/ethereum/solidity";
-    rev = commit;
-    sha256 = "13zycybf23yvf3hkf9zgw9gbc1y4ifzxaf7sll69bsn24fcyq961";
+    inherit rev sha256;
   };
 
   patchPhase = ''
-    echo >commit_hash.txt ${commit}
+    echo >commit_hash.txt '${rev}'
     echo >prerelease.txt
     substituteInPlace deps/jsoncpp.cmake \
-      --replace https://github.com/open-source-parsers/jsoncpp/archive/1.7.7.tar.gz ${jsoncpp}
+      --replace '${jsoncppURL}' ${jsoncpp}
     substituteInPlace cmake/EthCompilerSettings.cmake \
       --replace 'add_compile_options(-Werror)' ""
+    substituteInPlace cmake/EthDependencies.cmake \
+      --replace 'set(Boost_USE_STATIC_LIBS ON)'   \
+                'set(Boost_USE_STATIC_LIBS OFF)'
   '';
 
   buildInputs = [ boost cmake ];
@@ -34,6 +39,7 @@ stdenv.mkDerivation rec {
     longDescription = "This package also includes `lllc', the LLL compiler.";
     homepage = https://github.com/ethereum/solidity;
     license = stdenv.lib.licenses.gpl3;
+    platforms = with stdenv.lib.platforms; linux ++ darwin;
     maintainers = [ stdenv.lib.maintainers.dbrock ];
     inherit version;
   };
diff --git a/pkgs/development/compilers/swift/patches/build-script-pax.patch b/pkgs/development/compilers/swift/patches/build-script-pax.patch
index 9f1976a2d88..fa2ccdf9d5c 100644
--- a/pkgs/development/compilers/swift/patches/build-script-pax.patch
+++ b/pkgs/development/compilers/swift/patches/build-script-pax.patch
@@ -1,12 +1,13 @@
 --- swift/utils/build-script-impl	2017-01-23 12:47:20.401326309 -0600
 +++ swift-pax/utils/build-script-impl	2017-01-23 13:24:10.339366996 -0600
-@@ -1823,6 +1823,16 @@ function set_lldb_xcodebuild_options() {
+@@ -1823,6 +1823,17 @@ function set_lldb_xcodebuild_options() {
      fi
  }
  
 +## XXX: Taken from nixpkgs /pkgs/stdenv/generic/setup.sh
 +isELF() {
 +    local fn="$1"
++    local fd
 +    local magic
 +    exec {fd}< "$fn"
 +    read -n 4 -u $fd magic
diff --git a/pkgs/development/compilers/tinycc/default.nix b/pkgs/development/compilers/tinycc/default.nix
index c7e3c4b3c67..7e083ffe67b 100644
--- a/pkgs/development/compilers/tinycc/default.nix
+++ b/pkgs/development/compilers/tinycc/default.nix
@@ -2,10 +2,10 @@
 with stdenv.lib;
 
 let
-  date = "20170605";
+  date = "20170710";
   version = "0.9.27pre-${date}";
-  rev = "3e4b7693bfd5b76570b35558c83a935326513eff";
-  sha256 = "0m5k1df73kakvg9xz06y3nlac4mwfccni6hdijaf4w8fyy3zz4bg";
+  rev = "2acb04f7f2077a4cff103421d79ceee48441918a";
+  sha256 = "1rh89dx1myqfm752d4rlzrm8aadfm17fm88ps0q9ibmbxavb45qw";
 in
 
 stdenv.mkDerivation rec {
diff --git a/pkgs/development/compilers/wla-dx/default.nix b/pkgs/development/compilers/wla-dx/default.nix
index 13a48aaaa30..2ea2faa3e09 100644
--- a/pkgs/development/compilers/wla-dx/default.nix
+++ b/pkgs/development/compilers/wla-dx/default.nix
@@ -1,13 +1,14 @@
 {stdenv, fetchFromGitHub, cmake}:
 
 stdenv.mkDerivation rec {
-  name = "wla-dx-git-2016-02-27";
+  version = "2017-06-05";
+  name = "wla-dx-git-${version}";
 
   src = fetchFromGitHub {
     owner = "vhelin";
     repo = "wla-dx";
-    rev = "8189fe8d5620584ea16563875ff3c5430527c86a";
-    sha256 = "02zgkcyfx7y8j6jvyi12lm29fydnd7m3rxv6g2psv23fyzmpkkir";
+    rev = "ae6843f9711cbc2fa6dd8c200877b40bd2bcad7f";
+    sha256 = "09c2kz12ld97ad41j6r8r65jknllrak1x8r43fgr26x7hdlxz5c6";
   };
 
   hardeningDisable = [ "format" ];
diff --git a/pkgs/development/compilers/zulu/default.nix b/pkgs/development/compilers/zulu/default.nix
index 7621aa82bc7..03be4ee8a0b 100644
--- a/pkgs/development/compilers/zulu/default.nix
+++ b/pkgs/development/compilers/zulu/default.nix
@@ -1,17 +1,28 @@
-{ stdenv, pkgs, fetchurl, unzip, makeWrapper, setJavaClassPath, swingSupport ? true }:
-
-with pkgs;
+{ stdenv, lib, fetchurl, unzip, makeWrapper, setJavaClassPath
+, zulu, glib, libxml2, libav_0_8, ffmpeg, libxslt, mesa_noglu, alsaLib
+, fontconfig, freetype, gnome2, cairo, gdk_pixbuf, atk, xorg
+, swingSupport ? true }:
 
 let
-  version = "8.19.0.1";
-  openjdk = "8.0.112";
+  version = "8.21.0.1";
+  openjdk = "8.0.131";
 
-  sha256_linux = "1icb6in1197n44wk2cqnrxr7w0bd5abxxysfrhbg56jlb9nzmp4x";
-  sha256_darwin = "0kxwh62a6kckc9l9jkgakf86lqkqazp3dwfwaxqc4cg5zczgbhmd";
+  sha256_linux = "0cr1wvk1ifdq69ia8sr6171yzciba8l5x7dszwa5g2v0vmmqq88p";
+  sha256_darwin = "0xq9bdzbdq8wq48gj6j56bw30l2iafz6sy1wdhrf92n9bnz5qmw7";
 
   platform = if stdenv.isDarwin then "macosx" else "linux";
   hash = if stdenv.isDarwin then sha256_darwin else sha256_linux;
   extension = if stdenv.isDarwin then "zip" else "tar.gz";
+
+  libraries = [
+    stdenv.cc.libc glib libxml2 libav_0_8 ffmpeg libxslt mesa_noglu
+    xorg.libXxf86vm alsaLib fontconfig freetype gnome2.pango
+    gnome2.gtk cairo gdk_pixbuf atk
+  ] ++ (lib.optionals swingSupport (with xorg; [
+    xorg.libX11 xorg.libXext xorg.libXtst xorg.libXi xorg.libXp
+    xorg.libXt xorg.libXrender stdenv.cc.cc
+  ]));
+
 in stdenv.mkDerivation rec {
   inherit version openjdk platform hash extension;
 
@@ -22,7 +33,7 @@ in stdenv.mkDerivation rec {
     sha256 = hash;
   };
 
-  buildInputs = [ makeWrapper ] ++ stdenv.lib.optional stdenv.isDarwin [ unzip ];
+  buildInputs = [ makeWrapper ] ++ lib.optional stdenv.isDarwin unzip;
 
   installPhase = ''
     mkdir -p $out
@@ -43,7 +54,7 @@ in stdenv.mkDerivation rec {
     find $out -name "*.so" -exec patchelf --set-rpath "$rpath" {} \;
 
     mkdir -p $out/nix-support
-    echo -n "${setJavaClassPath}" > $out/nix-support/propagated-native-build-inputs
+    printLines ${setJavaClassPath} > $out/nix-support/propagated-native-build-inputs
 
     # Set JAVA_HOME automatically.
     cat <<EOF >> $out/nix-support/setup-hook
@@ -51,9 +62,6 @@ in stdenv.mkDerivation rec {
     EOF
   '';
 
-  libraries = [ stdenv.cc.libc glib libxml2 libav_0_8 ffmpeg libxslt mesa_noglu xorg.libXxf86vm alsaLib fontconfig freetype gnome2.pango gnome2.gtk cairo gdk_pixbuf atk ]
-      ++ (if swingSupport then [ xorg.libX11 xorg.libXext xorg.libXtst xorg.libXi xorg.libXp xorg.libXt xorg.libXrender stdenv.cc.cc ] else [ ]);
-
   rpath = stdenv.lib.strings.makeLibraryPath libraries;
 
   passthru = {
@@ -64,8 +72,11 @@ in stdenv.mkDerivation rec {
     homepage = https://www.azul.com/products/zulu/;
     license = licenses.gpl2;
     description = "Certified builds of OpenJDK";
-    longDescription = "Certified builds of OpenJDK that can be deployed across multiple operating systems, containers, hypervisors and Cloud platforms";
-    maintainers = with maintainers; [ nequissimus ];
+    longDescription = ''
+      Certified builds of OpenJDK that can be deployed across multiple
+      operating systems, containers, hypervisors and Cloud platforms.
+    '';
+    maintainers = with maintainers; [ nequissimus fpletz ];
     platforms = [ "x86_64-linux" "x86_64-darwin" ];
   };
 }