about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/compilers/gcc/6
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-02-24 01:09:00 +0000
committerAlyssa Ross <hi@alyssa.is>2019-02-24 01:09:00 +0000
commit072c01a28f865e9487df09aed7ddff328252fb36 (patch)
tree6df6e652915940255f294ed8998cce1c4c7c2d40 /nixpkgs/pkgs/development/compilers/gcc/6
parent024b46ff20027c15322e5d868ecec42632556d4b (diff)
parent969cff2691a02b3d7e5468beda26c482d8986644 (diff)
downloadnixlib-072c01a28f865e9487df09aed7ddff328252fb36.tar
nixlib-072c01a28f865e9487df09aed7ddff328252fb36.tar.gz
nixlib-072c01a28f865e9487df09aed7ddff328252fb36.tar.bz2
nixlib-072c01a28f865e9487df09aed7ddff328252fb36.tar.lz
nixlib-072c01a28f865e9487df09aed7ddff328252fb36.tar.xz
nixlib-072c01a28f865e9487df09aed7ddff328252fb36.tar.zst
nixlib-072c01a28f865e9487df09aed7ddff328252fb36.zip
Merge commit '969cff2691a02b3d7e5468beda26c482d8986644'
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/gcc/6')
-rw-r--r--nixpkgs/pkgs/development/compilers/gcc/6/default.nix31
1 files changed, 18 insertions, 13 deletions
diff --git a/nixpkgs/pkgs/development/compilers/gcc/6/default.nix b/nixpkgs/pkgs/development/compilers/gcc/6/default.nix
index adaf4e36ce96..6fd1995354f6 100644
--- a/nixpkgs/pkgs/development/compilers/gcc/6/default.nix
+++ b/nixpkgs/pkgs/development/compilers/gcc/6/default.nix
@@ -180,18 +180,23 @@ stdenv.mkDerivation ({
 
   hardeningDisable = [ "format" "pie" ];
 
-  # This should kill all the stdinc frameworks that gcc and friends like to
-  # insert into default search paths.
-  prePatch = stdenv.lib.optionalString hostPlatform.isDarwin ''
-    substituteInPlace gcc/config/darwin-c.c \
-      --replace 'if (stdinc)' 'if (0)'
-
-    substituteInPlace libgcc/config/t-slibgcc-darwin \
-      --replace "-install_name @shlib_slibdir@/\$(SHLIB_INSTALL_NAME)" "-install_name $lib/lib/\$(SHLIB_INSTALL_NAME)"
-
-    substituteInPlace libgfortran/configure \
-      --replace "-install_name \\\$rpath/\\\$soname" "-install_name $lib/lib/\\\$soname"
-  '';
+  prePatch =
+    (stdenv.lib.optionalString (langJava || langGo) ''
+      export lib=$out
+    '')
+
+    # This should kill all the stdinc frameworks that gcc and friends like to
+    # insert into default search paths.
+    + stdenv.lib.optionalString hostPlatform.isDarwin ''
+      substituteInPlace gcc/config/darwin-c.c \
+        --replace 'if (stdinc)' 'if (0)'
+
+      substituteInPlace libgcc/config/t-slibgcc-darwin \
+        --replace "-install_name @shlib_slibdir@/\$(SHLIB_INSTALL_NAME)" "-install_name $lib/lib/\$(SHLIB_INSTALL_NAME)"
+
+      substituteInPlace libgfortran/configure \
+        --replace "-install_name \\\$rpath/\\\$soname" "-install_name $lib/lib/\\\$soname"
+    '';
 
   postPatch =
     if targetPlatform != hostPlatform || stdenv.cc.libc != null then
@@ -447,7 +452,7 @@ stdenv.mkDerivation ({
 
 // optionalAttrs (enableMultilib) { dontMoveLib64 = true; }
 
-// optionalAttrs (langJava) {
+// optionalAttrs (langJava && !stdenv.hostPlatform.isDarwin) {
      postFixup = ''
        target="$(echo "$out/libexec/gcc"/*/*/ecj*)"
        patchelf --set-rpath "$(patchelf --print-rpath "$target"):$out/lib" "$target"