Merge pull request #122044 from Ericson2314/fix-use-llvm

compiler-rt: Fix build by passing resource dir
This commit is contained in:
John Ericson 2021-05-07 15:12:40 -04:00 committed by GitHub
commit af2868fd2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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"
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
'';
mkExtraBuildCommands = cc: mkExtraBuildCommands0 cc + ''
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
ln -s "${targetLlvmLibraries.compiler-rt.out}/share" "$rsrc/share"
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
'';
in {
@ -147,7 +149,7 @@ let
'' + mkExtraBuildCommands cc;
};
lldClangNoCompilerRt = wrapCCWith {
lldClangNoCompilerRt = wrapCCWith rec {
cc = tools.clang-unwrapped;
libcxx = null;
bintools = wrapBintoolsWith {
@ -157,7 +159,7 @@ let
extraPackages = [ ];
extraBuildCommands = ''
echo "-nostartfiles" >> $out/nix-support/cc-cflags
'';
'' + mkExtraBuildCommands0 cc;
};
});

View file

@ -20,13 +20,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"
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
'';
mkExtraBuildCommands = cc: mkExtraBuildCommands0 cc + ''
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
ln -s "${targetLlvmLibraries.compiler-rt.out}/share" "$rsrc/share"
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
'';
in {
@ -149,7 +151,7 @@ let
'' + mkExtraBuildCommands cc;
};
lldClangNoCompilerRt = wrapCCWith {
lldClangNoCompilerRt = wrapCCWith rec {
cc = tools.clang-unwrapped;
libcxx = null;
bintools = wrapBintoolsWith {
@ -159,7 +161,7 @@ let
extraPackages = [ ];
extraBuildCommands = ''
echo "-nostartfiles" >> $out/nix-support/cc-cflags
'';
'' + mkExtraBuildCommands0 cc;
};
});

View file

@ -27,13 +27,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"
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
'';
mkExtraBuildCommands = cc: mkExtraBuildCommands0 cc + ''
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
ln -s "${targetLlvmLibraries.compiler-rt.out}/share" "$rsrc/share"
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
'';
in {
@ -166,7 +168,7 @@ let
'' + mkExtraBuildCommands cc;
};
lldClangNoCompilerRt = wrapCCWith {
lldClangNoCompilerRt = wrapCCWith rec {
cc = tools.clang-unwrapped;
libcxx = null;
bintools = wrapBintoolsWith {
@ -176,7 +178,7 @@ let
extraPackages = [ ];
extraBuildCommands = ''
echo "-nostartfiles" >> $out/nix-support/cc-cflags
'';
'' + mkExtraBuildCommands0 cc;
};
});

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 {
@ -147,7 +149,7 @@ let
'' + mkExtraBuildCommands cc;
};
lldClangNoCompilerRt = wrapCCWith {
lldClangNoCompilerRt = wrapCCWith rec {
cc = tools.clang-unwrapped;
libcxx = null;
bintools = wrapBintoolsWith {
@ -157,7 +159,7 @@ let
extraPackages = [ ];
extraBuildCommands = ''
echo "-nostartfiles" >> $out/nix-support/cc-cflags
'';
'' + mkExtraBuildCommands0 cc;
};
});

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;
};
});

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;
};
});