summary refs log tree commit diff
path: root/pkgs/development/compilers
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2015-12-31 09:47:26 +0100
committerVladimír Čunát <vcunat@gmail.com>2015-12-31 09:53:02 +0100
commitf9f6f41bff2213e199bded515e9b66d1e5c4d7dd (patch)
tree29c5a75228e31f305f42c5b761709a186e406776 /pkgs/development/compilers
parentbbcf127c7c9029cba43493d7d25a9d1c65d59152 (diff)
parent468f698f609e123bb0ffae67181d07ac99eb2204 (diff)
downloadnixlib-f9f6f41bff2213e199bded515e9b66d1e5c4d7dd.tar
nixlib-f9f6f41bff2213e199bded515e9b66d1e5c4d7dd.tar.gz
nixlib-f9f6f41bff2213e199bded515e9b66d1e5c4d7dd.tar.bz2
nixlib-f9f6f41bff2213e199bded515e9b66d1e5c4d7dd.tar.lz
nixlib-f9f6f41bff2213e199bded515e9b66d1e5c4d7dd.tar.xz
nixlib-f9f6f41bff2213e199bded515e9b66d1e5c4d7dd.tar.zst
nixlib-f9f6f41bff2213e199bded515e9b66d1e5c4d7dd.zip
Merge branch 'master' into closure-size
TODO: there was more significant refactoring of qtbase and plasma 5.5
on master, and I'm deferring pointing to correct outputs to later.
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r--pkgs/development/compilers/cmdstan/default.nix40
-rw-r--r--pkgs/development/compilers/gcc/5/default.nix4
-rw-r--r--pkgs/development/compilers/ghc/7.10.3.nix23
-rw-r--r--pkgs/development/compilers/ghc/dont-pass-linker-flags-via-response-files.patch22
-rw-r--r--pkgs/development/compilers/ghc/head.nix52
-rw-r--r--pkgs/development/compilers/julia/default.nix4
-rw-r--r--pkgs/development/compilers/kotlin/default.nix6
-rw-r--r--pkgs/development/compilers/llvm/3.7/llvm.nix5
-rw-r--r--pkgs/development/compilers/llvm/3.7/r242372-fix-LLVMBuildLandingPad.patch60
-rw-r--r--pkgs/development/compilers/matter-compiler/Gemfile3
-rw-r--r--pkgs/development/compilers/matter-compiler/Gemfile.lock13
-rw-r--r--pkgs/development/compilers/matter-compiler/default.nix22
-rw-r--r--pkgs/development/compilers/matter-compiler/gemset.nix9
-rw-r--r--pkgs/development/compilers/rustc/default.nix5
-rw-r--r--pkgs/development/compilers/rustc/head.nix2
-rw-r--r--pkgs/development/compilers/rustc/patches/grsec-head.patch24
-rw-r--r--pkgs/development/compilers/rustc/patches/grsec.patch16
17 files changed, 237 insertions, 73 deletions
diff --git a/pkgs/development/compilers/cmdstan/default.nix b/pkgs/development/compilers/cmdstan/default.nix
new file mode 100644
index 000000000000..182808031e63
--- /dev/null
+++ b/pkgs/development/compilers/cmdstan/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "cmdstan-2.9.0";
+
+  src = fetchurl {
+    url = "https://github.com/stan-dev/cmdstan/releases/download/v2.9.0/cmdstan-2.9.0.tar.gz";
+    sha256 = "08bim6nxgam989152hm0ga1rfb33mr71pwsym1nmfmavma68bwm9";
+  };
+
+  buildFlags = "build";
+  enableParallelBuilding = true;
+
+  doCheck = true;
+  checkPhase = "./runCmdStanTests.py src/test/interface";
+
+  installPhase = ''
+    mkdir -p $out/opt $out/bin
+    cp -r . $out/opt/cmdstan
+    ln -s $out/opt/cmdstan/bin/stanc $out/bin/stanc
+    ln -s $out/opt/cmdstan/bin/stansummary $out/bin/stansummary
+    cat > $out/bin/stan <<EOF
+    #!/bin/sh
+    make -C $out/opt/cmdstan "\$(realpath "\$1")"
+    EOF
+    chmod a+x $out/bin/stan
+  '';
+
+  meta = {
+    description = "Command-line interface to Stan";
+    longDescription = ''
+      Stan is a probabilistic programming language implementing full Bayesian
+      statistical inference with MCMC sampling (NUTS, HMC), approximate Bayesian
+      inference with Variational inference (ADVI) and penalized maximum
+      likelihood estimation with Optimization (L-BFGS).
+    '';
+    homepage = http://mc-stan.org/interfaces/cmdstan.html;
+    license = stdenv.lib.licenses.bsd3;
+  };
+}
diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix
index 6b54d31cb019..d050c712d3b6 100644
--- a/pkgs/development/compilers/gcc/5/default.nix
+++ b/pkgs/development/compilers/gcc/5/default.nix
@@ -58,7 +58,7 @@ assert langGo -> langCC;
 with stdenv.lib;
 with builtins;
 
