Skip to content

Commit

Permalink
llvmPackages_{7-12} stdenvs: link all resource files from compiler-rt
Browse files Browse the repository at this point in the history
Likely due to an oversight, after 7869d16
some of the resource files of compiler-rt are installed to $dev/include
instead of $out/share which breaks the assumption of multiple cc
wrappers in llvmPackages. To resolve this without causing a mass rebuild
on darwin, link the files from the wrong location into the correct place
in clang's resource root.

The proper fix for this is NixOS#123103 which however causes a darwin stdenv
rebuild and should go through staging first.
  • Loading branch information
sternenseemann committed May 15, 2021
1 parent ec10b09 commit a805a41
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 3 deletions.
4 changes: 3 additions & 1 deletion pkgs/development/compilers/llvm/10/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ let
'';
mkExtraBuildCommands = cc: mkExtraBuildCommands0 cc + ''
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
ln -s "${targetLlvmLibraries.compiler-rt.out}/share" "$rsrc/share"
mkdir -p "$rsrc/share"
ln -s "${targetLlvmLibraries.compiler-rt.out}/share/"* "$rsrc/share/"
ln -s "${targetLlvmLibraries.compiler-rt.dev}/include/"*.txt "$rsrc/share/"
'';

in {
Expand Down
4 changes: 3 additions & 1 deletion pkgs/development/compilers/llvm/11/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ let
'';
mkExtraBuildCommands = cc: mkExtraBuildCommands0 cc + ''
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
ln -s "${targetLlvmLibraries.compiler-rt.out}/share" "$rsrc/share"
mkdir -p "$rsrc/share"
ln -s "${targetLlvmLibraries.compiler-rt.out}/share/"* "$rsrc/share/"
ln -s "${targetLlvmLibraries.compiler-rt.dev}/include/"*.txt "$rsrc/share/"
'';

in {
Expand Down
4 changes: 3 additions & 1 deletion pkgs/development/compilers/llvm/12/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ let
'';
mkExtraBuildCommands = cc: mkExtraBuildCommands0 cc + ''
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
ln -s "${targetLlvmLibraries.compiler-rt.out}/share" "$rsrc/share"
mkdir -p "$rsrc/share"
ln -s "${targetLlvmLibraries.compiler-rt.out}/share/"* "$rsrc/share/"
ln -s "${targetLlvmLibraries.compiler-rt.dev}/include/"*.txt "$rsrc/share/"
'';

in {
Expand Down
3 changes: 3 additions & 0 deletions pkgs/development/compilers/llvm/7/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ let
'';
mkExtraBuildCommands = cc: mkExtraBuildCommands0 cc + ''
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
mkdir -p "$rsrc/share"
ln -s "${targetLlvmLibraries.compiler-rt.out}/share/"* "$rsrc/share/"
ln -s "${targetLlvmLibraries.compiler-rt.dev}/include/"*.txt "$rsrc/share/"
'';

in {
Expand Down
3 changes: 3 additions & 0 deletions pkgs/development/compilers/llvm/8/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ let
'';
mkExtraBuildCommands = cc: mkExtraBuildCommands0 cc + ''
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
mkdir -p "$rsrc/share"
ln -s "${targetLlvmLibraries.compiler-rt.out}/share/"* "$rsrc/share/"
ln -s "${targetLlvmLibraries.compiler-rt.dev}/include/"*.txt "$rsrc/share/"
'';

in {
Expand Down
3 changes: 3 additions & 0 deletions pkgs/development/compilers/llvm/9/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ let
'';
mkExtraBuildCommands = cc: mkExtraBuildCommands0 cc + ''
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
mkdir -p "$rsrc/share"
ln -s "${targetLlvmLibraries.compiler-rt.out}/share/"* "$rsrc/share/"
ln -s "${targetLlvmLibraries.compiler-rt.dev}/include/"*.txt "$rsrc/share/"
'';

in {
Expand Down

0 comments on commit a805a41

Please sign in to comment.