clang_11: forward-port #91293

This commit is contained in:
Gabor Greif 2020-10-15 14:59:07 +02:00
parent cffb7cfbf7
commit 7a30df9225
2 changed files with 6 additions and 6 deletions

View File

@ -86,8 +86,6 @@ let
passthru = {
isClang = true;
inherit llvm;
} // stdenv.lib.optionalAttrs (stdenv.targetPlatform.isLinux || (stdenv.cc.isGNU && stdenv.cc.cc ? gcc)) {
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
};
meta = {

View File

@ -1,5 +1,6 @@
{ lowPrio, newScope, pkgs, stdenv, cmake
{ lowPrio, newScope, pkgs, stdenv, cmake, gccForLibs
, libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith
, buildPackages
, buildLlvmTools # tools, but from the previous stage, for cross
, targetLlvmLibraries # libraries, but from the next stage, for cross
}:
@ -25,8 +26,8 @@ let
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
'' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && tools.clang-unwrapped ? gcc && !(stdenv.targetPlatform.useLLVM or false)) ''
echo "--gcc-toolchain=${tools.clang-unwrapped.gcc}" >> $out/nix-support/cc-cflags
'' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) ''
echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags
'';
in {
@ -60,7 +61,8 @@ let
libstdcxxClang = wrapCCWith rec {
cc = tools.clang-unwrapped;
libcxx = null; # libstdcxx is smuggled in with clang.gcc
# libstdcxx is taken from gcc in an ad-hoc way in cc-wrapper.
libcxx = null;
extraPackages = [
targetLlvmLibraries.compiler-rt
];