mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 21:33:03 +03:00
clang: provide path to gcc on Linux
gcc contains core runtime bits that aren't available elsewhere for Linux. Fixes #6449 refs #6668
This commit is contained in:
parent
bf0aa66c17
commit
494ae5fbeb
@ -1,6 +1,7 @@
|
|||||||
{ stdenv, fetch, cmake, libxml2, libedit, llvm, version, clang-tools-extra_src }:
|
{ stdenv, fetch, cmake, libxml2, libedit, llvm, version, clang-tools-extra_src }:
|
||||||
|
let
|
||||||
stdenv.mkDerivation {
|
gcc = if stdenv.cc.cc.isGNU or false then stdenv.cc.cc else stdenv.cc.cc.gcc;
|
||||||
|
in stdenv.mkDerivation {
|
||||||
name = "clang-${version}";
|
name = "clang-${version}";
|
||||||
|
|
||||||
unpackPhase = ''
|
unpackPhase = ''
|
||||||
@ -17,6 +18,8 @@ stdenv.mkDerivation {
|
|||||||
"-DCMAKE_BUILD_TYPE=Release"
|
"-DCMAKE_BUILD_TYPE=Release"
|
||||||
"-DCMAKE_CXX_FLAGS=-std=c++11"
|
"-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");
|
(stdenv.lib.optional (stdenv.cc.libc != null) "-DC_INCLUDE_DIRS=${stdenv.cc.libc}/include");
|
||||||
|
|
||||||
patches = [ ./clang-purity.patch ];
|
patches = [ ./clang-purity.patch ];
|
||||||
@ -36,6 +39,10 @@ stdenv.mkDerivation {
|
|||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
passthru = stdenv.lib.optionalAttrs stdenv.isLinux {
|
||||||
|
inherit gcc;
|
||||||
|
};
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler";
|
description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler";
|
||||||
homepage = http://llvm.org/;
|
homepage = http://llvm.org/;
|
||||||
|
Loading…
Reference in New Issue
Block a user