From 2780cf2838a84d551914c81f14471b04d3c1708f Mon Sep 17 00:00:00 2001 From: Maxim Ivanov Date: Wed, 26 Mar 2014 13:06:22 +0000 Subject: [PATCH] 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 --- pkgs/development/compilers/llvm/3.4/clang.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/llvm/3.4/clang.nix b/pkgs/development/compilers/llvm/3.4/clang.nix index 6bb5622d0cf5..7032056f7e47 100644 --- a/pkgs/development/compilers/llvm/3.4/clang.nix +++ b/pkgs/development/compilers/llvm/3.4/clang.nix @@ -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;