Fix -fsanitize=... options for clang

When using -fsanitize=... options clang implicitly
links binary to static libraries which are part of
llvm, but expects them to be found under clang prefix
This commit is contained in:
Maxim Ivanov 2014-03-26 13:06:22 +00:00
parent 97a733ae57
commit 2780cf2838

View File

@ -28,7 +28,11 @@ stdenv.mkDerivation {
(stdenv.lib.optional (stdenv.gcc.gcc != null) "-DGCC_INSTALL_PREFIX=${stdenv.gcc.gcc}");
# Clang expects to find LLVMgold in its own prefix
postInstall = "ln -sv ${llvm}/lib/LLVMgold.so $out/lib";
# Clang expects to find sanitizer libraries in its own prefix
postInstall = ''
ln -sv ${llvm}/lib/LLVMgold.so $out/lib
ln -sv ${llvm}/lib/clang/3.4/lib $out/lib/clang/3.4/
'';
passthru.gcc = stdenv.gcc.gcc;