@@ -1,4 +1,8 @@
1−{ lowPrio, newScope, stdenv, cmake, libxml2, python2, isl, fetchurl, overrideCC, wrapCC, darwin, ccWrapperFun }:
1+{ lowPrio, newScope, stdenv, targetPlatform, cmake, libstdcxxHook
2+, libxml2, python2, isl, fetchurl, overrideCC, wrapCC, ccWrapperFun
3+, darwin
4+}:
5+
26let
37 callPackage = newScope (self // { inherit stdenv cmake libxml2 python2 isl release_version version fetch; });
48
@@ -46,7 +50,12 @@ let
4650 extraPackages = [ self.libcxx self.libcxxabi ];
4751 };
4852
49− stdenv = overrideCC stdenv self.clang;
53+ stdenv = stdenv.override (drv: {
54+ allowedRequisites = null;
55+ cc = self.clang;
56+ # Use the gcc libstdc++ when targeting linux.
57+ extraBuildInputs = if stdenv.cc.isGNU then [ libstdcxxHook ] else drv.extraBuildInputs;
58+ });
5059
5160 libcxxStdenv = overrideCC stdenv self.libcxxClang;
5261
@@ -58,4 +67,5 @@ let
5867
5968 libcxxabi = callPackage ./libc++abi.nix {};
6069 };
70+
6171in self