summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2017-09-04 21:23:57 +0200
committerDaiderd Jordan <daiderd@gmail.com>2017-09-05 21:37:06 +0200
commit907222098acbbf68d3c565c6cbd9bad36e0255a8 (patch)
treeb9992c23fea0ebe3a1eeec01819e2103bda281b3 /pkgs
parent0ea92a3c24f62e7f5006a4bc99152faa74723304 (diff)
downloadnixlib-907222098acbbf68d3c565c6cbd9bad36e0255a8.tar
nixlib-907222098acbbf68d3c565c6cbd9bad36e0255a8.tar.gz
nixlib-907222098acbbf68d3c565c6cbd9bad36e0255a8.tar.bz2
nixlib-907222098acbbf68d3c565c6cbd9bad36e0255a8.tar.lz
nixlib-907222098acbbf68d3c565c6cbd9bad36e0255a8.tar.xz
nixlib-907222098acbbf68d3c565c6cbd9bad36e0255a8.tar.zst
nixlib-907222098acbbf68d3c565c6cbd9bad36e0255a8.zip
clang-stdenv: use libstdcxxHook when targeting linux
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/compilers/gcc/libstdc++-hook.sh1
-rw-r--r--pkgs/development/compilers/llvm/4/default.nix14
2 files changed, 13 insertions, 2 deletions
diff --git a/pkgs/development/compilers/gcc/libstdc++-hook.sh b/pkgs/development/compilers/gcc/libstdc++-hook.sh
index c699d5460eb1..2d30c845b5a3 100644
--- a/pkgs/development/compilers/gcc/libstdc++-hook.sh
+++ b/pkgs/development/compilers/gcc/libstdc++-hook.sh
@@ -1 +1,2 @@
 export NIX_CXXSTDLIB_COMPILE+="-isystem $(echo -n @gcc@/include/c++/*) -isystem $(echo -n @gcc@/include/c++/*)/$(@gcc@/bin/gcc -dumpmachine)"
+export NIX_CXXSTDLIB_LINK=" -stdlib=libstdc++"
diff --git a/pkgs/development/compilers/llvm/4/default.nix b/pkgs/development/compilers/llvm/4/default.nix
index 9e5bccff3556..11a9a46c15e5 100644
--- a/pkgs/development/compilers/llvm/4/default.nix
+++ b/pkgs/development/compilers/llvm/4/default.nix
@@ -1,4 +1,8 @@
-{ lowPrio, newScope, stdenv, cmake, libxml2, python2, isl, fetchurl, overrideCC, wrapCC, darwin, ccWrapperFun }:
+{ lowPrio, newScope, stdenv, targetPlatform, cmake, libstdcxxHook
+, libxml2, python2, isl, fetchurl, overrideCC, wrapCC, ccWrapperFun
+, darwin
+}:
+
 let
   callPackage = newScope (self // { inherit stdenv cmake libxml2 python2 isl release_version version fetch; });
 
@@ -46,7 +50,12 @@ let
       extraPackages = [ self.libcxx self.libcxxabi ];
     };
 
-    stdenv = overrideCC stdenv self.clang;
+    stdenv = stdenv.override (drv: {
+      allowedRequisites = null;
+      cc = self.clang;
+      # Use the gcc libstdc++ when targeting linux.
+      extraBuildInputs = if stdenv.cc.isGNU then [ libstdcxxHook ] else drv.extraBuildInputs;
+    });
 
     libcxxStdenv = overrideCC stdenv self.libcxxClang;
 
@@ -58,4 +67,5 @@ let
 
     libcxxabi = callPackage ./libc++abi.nix {};
   };
+
 in self