-let version = "5.2.0";
+let version = "5.3.0";
 
     # Whether building a cross-compiler for GNU/Hurd.
     crossGNU = cross != null && cross.config == "i586-pc-gnu";
@@ -211,7 +211,7 @@ stdenv.mkDerivation ({
 
   src = fetchurl {
     url = "mirror://gnu/gcc/gcc-${version}/gcc-${version}.tar.bz2";
-    sha256 = "1bccp8a106xwz3wkixn65ngxif112vn90qf95m6lzpgpnl25p0sz";
+    sha256 = "1ny4smkp5bzs3cp8ss7pl6lk8yss0d9m4av1mvdp72r1x695akxq";
   };
 
   inherit patches;
diff --git a/pkgs/development/compilers/ghc/7.10.3.nix b/pkgs/development/compilers/ghc/7.10.3.nix
index 32d6b72970cb..88d1bec4d42b 100644
--- a/pkgs/development/compilers/ghc/7.10.3.nix
+++ b/pkgs/development/compilers/ghc/7.10.3.nix
@@ -4,16 +4,10 @@
 
 let
 
-  buildMK = ''
-    libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp}/lib"
-    libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp}/include"
-    libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-includes="${ncurses}/include"
-    libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-libraries="${ncurses}/lib"
-    ${stdenv.lib.optionalString stdenv.isDarwin ''
-      libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-includes="${libiconv}/include"
-      libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-libraries="${libiconv}/lib"
-    ''}
-  '';
+  docFixes = fetchurl {
+    url = "https://downloads.haskell.org/~ghc/7.10.3/ghc-7.10.3a.patch";
+    sha256 = "1j45z4kcd3w1rzm4hapap2xc16bbh942qnzzdbdjcwqznsccznf0";
+  };
 
 in
 
@@ -26,12 +20,16 @@ stdenv.mkDerivation rec {
     sha256 = "1vsgmic8csczl62ciz51iv8nhrkm72lyhbz7p7id13y2w7fcx46g";
   };
 
+  patches = [
+    docFixes
+    ./dont-pass-linker-flags-via-response-files.patch   # https://github.com/NixOS/nixpkgs/issues/10752
+  ];
+
   buildInputs = [ ghc perl libxml2 libxslt docbook_xsl docbook_xml_dtd_45 docbook_xml_dtd_42 hscolour ];
 
   enableParallelBuilding = true;
 
   preConfigure = ''
-    echo >mk/build.mk "${buildMK}"
     sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
   '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
     export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}"
