git.iko.soy/typeable/nixpkgs
on master help sign in
gcc: fix clang build

Fixes #27889 This works properly now that LD_DYLD_PATH is fixed

commit206faacbcb8c9a4655c6c8cf2cf5eec688d59719 authorDaiderd Jordan <daiderd@gmail.com> dateSun 13 Aug 2017, 17:58 (9 years ago) parent5bc183e
1 file changed+7−1
pkgs/development/compilers/gcc/5/default.nix+7−1
pkgs/development/compilers/gcc/5/default.nix+7−1
@@ -325,7 +325,13 @@ stdenv.mkDerivation ({
325325
326326 NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl";
327327
328− preConfigure = stdenv.lib.optionalString (hostPlatform.isSunOS && hostPlatform.is64bit) ''
328+ preConfigure =
329+ # Not sure why this is causing problems, now that the stdenv
330+ # exports CPP=cpp the build fails with strange errors on darwin.
331+ # https://github.com/NixOS/nixpkgs/issues/27889
332+ stdenv.lib.optionalString stdenv.cc.isClang ''
333+ unset CPP
334+ '' + stdenv.lib.optionalString (hostPlatform.isSunOS && hostPlatform.is64bit) ''
329335 export NIX_LDFLAGS=`echo $NIX_LDFLAGS | sed -e s~$prefix/lib~$prefix/lib/amd64~g`
330336 export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_FOR_TARGET"
331337 export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET"