clang: only link if LLVMgold exists

buildEnv now errors with broken symlinks. Lots of things like this
still exist.

Discussion in #39038.

(cherry picked from commit 7b73c7f49a)
This commit is contained in:
Matthew Bauer 2018-04-17 09:50:21 -05:00 committed by John Ericson
parent 4ffa8b6125
commit d417ada9a6
7 changed files with 28 additions and 7 deletions

View file

@ -29,7 +29,10 @@ stdenv.mkDerivation {
# Clang expects to find LLVMgold in its own prefix
# Clang expects to find sanitizer libraries in its own prefix
postInstall = ''
ln -sv ${llvm}/lib/LLVMgold.so $out/lib
if [ -e ${llvm}/lib/LLVMgold.so ]; then
ln -sv ${llvm}/lib/LLVMgold.so $out/lib
fi
ln -sv ${llvm}/lib/clang/${version}/lib $out/lib/clang/${version}/
'';

View file

@ -31,7 +31,10 @@ in stdenv.mkDerivation {
# Clang expects to find LLVMgold in its own prefix
# Clang expects to find sanitizer libraries in its own prefix
postInstall = ''
ln -sv ${llvm}/lib/LLVMgold.so $out/lib
if [ -e ${llvm}/lib/LLVMgold.so ]; then
ln -sv ${llvm}/lib/LLVMgold.so $out/lib
fi
ln -sv ${llvm}/lib/clang/${version}/lib $out/lib/clang/${version}/
ln -sv $out/bin/clang $out/bin/cpp
'';

View file

@ -32,7 +32,10 @@ let
# Clang expects to find LLVMgold in its own prefix
# Clang expects to find sanitizer libraries in its own prefix
postInstall = ''
ln -sv ${llvm}/lib/LLVMgold.so $out/lib
if [ -e ${llvm}/lib/LLVMgold.so ]; then
ln -sv ${llvm}/lib/LLVMgold.so $out/lib
fi
ln -sv ${llvm}/lib/clang/${version}/lib $out/lib/clang/${version}/
ln -sv $out/bin/clang $out/bin/cpp
'';

View file

@ -34,7 +34,10 @@ let
# Clang expects to find LLVMgold in its own prefix
# Clang expects to find sanitizer libraries in its own prefix
postInstall = ''
ln -sv ${llvm}/lib/LLVMgold.so $out/lib
if [ -e ${llvm}/lib/LLVMgold.so ]; then
ln -sv ${llvm}/lib/LLVMgold.so $out/lib
fi
ln -sv ${llvm}/lib/clang/${version}/lib $out/lib/clang/${version}/
ln -sv $out/bin/clang $out/bin/cpp

View file

@ -36,7 +36,10 @@ let
# Clang expects to find LLVMgold in its own prefix
# Clang expects to find sanitizer libraries in its own prefix
postInstall = ''
ln -sv ${llvm}/lib/LLVMgold.so $out/lib
if [ -e ${llvm}/lib/LLVMgold.so ]; then
ln -sv ${llvm}/lib/LLVMgold.so $out/lib
fi
ln -sv ${llvm}/lib/clang/${version}/lib $out/lib/clang/${version}/
ln -sv $out/bin/clang $out/bin/cpp

View file

@ -52,7 +52,10 @@ let
# Clang expects to find LLVMgold in its own prefix
# Clang expects to find sanitizer libraries in its own prefix
postInstall = ''
ln -sv ${llvm}/lib/LLVMgold.so $out/lib
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

View file

@ -53,7 +53,10 @@ let
# Clang expects to find LLVMgold in its own prefix
# Clang expects to find sanitizer libraries in its own prefix
postInstall = ''
ln -sv ${llvm}/lib/LLVMgold.so $out/lib
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