@@ -42,6 +40,9 @@ stdenv.mkDerivation rec {
   configureFlags = [
     "--with-gcc=${stdenv.cc}/bin/cc"
     "--with-gmp-includes=${gmp}/include" "--with-gmp-libraries=${gmp}/lib"
+    "--with-curses-includes=${ncurses}/include" "--with-curses-libraries=${ncurses}/lib"
+  ] ++ stdenv.lib.optional stdenv.isDarwin [
+    "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib"
   ];
 
   # required, because otherwise all symbols from HSffi.o are stripped, and
diff --git a/pkgs/development/compilers/ghc/dont-pass-linker-flags-via-response-files.patch b/pkgs/development/compilers/ghc/dont-pass-linker-flags-via-response-files.patch
new file mode 100644
index 000000000000..129a34ecd86e
--- /dev/null
+++ b/pkgs/development/compilers/ghc/dont-pass-linker-flags-via-response-files.patch
@@ -0,0 +1,22 @@
+diff --git a/compiler/main/SysTools.hs b/compiler/main/SysTools.hs
+index 8c3ab1a..47a2da7 100644
+--- a/compiler/main/SysTools.hs
++++ b/compiler/main/SysTools.hs
+@@ -414,7 +414,7 @@ runCc dflags args =   do
+       args1 = map Option (getOpts dflags opt_c)
+       args2 = args0 ++ args1 ++ args
+   mb_env <- getGccEnv args2
+-  runSomethingResponseFile dflags cc_filter "C Compiler" p args2 mb_env
++  runSomethingFiltered dflags cc_filter "C Compiler" p args2 mb_env
+  where
+   -- discard some harmless warnings from gcc that we can't turn off
+   cc_filter = unlines . doFilter . lines
+@@ -928,7 +928,7 @@ runLink dflags args = do
+       args1     = map Option (getOpts dflags opt_l)
+       args2     = args0 ++ linkargs ++ args1 ++ args
+   mb_env <- getGccEnv args2
+-  runSomethingResponseFile dflags ld_filter "Linker" p args2 mb_env
++  runSomethingFiltered dflags ld_filter "Linker" p args2 mb_env
+   where
+     ld_filter = case (platformOS (targetPlatform dflags)) of
+                   OSSolaris2 -> sunos_ld_filter
diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix
index 43c32538b1a6..8b6c371537bc 100644
--- a/pkgs/development/compilers/ghc/head.nix
+++ b/pkgs/development/compilers/ghc/head.nix
@@ -1,32 +1,22 @@
-{ stdenv, fetchgit, ghc, perl, gmp, ncurses, libiconv, autoconf, automake, happy, alex }:
-
-let
-
-  buildMK = ''
-    libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp.out}/lib"
-    libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp.dev}/include"
-    libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-includes="${ncurses.dev}/include"
-    libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-libraries="${ncurses.lib}/lib"
-    DYNAMIC_BY_DEFAULT = NO
-    ${stdenv.lib.optionalString stdenv.isDarwin ''
-      libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-includes="${libiconv}/include"
-      libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-libraries="${libiconv}/lib"
-    ''}
-  '';
-
-in
+{ stdenv, fetchgit, ghc, perl, gmp, ncurses, libiconv, binutils, coreutils
+, autoconf, automake, happy, alex
+}:
 
 stdenv.mkDerivation rec {
-  version = "7.11.20150828";
+  version = "7.11.20151216";
   name = "ghc-${version}";
-  rev = "38c98e4f61a48084995a5347d76ddd024ce1a09c";
+  rev = "28638dfe79e915f33d75a1b22c5adce9e2b62b97";
 
   src = fetchgit {
     url = "git://git.haskell.org/ghc.git";
     inherit rev;
-    sha256 = "0wnxrfzjpjcmsmd2i0zg30jg7zpw1rrfwz8r56g314l7xcns6yp1";
+    sha256 = "0rjzkzn0hz1vdnjikcbwfs5ggs8r3y4gqxfdn4jzfp45gx94wiwv";
   };
 
+  patches = [
+    ./dont-pass-linker-flags-via-response-files.patch   # https://github.com/NixOS/nixpkgs/issues/10752
+  ];
+
   postUnpack = ''
     pushd ghc-${builtins.substring 0 7 rev}
     echo ${version} >VERSION
@@ -38,24 +28,40 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ ghc perl autoconf automake happy alex ];
 
