From 7b73c7f49a0a4673987b661b9d679ec595704d89 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 17 Apr 2018 09:50:21 -0500 Subject: [PATCH] clang: only link if LLVMgold exists buildEnv now errors with broken symlinks. Lots of things like this still exist. Discussion in #39038. --- pkgs/development/compilers/llvm/3.4/clang.nix | 5 ++++- pkgs/development/compilers/llvm/3.5/clang.nix | 5 ++++- pkgs/development/compilers/llvm/3.7/clang/default.nix | 5 ++++- pkgs/development/compilers/llvm/3.8/clang/default.nix | 5 ++++- pkgs/development/compilers/llvm/3.9/clang/default.nix | 5 ++++- pkgs/development/compilers/llvm/4/clang/default.nix | 5 ++++- pkgs/development/compilers/llvm/6/clang/default.nix | 5 ++++- 7 files changed, 28 insertions(+), 7 deletions(-) diff --git a/pkgs/development/compilers/llvm/3.4/clang.nix b/pkgs/development/compilers/llvm/3.4/clang.nix index 10510c75035..863e7eb2247 100644 --- a/pkgs/development/compilers/llvm/3.4/clang.nix +++ b/pkgs/development/compilers/llvm/3.4/clang.nix @@ -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}/ ''; diff --git a/pkgs/development/compilers/llvm/3.5/clang.nix b/pkgs/development/compilers/llvm/3.5/clang.nix index f15c989ef51..b61118439ee 100644 --- a/pkgs/development/compilers/llvm/3.5/clang.nix +++ b/pkgs/development/compilers/llvm/3.5/clang.nix @@ -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 ''; diff --git a/pkgs/development/compilers/llvm/3.7/clang/default.nix b/pkgs/development/compilers/llvm/3.7/clang/default.nix index f27e3f0089e..a63706e95cf 100644 --- a/pkgs/development/compilers/llvm/3.7/clang/default.nix +++ b/pkgs/development/compilers/llvm/3.7/clang/default.nix @@ -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 ''; diff --git a/pkgs/development/compilers/llvm/3.8/clang/default.nix b/pkgs/development/compilers/llvm/3.8/clang/default.nix index 0147485dd58..c8b2fec5e51 100644 --- a/pkgs/development/compilers/llvm/3.8/clang/default.nix +++ b/pkgs/development/compilers/llvm/3.8/clang/default.nix @@ -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 diff --git a/pkgs/development/compilers/llvm/3.9/clang/default.nix b/pkgs/development/compilers/llvm/3.9/clang/default.nix index aafe30e4c9b..fabc6a39d9f 100644 --- a/pkgs/development/compilers/llvm/3.9/clang/default.nix +++ b/pkgs/development/compilers/llvm/3.9/clang/default.nix @@ -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 diff --git a/pkgs/development/compilers/llvm/4/clang/default.nix b/pkgs/development/compilers/llvm/4/clang/default.nix index 5531fd2ab77..e8f025c24ed 100644 --- a/pkgs/development/compilers/llvm/4/clang/default.nix +++ b/pkgs/development/compilers/llvm/4/clang/default.nix @@ -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 diff --git a/pkgs/development/compilers/llvm/6/clang/default.nix b/pkgs/development/compilers/llvm/6/clang/default.nix index 919efdc8ef9..c540a8267e9 100644 --- a/pkgs/development/compilers/llvm/6/clang/default.nix +++ b/pkgs/development/compilers/llvm/6/clang/default.nix @@ -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