llvm and clang 6: factor out compiler-rt, fix libstdcxxStdenv sanitizer headers

Build compiler-rt separate from llvm and clang, and just add as an extra
library in the wrapper.
This commit is contained in:
Benjamin Saunders
2018-05-24 02:57:43 -04:00
committed by John Ericson
parent e5175fbf20
commit 16da44b5c1
4 changed files with 53 additions and 27 deletions
@@ -30,10 +30,7 @@ let
"-DSPHINX_OUTPUT_MAN=ON"
"-DSPHINX_OUTPUT_HTML=OFF"
"-DSPHINX_WARNINGS_AS_ERRORS=OFF"
]
# 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 = [ ./purity.patch ];
@@ -51,13 +48,11 @@ let
outputs = [ "out" "lib" "python" ];
# Clang expects to find LLVMgold in its own prefix
# Clang expects to find sanitizer libraries in its own prefix
postInstall = ''
if [ -e ${llvm}/lib/LLVMgold.so ]; then
ln -sv ${llvm}/lib/LLVMgold.so $out/lib
fi
ln -sv ${llvm}/lib/clang/${release_version}/lib $out/lib/clang/${release_version}/
ln -sv $out/bin/clang $out/bin/cpp
# Move libclang to 'lib' output
@@ -79,7 +74,7 @@ let
passthru = {
isClang = true;
inherit llvm;
} // stdenv.lib.optionalAttrs stdenv.isLinux {
} // stdenv.lib.optionalAttrs stdenv.targetPlatform.isLinux {
inherit gcc;
};