git.iko.soy/typeable/nixpkgs
on master help sign in
gcc: fix clang build
commit2adf36ab8c7903e100e6e7a0a6447934ec09b10e authorDaiderd Jordan <daiderd@gmail.com> dateTue 8 Aug 2017, 23:22 (9 years ago) parenteeeead2
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"