git.iko.soy/typeable/nixpkgs
on master help sign in
clang-stdenv: use libstdcxxHook when targeting linux
commit907222098acbbf68d3c565c6cbd9bad36e0255a8 authorDaiderd Jordan <daiderd@gmail.com> dateMon 4 Sep 2017, 21:23 (9 years ago) parent0ea92a3
2 files changed+13−2
pkgs/development/compilers/gcc/libstdc++-hook.sh+1 pkgs/development/compilers/llvm/4/default.nix+12−2
pkgs/development/compilers/gcc/libstdc++-hook.sh+1
@@ -1 +1,2 @@
11export NIX_CXXSTDLIB_COMPILE+="-isystem $(echo -n @gcc@/include/c++/*) -isystem $(echo -n @gcc@/include/c++/*)/$(@gcc@/bin/gcc -dumpmachine)"
2+export NIX_CXXSTDLIB_LINK=" -stdlib=libstdc++"
pkgs/development/compilers/llvm/4/default.nix+12−2
@@ -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