llvmPackages_*.clang: pick clangUseLLVM if targetPlatform.useLLVM

libcxxClang still depends on cc wrapper's gccForLibs for libgcc which is
not available when useLLVM is set. In such cases we need to switch to
clangUseLLVM and (try) to use compiler-rt instead.

Resolves #153759: pkgsLLVM.llvmPackages.stdenv now correctly
clangUseLLVM as cc, allowing compilation to work as expected.
This commit is contained in:
sternenseemann 2022-01-07 12:58:21 +01:00
parent 766f5ffb76
commit e238f456b8
10 changed files with 20 additions and 20 deletions

View File

@ -91,8 +91,8 @@ let
# pick clang appropriate for package set we are targeting
clang =
if (pkgs.targetPackages.stdenv or stdenv).cc.isGNU
then tools.libstdcxxClang
/**/ if stdenv.targetPlatform.useLLVM or false then tools.clangUseLLVM
else if (pkgs.targetPackages.stdenv or stdenv).cc.isGNU then tools.libstdcxxClang
else tools.libcxxClang;
libstdcxxClang = wrapCCWith rec {

View File

@ -106,8 +106,8 @@ let
# pick clang appropriate for package set we are targeting
clang =
if (pkgs.targetPackages.stdenv or stdenv).cc.isGNU
then tools.libstdcxxClang
/**/ if stdenv.targetPlatform.useLLVM or false then tools.clangUseLLVM
else if (pkgs.targetPackages.stdenv or stdenv).cc.isGNU then tools.libstdcxxClang
else tools.libcxxClang;
libstdcxxClang = wrapCCWith rec {

View File

@ -94,8 +94,8 @@ let
# pick clang appropriate for package set we are targeting
clang =
if (pkgs.targetPackages.stdenv or stdenv).cc.isGNU
then tools.libstdcxxClang
/**/ if stdenv.targetPlatform.useLLVM or false then tools.clangUseLLVM
else if (pkgs.targetPackages.stdenv or stdenv).cc.isGNU then tools.libstdcxxClang
else tools.libcxxClang;
libstdcxxClang = wrapCCWith rec {

View File

@ -95,8 +95,8 @@ let
# pick clang appropriate for package set we are targeting
clang =
if (pkgs.targetPackages.stdenv or stdenv).cc.isGNU
then tools.libstdcxxClang
/**/ if stdenv.targetPlatform.useLLVM or false then tools.clangUseLLVM
else if (pkgs.targetPackages.stdenv or stdenv).cc.isGNU then tools.libstdcxxClang
else tools.libcxxClang;
libstdcxxClang = wrapCCWith rec {

View File

@ -67,8 +67,8 @@ let
# pick clang appropriate for package set we are targeting
clang =
if (pkgs.targetPackages.stdenv or stdenv).cc.isGNU
then tools.libstdcxxClang
/**/ if stdenv.targetPlatform.useLLVM or false then tools.clangUseLLVM
else if (pkgs.targetPackages.stdenv or stdenv).cc.isGNU then tools.libstdcxxClang
else tools.libcxxClang;
libstdcxxClang = wrapCCWith rec {

View File

@ -68,8 +68,8 @@ let
# pick clang appropriate for package set we are targeting
clang =
if (pkgs.targetPackages.stdenv or stdenv).cc.isGNU
then tools.libstdcxxClang
/**/ if stdenv.targetPlatform.useLLVM or false then tools.clangUseLLVM
else if (pkgs.targetPackages.stdenv or stdenv).cc.isGNU then tools.libstdcxxClang
else tools.libcxxClang;
libstdcxxClang = wrapCCWith rec {

View File

@ -98,8 +98,8 @@ let
# pick clang appropriate for package set we are targeting
clang =
if (pkgs.targetPackages.stdenv or stdenv).cc.isGNU
then tools.libstdcxxClang
/**/ if stdenv.targetPlatform.useLLVM or false then tools.clangUseLLVM
else if (pkgs.targetPackages.stdenv or stdenv).cc.isGNU then tools.libstdcxxClang
else tools.libcxxClang;
libstdcxxClang = wrapCCWith rec {

View File

@ -99,8 +99,8 @@ let
# pick clang appropriate for package set we are targeting
clang =
if (pkgs.targetPackages.stdenv or stdenv).cc.isGNU
then tools.libstdcxxClang
/**/ if stdenv.targetPlatform.useLLVM or false then tools.clangUseLLVM
else if (pkgs.targetPackages.stdenv or stdenv).cc.isGNU then tools.libstdcxxClang
else tools.libcxxClang;
libstdcxxClang = wrapCCWith rec {

View File

@ -99,8 +99,8 @@ let
# pick clang appropriate for package set we are targeting
clang =
if (pkgs.targetPackages.stdenv or stdenv).cc.isGNU
then tools.libstdcxxClang
/**/ if stdenv.targetPlatform.useLLVM or false then tools.clangUseLLVM
else if (pkgs.targetPackages.stdenv or stdenv).cc.isGNU then tools.libstdcxxClang
else tools.libcxxClang;
libstdcxxClang = wrapCCWith rec {

View File

@ -95,8 +95,8 @@ let
# pick clang appropriate for package set we are targeting
clang =
if (pkgs.targetPackages.stdenv or stdenv).cc.isGNU
then tools.libstdcxxClang
/**/ if stdenv.targetPlatform.useLLVM or false then tools.clangUseLLVM
else if (pkgs.targetPackages.stdenv or stdenv).cc.isGNU then tools.libstdcxxClang
else tools.libcxxClang;
libstdcxxClang = wrapCCWith rec {