gcc: fix clang build

Fixes #27889

This works properly now that LD_DYLD_PATH is fixed
This commit is contained in:
Daiderd Jordan 2017-08-13 17:58:18 +02:00
parent 5bc183ebf8
commit 206faacbcb
No known key found for this signature in database
GPG key ID: D02435D05B810C96

View file

@ -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"