summary refs log tree commit diff
path: root/pkgs/development/compilers
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2017-08-13 17:58:18 +0200
committerDaiderd Jordan <daiderd@gmail.com>2017-08-13 17:58:18 +0200
commit206faacbcb8c9a4655c6c8cf2cf5eec688d59719 (patch)
tree1d9132efff53fd1bf22a13ab3a4477b9617c9c89 /pkgs/development/compilers
parent5bc183ebf868b32b599692a3b651a39d8a97dee3 (diff)
downloadnixpkgs-206faacbcb8c9a4655c6c8cf2cf5eec688d59719.tar
nixpkgs-206faacbcb8c9a4655c6c8cf2cf5eec688d59719.tar.gz
nixpkgs-206faacbcb8c9a4655c6c8cf2cf5eec688d59719.tar.bz2
nixpkgs-206faacbcb8c9a4655c6c8cf2cf5eec688d59719.tar.lz
nixpkgs-206faacbcb8c9a4655c6c8cf2cf5eec688d59719.tar.xz
nixpkgs-206faacbcb8c9a4655c6c8cf2cf5eec688d59719.tar.zst
nixpkgs-206faacbcb8c9a4655c6c8cf2cf5eec688d59719.zip
gcc: fix clang build
Fixes #27889

This works properly now that LD_DYLD_PATH is fixed
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r--pkgs/development/compilers/gcc/5/default.nix8
1 files changed, 7 insertions, 1 deletions
diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix
index e95ef92c3f6..c9780077835 100644
--- a/pkgs/development/compilers/gcc/5/default.nix
+++ b/pkgs/development/compilers/gcc/5/default.nix
@@ -325,7 +325,13 @@ stdenv.mkDerivation ({
 
   NIX_LDFLAGS = stdenv.lib.optionalString  hostPlatform.isSunOS "-lm -ldl";
 
-  preConfigure = stdenv.lib.optionalString (hostPlatform.isSunOS && hostPlatform.is64bit) ''
+  preConfigure =
+    # Not sure why this is causing problems, now that the stdenv
+    # exports CPP=cpp the build fails with strange errors on darwin.
+    # https://github.com/NixOS/nixpkgs/issues/27889
+    stdenv.lib.optionalString stdenv.cc.isClang ''
+    unset CPP
+  '' + stdenv.lib.optionalString (hostPlatform.isSunOS && hostPlatform.is64bit) ''
     export NIX_LDFLAGS=`echo $NIX_LDFLAGS | sed -e s~$prefix/lib~$prefix/lib/amd64~g`
     export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_FOR_TARGET"
     export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET"