Merge #122044: compiler-rt: Fix build by passing resource dir

Fast-forwarded from staging to staging-next.  See:
https://github.com/NixOS/nixpkgs/pull/111487#issuecomment-840088733
This commit is contained in:
Vladimír Čunát
2021-05-12 22:54:35 +02:00
6 changed files with 36 additions and 24 deletions

View File

@@ -18,13 +18,15 @@ let
tools = lib.makeExtensible (tools: let
callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch buildLlvmTools; });
mkExtraBuildCommands = cc: ''
mkExtraBuildCommands0 = cc: ''
rsrc="$out/resource-root"
mkdir "$rsrc"
ln -s "${cc.lib}/lib/clang/${release_version}/include" "$rsrc"
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
'';
mkExtraBuildCommands = cc: mkExtraBuildCommands0 cc + ''
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
'';
in {
@@ -150,7 +152,7 @@ let
'' + mkExtraBuildCommands cc;
};
lldClangNoCompilerRt = wrapCCWith {
lldClangNoCompilerRt = wrapCCWith rec {
cc = tools.clang-unwrapped;
libcxx = null;
bintools = wrapBintoolsWith {
@@ -160,7 +162,7 @@ let
extraPackages = [ ];
extraBuildCommands = ''
echo "-nostartfiles" >> $out/nix-support/cc-cflags
'';
'' + mkExtraBuildCommands0 cc;
};
});