From 2adf36ab8c7903e100e6e7a0a6447934ec09b10e Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Tue, 8 Aug 2017 23:22:24 +0200 Subject: [PATCH 1/2] gcc: fix clang build --- pkgs/development/compilers/gcc/5/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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" From bc5160eacde131d83c3a25827963a676d1391abe Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Wed, 9 Aug 2017 08:41:48 +0200 Subject: [PATCH 2/2] gdb: fix clang build --- pkgs/development/tools/misc/gdb/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/development/tools/misc/gdb/default.nix b/pkgs/development/tools/misc/gdb/default.nix index 02ff52155b1..410fd36ef25 100644 --- a/pkgs/development/tools/misc/gdb/default.nix +++ b/pkgs/development/tools/misc/gdb/default.nix @@ -66,6 +66,13 @@ stdenv.mkDerivation rec { ++ stdenv.lib.optional (!pythonSupport) "--without-python" ++ stdenv.lib.optional multitarget "--enable-targets=all"; + preConfigure = + # Not sure why this is causing problems, now that the stdenv + # exports CPP=cpp the build fails with strange errors on darwin. + stdenv.lib.optionalString stdenv.cc.isClang '' + unset CPP + ''; + postInstall = '' # Remove Info files already provided by Binutils and other packages. rm -v $out/share/info/bfd.info