about summary refs log tree commit diff
path: root/pkgs/development/compilers
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2015-03-06 13:49:49 +0000
committerShea Levy <shea@shealevy.com>2015-03-06 13:49:49 +0000
commit55cf0151424be6a2dba0eda5459ece0840472f1a (patch)
treeacb0bf03db9f991bf166b44abb677e52d609e204 /pkgs/development/compilers
parentde89820f69c0d8ed076d9fbd2b79dda90a41e71e (diff)
downloadnixlib-55cf0151424be6a2dba0eda5459ece0840472f1a.tar
nixlib-55cf0151424be6a2dba0eda5459ece0840472f1a.tar.gz
nixlib-55cf0151424be6a2dba0eda5459ece0840472f1a.tar.bz2
nixlib-55cf0151424be6a2dba0eda5459ece0840472f1a.tar.lz
nixlib-55cf0151424be6a2dba0eda5459ece0840472f1a.tar.xz
nixlib-55cf0151424be6a2dba0eda5459ece0840472f1a.tar.zst
nixlib-55cf0151424be6a2dba0eda5459ece0840472f1a.zip
clang-3.6: provide path to gcc on Linux
gcc contains core runtime bits that aren't available elsewhere for Linux.

Refs #6449
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r--pkgs/development/compilers/llvm/3.6/clang.nix10
1 files changed, 9 insertions, 1 deletions
diff --git a/pkgs/development/compilers/llvm/3.6/clang.nix b/pkgs/development/compilers/llvm/3.6/clang.nix
index 49b75d7fe0d6..45ad74457122 100644
--- a/pkgs/development/compilers/llvm/3.6/clang.nix
+++ b/pkgs/development/compilers/llvm/3.6/clang.nix
@@ -1,6 +1,8 @@
 { stdenv, fetch, cmake, libxml2, libedit, llvm, version, clang-tools-extra_src }:
 
-stdenv.mkDerivation {
+let
+  gcc = if stdenv.cc.cc.isGNU or false then stdenv.cc.cc else stdenv.cc.cc.gcc;
+in stdenv.mkDerivation {
   name = "clang-${version}";
 
   unpackPhase = ''
@@ -17,6 +19,8 @@ stdenv.mkDerivation {
     "-DCMAKE_BUILD_TYPE=Release"
     "-DCMAKE_CXX_FLAGS=-std=c++11"
   ] ++
+  # Maybe with compiler-rt this won't be needed?
+  (stdenv.lib.optional stdenv.isLinux "-DGCC_INSTALL_PREFIX=${gcc}") ++
   (stdenv.lib.optional (stdenv.cc.libc != null) "-DC_INCLUDE_DIRS=${stdenv.cc.libc}/include");
 
   patches = [ ./clang-purity.patch ./clang-exports.patch ];
@@ -36,6 +40,10 @@ stdenv.mkDerivation {
 
   enableParallelBuilding = true;
 
+  passthru = stdenv.lib.optionalAttrs stdenv.isLinux {
+    inherit gcc;
+  };
+
   meta = {
     description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler";
     homepage    = http://llvm.org/;