Skip to content

Commit

Permalink
clang_11: forward-port NixOS#91293
Browse files Browse the repository at this point in the history
(cherry picked from commit 7a30df9)
  • Loading branch information
ggreif authored and primeos committed Nov 4, 2020
1 parent b348fcc commit b2b839a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 0 additions & 2 deletions pkgs/development/compilers/llvm/11/clang/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
10 changes: 6 additions & 4 deletions pkgs/development/compilers/llvm/11/default.nix
Original file line number Diff line number Diff line change
@@ -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
}:
Expand All @@ -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 {

Expand Down Expand Up @@ -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
];
Expand Down

0 comments on commit b2b839a

Please sign in to comment.