From 494ae5fbebd93be58a1dcca18201a6ca166c156d Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Fri, 6 Mar 2015 08:36:42 -0500 Subject: [PATCH] clang: provide path to gcc on Linux gcc contains core runtime bits that aren't available elsewhere for Linux. Fixes #6449 refs #6668 --- pkgs/development/compilers/llvm/3.5/clang.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/llvm/3.5/clang.nix b/pkgs/development/compilers/llvm/3.5/clang.nix index a95b77c08b63..93e0056fb92d 100644 --- a/pkgs/development/compilers/llvm/3.5/clang.nix +++ b/pkgs/development/compilers/llvm/3.5/clang.nix @@ -1,6 +1,7 @@ { 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 +18,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 ]; @@ -36,6 +39,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/;