@ -1,21 +1,21 @@
{ lowPrio , newScope , pkgs , stdenv , cmake
{ lowPrio , newScope , pkgs , stdenv , cmake , gccForLibs
, libxml2 , python3 , isl , fetchurl , overrideCC , wrapCCWith , wrapBintoolsWith
, buildPackages
, buildLlvmTools # tools, but from the previous stage, for cross
, targetLlvmLibraries # libraries, but from the next stage, for cross
} :
let
release_version = " 1 1 . 0 . 0 " ;
candidate = " r c 5 " ;
version = " ${ release_version } ${ candidate } " ; # differentiating these (variables) is important for RCs
version = " ${ release_version } " ; # differentiating these (variables) is important for RCs
targetConfig = stdenv . targetPlatform . config ;
fetch = name : sha256 : fetchurl {
url = " h t t p s : / / g i t h u b . c o m / l l v m / l l v m - p r o j e c t / r e l e a s e s / d o w n l o a d / l l v m o r g - ${ release_version } - ${ candidate } /${ name } - ${ version } . s r c . t a r . x z " ;
url = " h t t p s : / / g i t h u b . c o m / l l v m / l l v m - p r o j e c t / r e l e a s e s / d o w n l o a d / l l v m o r g - ${ release_version } / ${ name } - ${ version } . s r c . t a r . x z " ;
inherit sha256 ;
} ;
clang-tools-extra_src = fetch " c l a n g - t o o l s - e x t r a " " 0 s l q x 5 4 3 0 p c 6 9 9 i d a b q n q 3 4 s 9 n 0 y 2 f q 6 q 8 z 8 h n 5 w a k b i 9 3 d a l 7 1 r " ;
clang-tools-extra_src = fetch " c l a n g - t o o l s - e x t r a " " 0 2 b c w w n 5 4 6 6 1 m a d h q 4 n x c 0 6 9 s 7 p 7 p j 5 g p q i 8 w w 5 0 w 3 a n b p v i i l z y " ;
tools = stdenv . lib . makeExtensible ( tools : let
callPackage = newScope ( tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch ; } ) ;
@ -26,8 +26,8 @@ let
ln - s " ${ targetLlvmLibraries . compiler-rt . out } / l i b " " $ r s r c / l i b "
ln - s " ${ targetLlvmLibraries . compiler-rt . out } / s h a r e " " $ r s r c / s h a r e "
echo " - r e s o u r c e - d i r = $ r s r c " > > $ out/nix-support/cc-cflags
'' + s t d e n v . l i b . o p t i o n a l S t r i n g ( s t d e n v . t a r g e t P l a t f o r m . i s L i n u x & & t o o l s . c l a n g - u n w r a p p e d ? g c c & & !( s t d e n v . t a r g e t P l a t f o r m . u s e L L V M o r f a l s e ) ) ''
echo " - - g c c - t o o l c h a i n = ${ tools . clang-unwrapped . gcc } " > > $ out/nix-support/cc-cflags
'' + s t d e n v . l i b . o p t i o n a l S t r i n g ( s t d e n v . t a r g e t P l a t f o r m . i s L i n u x & & ! ( s t d e n v . t a r g e t P l a t f o r m . u s e L L V M o r f a l s e ) ) ''
echo " - - g c c - t o o l c h a i n = ${ gccForLibs } " > > $ out/nix-support/cc-cflags
'' ;
in {
@ -61,7 +61,8 @@ let
libstdcxxClang = wrapCCWith rec {
cc = tools . clang-unwrapped ;
libcxx = null ; # libstdcxx is smuggled in with clang.gcc
# libstdcxx is taken from gcc in an ad-hoc way in cc-wrapper.
libcxx = null ;
extraPackages = [
targetLlvmLibraries . compiler-rt
] ;