diff options
author | Daiderd Jordan <daiderd@gmail.com> | 2017-09-11 20:35:36 +0200 |
---|---|---|
committer | Daiderd Jordan <daiderd@gmail.com> | 2017-09-13 20:51:41 +0200 |
commit | ac88515052316802b09fd0956aa4ef0b8a63b823 (patch) | |
tree | 9644fb8ef545d96c9d3ae488feeef7fc1f489812 /pkgs/development/compilers/llvm | |
parent | 33c99ab2fb637dd37de92d898f82523b8f3a76b8 (diff) | |
download | nixlib-ac88515052316802b09fd0956aa4ef0b8a63b823.tar nixlib-ac88515052316802b09fd0956aa4ef0b8a63b823.tar.gz nixlib-ac88515052316802b09fd0956aa4ef0b8a63b823.tar.bz2 nixlib-ac88515052316802b09fd0956aa4ef0b8a63b823.tar.lz nixlib-ac88515052316802b09fd0956aa4ef0b8a63b823.tar.xz nixlib-ac88515052316802b09fd0956aa4ef0b8a63b823.tar.zst nixlib-ac88515052316802b09fd0956aa4ef0b8a63b823.zip |
clang-stdenv: move libstdcxxHook to cc-wrapper
Diffstat (limited to 'pkgs/development/compilers/llvm')
-rw-r--r-- | pkgs/development/compilers/llvm/4/default.nix | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/pkgs/development/compilers/llvm/4/default.nix b/pkgs/development/compilers/llvm/4/default.nix index 11a9a46c15e5..c1d1ce055d76 100644 --- a/pkgs/development/compilers/llvm/4/default.nix +++ b/pkgs/development/compilers/llvm/4/default.nix @@ -37,14 +37,17 @@ let llvm-manpages = lowPrio self.llvm.man; clang-manpages = lowPrio self.clang-unwrapped.man; - clang = wrapCC self.clang-unwrapped; + clang = if stdenv.cc.isGNU then self.libstdcxxClang else self.libcxxClang; - openmp = callPackage ./openmp.nix {}; + libstdcxxClang = ccWrapperFun { + cc = self.clang-unwrapped; + /* FIXME is this right? */ + inherit (stdenv.cc) libc nativeTools nativeLibc; + extraPackages = [ libstdcxxHook ]; + }; libcxxClang = ccWrapperFun { cc = self.clang-unwrapped; - isClang = true; - inherit (self) stdenv; /* FIXME is this right? */ inherit (stdenv.cc) libc nativeTools nativeLibc; extraPackages = [ self.libcxx self.libcxxabi ]; @@ -53,11 +56,16 @@ let 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; + # Don't include the libc++ and libc++abi from the original stdenv. + extraBuildInputs = stdenv.lib.optional stdenv.isDarwin darwin.CF; }); - libcxxStdenv = overrideCC stdenv self.libcxxClang; + libcxxStdenv = stdenv.override (drv: { + allowedRequisites = null; + cc = self.libcxxClang; + # Don't include the libc++ and libc++abi from the original stdenv. + extraBuildInputs = stdenv.lib.optional stdenv.isDarwin darwin.CF; + }); lld = callPackage ./lld.nix {}; @@ -66,6 +74,8 @@ let libcxx = callPackage ./libc++ {}; libcxxabi = callPackage ./libc++abi.nix {}; + + openmp = callPackage ./openmp.nix {}; }; in self |