+  enableParallelBuilding = true;
+
   preConfigure = ''
-    echo >mk/build.mk "${buildMK}"
     sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
   '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
     export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}"
+  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+    export NIX_LDFLAGS+=" -no_dtrace_dof"
   '';
 
   configureFlags = [
     "--with-gcc=${stdenv.cc}/bin/cc"
     "--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib"
+    "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.lib}/lib"
+  ] ++ stdenv.lib.optional stdenv.isDarwin [
+    "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib"
   ];
 
-  enableParallelBuilding = true;
-
   # required, because otherwise all symbols from HSffi.o are stripped, and
   # that in turn causes GHCi to abort
   stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
 
+  postInstall = ''
+    # Install the bash completion file.
+    install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/ghc
+
+    # Patch scripts to include "readelf" and "cat" in $PATH.
+    for i in "$out/bin/"*; do
+      test ! -h $i || continue
+      egrep --quiet '^#!' <(head -n 1 $i) || continue
+      sed -i -e '2i export PATH="$PATH:${binutils}/bin:${coreutils}/bin"' $i
+    done
+  '';
+
   meta = {
     homepage = "http://haskell.org/ghc";
     description = "The Glasgow Haskell Compiler";
diff --git a/pkgs/development/compilers/julia/default.nix b/pkgs/development/compilers/julia/default.nix
index 5df0a35aae8e..81781868b02a 100644
--- a/pkgs/development/compilers/julia/default.nix
+++ b/pkgs/development/compilers/julia/default.nix
@@ -43,12 +43,12 @@ in
 
 stdenv.mkDerivation rec {
   pname = "julia";
-  version = "0.4.0";
+  version = "0.4.2";
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "https://github.com/JuliaLang/${pname}/releases/download/v${version}/${name}.tar.gz";
-    sha256 = "00k53hzbawpqvmkkyzcvbmf1d0ycshzdqk19nwsifv1rmiwjj7ss";
+    sha256 = "04i5kjji5553lkdxz3wgflg1mav5ivwy2dascjy8jprqpq33aknk";
   };
 
   prePatch = ''
diff --git a/pkgs/development/compilers/kotlin/default.nix b/pkgs/development/compilers/kotlin/default.nix
index e97309f9252c..b17be1c534b0 100644
--- a/pkgs/development/compilers/kotlin/default.nix
+++ b/pkgs/development/compilers/kotlin/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, makeWrapper, jre, unzip, which }:
 
 stdenv.mkDerivation rec {
-  version = "1.0.0-beta-3595";
+  version = "1.0.0-beta-4584";
   name = "kotlin-${version}";
 
   src = fetchurl {
     url = "https://github.com/JetBrains/kotlin/releases/download/build-${version}/kotlin-compiler-${version}.zip";
-    sha256 = "1ed750a169a411349852a102d5a9c23aec656acb76d51018a4933741eb846fae";
+    sha256 = "191698784f4a1f769df14757bad40243293aa6bc3d8e906bfa0c80c3db0a1d2c";
   };
 
   propagatedBuildInputs = [ jre which ] ;
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
     longDescription = ''
       Kotlin is a statically typed language that targets the JVM and JavaScript.
       It is a general-purpose language intended for industry use.
-      It is developed by a team at JetBrains although it is an OSS language 
+      It is developed by a team at JetBrains although it is an OSS language
       and has external contributors.
     '';
     homepage = http://kotlinlang.org/;
diff --git a/pkgs/development/compilers/llvm/3.7/llvm.nix b/pkgs/development/compilers/llvm/3.7/llvm.nix
index 045d2e4951a8..58073cbefc52 100644
--- a/pkgs/development/compilers/llvm/3.7/llvm.nix
+++ b/pkgs/development/compilers/llvm/3.7/llvm.nix
@@ -22,6 +22,11 @@ let
 in stdenv.mkDerivation rec {
   name = "llvm-${version}";
 
+  patches = [
+    # Backport for Rust, remove when 3.7.1 is released
+    ./r242372-fix-LLVMBuildLandingPad.patch
+  ];
+
   unpackPhase = ''
     unpackFile ${src}
     mv llvm-${version}.src llvm
diff --git a/pkgs/development/compilers/llvm/3.7/r242372-fix-LLVMBuildLandingPad.patch b/pkgs/development/compilers/llvm/3.7/r242372-fix-LLVMBuildLandingPad.patch
new file mode 100644
index 000000000000..749de6e9b6a1
--- /dev/null
+++ b/pkgs/development/compilers/llvm/3.7/r242372-fix-LLVMBuildLandingPad.patch
@@ -0,0 +1,60 @@
+Index: llvm/bindings/ocaml/llvm/llvm_ocaml.c
+===================================================================
+--- llvm/bindings/ocaml/llvm/llvm_ocaml.c	(revision 242371)
++++ llvm/bindings/ocaml/llvm/llvm_ocaml.c	(revision 242372)
+@@ -1745,7 +1745,7 @@
+ CAMLprim LLVMValueRef llvm_build_landingpad(LLVMTypeRef Ty, LLVMValueRef PersFn,
+                                             value NumClauses,  value Name,
+                                             value B) {
+-    return LLVMBuildLandingPad(Builder_val(B), Ty, Int_val(NumClauses),
++    return LLVMBuildLandingPad(Builder_val(B), Ty, PersFn, Int_val(NumClauses),
+                                String_val(Name));
+ }
+ 
+Index: llvm/bindings/go/llvm/ir.go
+===================================================================
+--- llvm/bindings/go/llvm/ir.go	(revision 242371)
++++ llvm/bindings/go/llvm/ir.go	(revision 242372)
+@@ -1731,7 +1731,7 @@
+ func (b Builder) CreateLandingPad(t Type, nclauses int, name string) (l Value) {
+ 	cname := C.CString(name)
+ 	defer C.free(unsafe.Pointer(cname))
+-	l.C = C.LLVMBuildLandingPad(b.C, t.C, C.unsigned(nclauses), cname)
++	l.C = C.LLVMBuildLandingPad(b.C, t.C, nil, C.unsigned(nclauses), cname)
+ 	return l
+ }
+ 
+Index: llvm/lib/IR/Core.cpp
+===================================================================
+--- llvm/lib/IR/Core.cpp	(revision 242371)
++++ llvm/lib/IR/Core.cpp	(revision 242372)
+@@ -2257,7 +2257,14 @@
+ }
+ 
+ LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty,
+-                                 unsigned NumClauses, const char *Name) {
++                                 LLVMValueRef PersFn, unsigned NumClauses,
++                                 const char *Name) {
++  // The personality used to live on the landingpad instruction, but now it
++  // lives on the parent function. For compatibility, take the provided
++  // personality and put it on the parent function.
++  if (PersFn)
++    unwrap(B)->GetInsertBlock()->getParent()->setPersonalityFn(
++        cast<Function>(unwrap(PersFn)));
+   return wrap(unwrap(B)->CreateLandingPad(unwrap(Ty), NumClauses, Name));
+ }
+ 
+Index: llvm/include/llvm-c/Core.h
+===================================================================
+--- llvm/include/llvm-c/Core.h	(revision 242371)
++++ llvm/include/llvm-c/Core.h	(revision 242372)
+@@ -2675,7 +2675,8 @@
+                              LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch,
+                              const char *Name);
+ LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty,
+-                                 unsigned NumClauses, const char *Name);
++                                 LLVMValueRef PersFn, unsigned NumClauses,
++                                 const char *Name);
+ LLVMValueRef LLVMBuildResume(LLVMBuilderRef B, LLVMValueRef Exn);
+ LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef);
+ 
diff --git a/pkgs/development/compilers/matter-compiler/Gemfile b/pkgs/development/compilers/matter-compiler/Gemfile
new file mode 100644
index 000000000000..21ec23452055
--- /dev/null
+++ b/pkgs/development/compilers/matter-compiler/Gemfile
@@ -0,0 +1,3 @@
+source "https://rubygems.org"
+
+gem 'matter_compiler'
diff --git a/pkgs/development/compilers/matter-compiler/Gemfile.lock b/pkgs/development/compilers/matter-compiler/Gemfile.lock
new file mode 100644
index 000000000000..2eefe96ec63b
--- /dev/null
+++ b/pkgs/development/compilers/matter-compiler/Gemfile.lock
@@ -0,0 +1,13 @@
+GEM
+  remote: https://rubygems.org/
+  specs:
+    matter_compiler (0.5.1)
+
+PLATFORMS
+  ruby
+
+DEPENDENCIES
+  matter_compiler
+
+BUNDLED WITH
+   1.10.6
diff --git a/pkgs/development/compilers/matter-compiler/default.nix b/pkgs/development/compilers/matter-compiler/default.nix
new file mode 100644
index 000000000000..12da620fe5bd
--- /dev/null
+++ b/pkgs/development/compilers/matter-compiler/default.nix
@@ -0,0 +1,22 @@
+
+{ stdenv, lib, bundlerEnv, ruby }:
+
+bundlerEnv {
+  name = "matter_compiler-0.5.1";
+
+  inherit ruby;
+  gemfile = ./Gemfile;
+  lockfile = ./Gemfile.lock;
+  gemset = ./gemset.nix;
+
+  meta = with lib; {
+    description = ''
+      Matter Compiler is a API Blueprint AST Media Types to API Blueprint conversion tool.
+      It composes an API blueprint from its serialzed AST media-type.
+    '';
+    homepage    = https://github.com/apiaryio/matter_compiler/;
+    license     = licenses.mit;
+    maintainers = with maintainers; [ rvlander ];
+    platforms   = platforms.unix;
+  };
+}
diff --git a/pkgs/development/compilers/matter-compiler/gemset.nix b/pkgs/development/compilers/matter-compiler/gemset.nix
new file mode 100644
index 000000000000..9ac7ae8d20e4
--- /dev/null
+++ b/pkgs/development/compilers/matter-compiler/gemset.nix
@@ -0,0 +1,9 @@
+{
+  "matter_compiler" = {
+    version = "0.5.1";
+    source = {
+      type = "gem";
+      sha256 = "16501zdiqxk34v2d0nlbwrcrjm6g57hrsmsw0crwssn29v5zbykf";
+    };
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/compilers/rustc/default.nix b/pkgs/development/compilers/rustc/default.nix
index 19e746d7dbf3..ce1e4cf1f5ce 100644
--- a/pkgs/development/compilers/rustc/default.nix
+++ b/pkgs/development/compilers/rustc/default.nix
@@ -1,11 +1,11 @@
 { stdenv, callPackage }:
 
 callPackage ./generic.nix {
-  shortVersion = "1.4.0";
+  shortVersion = "1.5.0";
   isRelease = true;
   forceBundledLLVM = false;
   configureFlags = [ "--release-channel=stable" ];
-  srcSha = "13wpi9nb3h6wwck2mxhza85fahzcwgas00w8m25086v34dha4dp1";
+  srcSha = "1vfpwx6a2f2rn528774cz9r7r82ppycn8z8ybll6bphdw7cyar1g";
 
   /* Rust is bootstrapped from an earlier built version. We need
   to fetch these earlier versions, which vary per platform.
@@ -22,7 +22,6 @@ callPackage ./generic.nix {
   snapshotDate = "2015-08-11";
   snapshotRev = "1af31d4";
 
-  # cc-ar-opts.patch should be removable in 1.4.0+
   patches = [ ./patches/remove-uneeded-git.patch ]
     ++ stdenv.lib.optional stdenv.needsPax ./patches/grsec.patch;
 }
diff --git a/pkgs/development/compilers/rustc/head.nix b/pkgs/development/compilers/rustc/head.nix
index ac2323483286..ccbfc51b671a 100644
--- a/pkgs/development/compilers/rustc/head.nix
+++ b/pkgs/development/compilers/rustc/head.nix
@@ -23,6 +23,6 @@ callPackage ./generic.nix {
   snapshotRev = "1af31d4";
 
   patches = [ ./patches/remove-uneeded-git.patch ]
-    ++ stdenv.lib.optional stdenv.needsPax ./patches/grsec-head.patch;
+    ++ stdenv.lib.optional stdenv.needsPax ./patches/grsec.patch;
 }
 
diff --git a/pkgs/development/compilers/rustc/patches/grsec-head.patch b/pkgs/development/compilers/rustc/patches/grsec-head.patch
deleted file mode 100644
index b97b40c24091..000000000000
--- a/pkgs/development/compilers/rustc/patches/grsec-head.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git a/src/test/run-make/relocation-model/Makefile b/src/test/run-make/relocation-model/Makefile
-index b22f34f..c6489bd 100644
---- a/src/test/run-make/relocation-model/Makefile
-+++ b/src/test/run-make/relocation-model/Makefile
-@@ -2,9 +2,11 @@
- 
- all: others
- 	$(RUSTC) -C relocation-model=dynamic-no-pic foo.rs
-+	paxctl -czexm $(TMPDIR)/foo
- 	$(call RUN,foo)
- 
- 	$(RUSTC) -C relocation-model=default foo.rs
-+	paxctl -czexm $(TMPDIR)/foo
- 	$(call RUN,foo)
- 
- 	$(RUSTC) -C relocation-model=default --crate-type=dylib foo.rs
-@@ -16,6 +18,7 @@ others:
- else
- others:
- 	$(RUSTC) -C relocation-model=static foo.rs
-+	paxctl -czexm $(TMPDIR)/foo
- 	$(call RUN,foo)
- 	$(RUSTC) -C relocation-model=static --crate-type=dylib foo.rs
- endif
diff --git a/pkgs/development/compilers/rustc/patches/grsec.patch b/pkgs/development/compilers/rustc/patches/grsec.patch
index 84582ab7d70f..b97b40c24091 100644
--- a/pkgs/development/compilers/rustc/patches/grsec.patch
+++ b/pkgs/development/compilers/rustc/patches/grsec.patch
@@ -1,16 +1,24 @@
 diff --git a/src/test/run-make/relocation-model/Makefile b/src/test/run-make/relocation-model/Makefile
-index 2fcdd32..2d9ddb0 100644
+index b22f34f..c6489bd 100644
 --- a/src/test/run-make/relocation-model/Makefile
 +++ b/src/test/run-make/relocation-model/Makefile
-@@ -5,9 +5,11 @@ all:
+@@ -2,9 +2,11 @@
+ 
+ all: others
+ 	$(RUSTC) -C relocation-model=dynamic-no-pic foo.rs
++	paxctl -czexm $(TMPDIR)/foo
  	$(call RUN,foo)
  
  	$(RUSTC) -C relocation-model=default foo.rs
 +	paxctl -czexm $(TMPDIR)/foo
  	$(call RUN,foo)
  
+ 	$(RUSTC) -C relocation-model=default --crate-type=dylib foo.rs
+@@ -16,6 +18,7 @@ others:
+ else
+ others:
  	$(RUSTC) -C relocation-model=static foo.rs
 +	paxctl -czexm $(TMPDIR)/foo
  	$(call RUN,foo)
- 
- 	$(RUSTC) -C relocation-model=default --crate-type=dylib foo.rs
+ 	$(RUSTC) -C relocation-model=static --crate-type=dylib foo.rs
+ endif