Skip to content

Commit

Permalink
lib.systems: introduce cc, bintools, cxxlib, unwinderlib, and rtlib a…
Browse files Browse the repository at this point in the history
…ttributes
  • Loading branch information
RossComputerGuy committed Jan 22, 2025
1 parent 564ebca commit 2ef4251
Show file tree
Hide file tree
Showing 29 changed files with 203 additions and 107 deletions.
35 changes: 32 additions & 3 deletions lib/systems/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ let
# `parsed` is inferred from args, both because there are two options with one
# clearly preferred, and to prevent cycles. A simpler fixed point where the RHS
# always just used `final.*` would fail on both counts.
elaborate = systemOrArgs: let
elaborate = systemOrArgs:
assert lib.assertMsg (!(lib.oldestSupportedReleaseIsAtLeast 2511 && systemOrArgs ? useLLVM)) "The useLLVM attribute has been deprecated in favor of the toolchain attributes.";
assert lib.assertMsg (!(lib.oldestSupportedReleaseIsAtLeast 2511 && systemOrArgs ? useArocc)) "The useArocc attribute has been deprecated in favor of the toolchain attributes.";
assert lib.assertMsg (!(lib.oldestSupportedReleaseIsAtLeast 2511 && systemOrArgs ? useZig)) "The useZig attribute has been deprecated in favor of the toolchain attributes.";
let
allArgs = systemToAttrs systemOrArgs;

# Those two will always be derived from "config", if given, so they should NOT
Expand All @@ -92,6 +96,21 @@ let
isCompatible = _: throw "2022-05-23: isCompatible has been removed in favor of canExecute, refer to the 22.11 changelog for details";
# Derived meta-data
useLLVM = final.isFreeBSD || final.isOpenBSD;
useArocc = false;
useZig = false;

cc = if final.useLLVM || final.isDarwin then "clang"
else if final.useArocc then "arocc"
else if final.useZig then "zig"
else "gcc";

bintools = if final.useLLVM || final.useArocc || final.useZig || final.isDarwin then
"llvm"
else "gnu";

cxxlib =
/**/ if final.useLLVM || final.useArocc || final.useZig || final.isDarwin then "libcxx"
else "libstdcxx";

libc =
/**/ if final.isDarwin then "libSystem"
Expand All @@ -112,15 +131,25 @@ let
else if final.isNone then "newlib"
# TODO(@Ericson2314) think more about other operating systems
else "native/impure";

unwinderlib =
/**/ if final.useLLVM || final.useArocc || final.useZig then "libunwind"
else if final.isDarwin then "libunwind-system"
else "libgcc_s";

rtlib =
/**/ if final.useLLVM || final.useArocc || final.useZig || final.isDarwin then "compiler-rt"
else "libgcc";

# Choose what linker we wish to use by default. Someday we might also
# choose the C compiler, runtime library, C++ standard library, etc. in
# this way, nice and orthogonally, and deprecate `useLLVM`. But due to
# the monolithic GCC build we cannot actually make those choices
# independently, so we are just doing `linker` and keeping `useLLVM` for
# now.
linker =
/**/ if final.useLLVM or false then "lld"
else if final.isDarwin then "cctools"
/**/ if final.useLLVM then "lld"
else if final.isDarwin then "cctools"
# "bfd" and "gold" both come from GNU binutils. The existence of Gold
# is why we use the more obscure "bfd" and not "binutils" for this
# choice.
Expand Down
4 changes: 2 additions & 2 deletions pkgs/build-support/cc-wrapper/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ let

useGccForLibs = useCcForLibs
&& libcxx == null
&& targetPlatform.rtlib == "libgcc"
&& !targetPlatform.isDarwin
&& !(targetPlatform.useLLVM or false)
&& !(targetPlatform.useAndroidPrebuilt or false)
&& !(targetPlatform.isiOS or false)
&& gccForLibs != null;
Expand Down Expand Up @@ -514,7 +514,7 @@ stdenvNoCC.mkDerivation {
+ optionalString (isClang
&& targetPlatform.isLinux
&& !(targetPlatform.useAndroidPrebuilt or false)
&& !(targetPlatform.useLLVM or false)
&& targetPlatform.rtlib == "libgcc"
&& gccForLibs != null) (''
echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/al/alsa-lib/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ stdenv.mkDerivation (finalAttrs: {
# order to support apps with 32bit sound running on x86_64 architecture.
./alsa-plugin-conf-multilib.patch
]
++ lib.optional (stdenv.hostPlatform.useLLVM or false)
++ lib.optional (stdenv.hostPlatform.linker == "lld")
# Fixes version script under LLVM, should be fixed in the next update.
# Check if "pkgsLLVM.alsa-lib" builds on next version bump and remove this
# if it succeeds.
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/cl/cling/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

# Build with libc++ (LLVM) rather than stdlibc++ (GCC).
# This is experimental and not all features work.
useLLVMLibcxx ? clangStdenv.hostPlatform.isDarwin,
useLLVMLibcxx ? clangStdenv.hostPlatform.cxxlib == "libcxx",
}:

let
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/cy/cyrus_sasl/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ stdenv.mkDerivation rec {
"--enable-shared"
]
++ lib.optional enableLdap "--with-ldap=${openldap.dev}"
++ lib.optionals (stdenv.targetPlatform.useLLVM or false) [
++ lib.optionals (stdenv.hostPlatform.cc == "clang" && !stdenv.hostPlatform.isDarwin) [
"--disable-sample"
"CFLAGS=-DTIME_WITH_SYS_TIME"
];
Expand Down
6 changes: 3 additions & 3 deletions pkgs/by-name/el/elfutils/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ stdenv.mkDerivation rec {
++ lib.optionals stdenv.hostPlatform.isMusl [ ./musl-error_h.patch ]
# Prevent headers and binaries from colliding which results in an error.
# https://sourceware.org/pipermail/elfutils-devel/2024q3/007281.html
++ lib.optional (stdenv.targetPlatform.useLLVM or false) ./cxx-header-collision.patch;
++ lib.optional (stdenv.hostPlatform.cxxlib == "libcxx") ./cxx-header-collision.patch;

postPatch =
''
Expand Down Expand Up @@ -94,7 +94,7 @@ stdenv.mkDerivation rec {
bzip2
]
++ lib.optional enableDebuginfod pkg-config
++ lib.optional (stdenv.targetPlatform.useLLVM or false) autoreconfHook;
++ lib.optional (stdenv.hostPlatform.cxxlib == "libcxx") autoreconfHook;
buildInputs =
[
zlib
Expand Down Expand Up @@ -128,7 +128,7 @@ stdenv.mkDerivation rec {
# Versioned symbols are nice to have, but we can do without.
(lib.enableFeature (!stdenv.hostPlatform.isMicroBlaze) "symbol-versioning")
]
++ lib.optional (stdenv.targetPlatform.useLLVM or false) "--disable-demangler"
++ lib.optional (stdenv.hostPlatform.unwinderlib == "libunwind") "--disable-demangler"
++ lib.optionals stdenv.cc.isClang [
"CFLAGS=-Wno-unused-private-field"
"CXXFLAGS=-Wno-unused-private-field"
Expand Down
18 changes: 11 additions & 7 deletions pkgs/by-name/ke/kexec-tools/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,17 @@ stdenv.mkDerivation rec {
sha256 = "sha256-Z7GsUDqt5FpU2wvHkiiogwo11dT4PO6TLP8+eoGkqew=";
};

patches = [
# Use ELFv2 ABI on ppc64be
(fetchpatch {
url = "https://raw.githubusercontent.com/void-linux/void-packages/6c1192cbf166698932030c2e3de71db1885a572d/srcpkgs/kexec-tools/patches/ppc64-elfv2.patch";
sha256 = "19wzfwb0azm932v0vhywv4221818qmlmvdfwpvvpfyw4hjsc2s1l";
})
] ++ lib.optional (stdenv.hostPlatform.useLLVM or false) ./fix-purgatory-llvm-libunwind.patch;
patches =
[
# Use ELFv2 ABI on ppc64be
(fetchpatch {
url = "https://raw.githubusercontent.com/void-linux/void-packages/6c1192cbf166698932030c2e3de71db1885a572d/srcpkgs/kexec-tools/patches/ppc64-elfv2.patch";
sha256 = "19wzfwb0azm932v0vhywv4221818qmlmvdfwpvvpfyw4hjsc2s1l";
})
]
++ lib.optional (
stdenv.hostPlatform.unwinderlib == "libunwind"
) ./fix-purgatory-llvm-libunwind.patch;

hardeningDisable = [
"format"
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/li/libseccomp/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
util-linuxMinimal
which
];
doCheck = !(stdenv.targetPlatform.useLLVM or false);
doCheck = stdenv.hostPlatform.cc != "clang";

# Hack to ensure that patchelf --shrink-rpath get rids of a $TMPDIR reference.
preFixup = "rm -rfv src";
Expand Down
4 changes: 2 additions & 2 deletions pkgs/by-name/so/sourceHighlight/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ];
buildInputs =
[ boost ]
++ lib.optional (stdenv.targetPlatform.useLLVM or false) (
++ lib.optional (stdenv.hostPlatform.rtlib == "compiler-rt" && !stdenv.hostPlatform.isDarwin) (
llvmPackages.compiler-rt.override {
doFakeLibgcc = true;
}
Expand Down Expand Up @@ -92,7 +92,7 @@ stdenv.mkDerivation rec {
maintainers = with maintainers; [ SuperSandro2000 ];
};
}
// lib.optionalAttrs (stdenv.targetPlatform.useLLVM or false) {
// lib.optionalAttrs (stdenv.hostPlatform.rtlib == "libunwind" && !stdenv.hostPlatform.isDarwin) {
# Force linking to "libgcc" so tests pass
NIX_CFLAGS_COMPILE = "-lgcc";
}
2 changes: 1 addition & 1 deletion pkgs/development/compilers/llvm/common/clang/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ let
ninjaFlags = [ "docs-clang-man" ];
}))
// (lib.optionalAttrs (lib.versionAtLeast release_version "15") {
env = lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform && !stdenv.hostPlatform.useLLVM) {
env = lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform && stdenv.hostPlatform.cc != "clang" && !stdenv.hostPlatform.isDarwin) {
# The following warning is triggered with (at least) gcc >=
# 12, but appears to occur only for cross compiles.
NIX_CFLAGS_COMPILE = "-Wno-maybe-uninitialized";
Expand Down
13 changes: 6 additions & 7 deletions pkgs/development/compilers/llvm/common/compiler-rt/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

let

useLLVM = stdenv.hostPlatform.useLLVM or false;
bareMetal = stdenv.hostPlatform.parsed.kernel.name == "none";
haveLibc = stdenv.cc.libc != null;
# TODO: Make this account for GCC having libstdcxx, which will help
Expand Down Expand Up @@ -92,22 +91,22 @@ stdenv.mkDerivation {
"-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}"
] ++ lib.optionals (haveLibc && stdenv.hostPlatform.libc == "glibc") [
"-DSANITIZER_COMMON_CFLAGS=-I${libxcrypt}/include"
] ++ lib.optionals (useLLVM && haveLibc && stdenv.cc.libcxx == libcxx) [
] ++ lib.optionals (stdenv.hostPlatform.cxxlib == "libcxx" && haveLibc && stdenv.cc.libcxx == libcxx && !stdenv.hostPlatform.isDarwin) [
"-DSANITIZER_CXX_ABI=libcxxabi"
"-DSANITIZER_CXX_ABI_LIBNAME=libcxxabi"
"-DCOMPILER_RT_USE_BUILTINS_LIBRARY=ON"
] ++ lib.optionals ((!haveLibc || bareMetal || isMusl || isAarch64) && (lib.versions.major release_version == "13")) [
"-DCOMPILER_RT_BUILD_LIBFUZZER=OFF"
] ++ lib.optionals (useLLVM && haveLibc) [
] ++ lib.optionals (stdenv.hostPlatform.rtlib == "compiler-rt" && haveLibc && !stdenv.hostPlatform.isDarwin) [
"-DCOMPILER_RT_BUILD_SANITIZERS=ON"
] ++ lib.optionals (noSanitizers) [
"-DCOMPILER_RT_BUILD_SANITIZERS=OFF"
] ++ lib.optionals ((useLLVM && !haveLibcxx) || !haveLibc || bareMetal || isMusl || isDarwinStatic) [
] ++ lib.optionals ((stdenv.hostPlatform.rtlib == "compiler-rt" && !haveLibcxx) || !haveLibc || bareMetal || isMusl || isDarwinStatic) [
"-DCOMPILER_RT_BUILD_XRAY=OFF"
"-DCOMPILER_RT_BUILD_LIBFUZZER=OFF"
"-DCOMPILER_RT_BUILD_MEMPROF=OFF"
"-DCOMPILER_RT_BUILD_ORC=OFF" # may be possible to build with musl if necessary
] ++ lib.optionals (useLLVM && haveLibc) [
] ++ lib.optionals (stdenv.hostPlatform.rtlib == "compiler-rt" && haveLibc && !stdenv.hostPlatform.isDarwin) [
"-DCOMPILER_RT_BUILD_PROFILE=ON"
] ++ lib.optionals (!haveLibc || bareMetal) [
"-DCOMPILER_RT_BUILD_PROFILE=OFF"
Expand All @@ -119,7 +118,7 @@ stdenv.mkDerivation {
"-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}"
] ++ lib.optionals (!haveLibc) [
"-DCMAKE_C_FLAGS=-nodefaultlibs"
] ++ lib.optionals (useLLVM) [
] ++ lib.optionals (stdenv.hostPlatform.rtlib == "compiler-rt" && !stdenv.hostPlatform.isDarwin) [
"-DCOMPILER_RT_BUILD_BUILTINS=ON"
#https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program
"-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY"
Expand Down Expand Up @@ -191,7 +190,7 @@ stdenv.mkDerivation {
# Hack around weird upsream RPATH bug
postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin) ''
ln -s "$out/lib"/*/* "$out/lib"
'' + lib.optionalString (useLLVM && stdenv.hostPlatform.isLinux) ''
'' + lib.optionalString (stdenv.hostPlatform.rtlib == "compiler-rt" && stdenv.hostPlatform.isLinux) ''
ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbegin.o
ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtend.o
# Note the history of crt{begin,end}S in previous versions of llvm in nixpkg:
Expand Down
17 changes: 9 additions & 8 deletions pkgs/development/compilers/llvm/common/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ let
clang =
if stdenv.targetPlatform.libc == null then
tools.clangNoLibc
else if stdenv.targetPlatform.useLLVM or false then
else if stdenv.targetPlatform.cc == "clang" && stdenv.targetPlatform.cxxlib == "libcxx" && stdenv.targetPlatform.bintools == "llvm" && stdenv.targetPlatform.rtlib == "compiler-rt" && !stdenv.targetPlatform.isDarwin then
tools.clangUseLLVM
else if (pkgs.targetPackages.stdenv or args.stdenv).cc.isGNU then
tools.libstdcxxClang
Expand Down Expand Up @@ -781,7 +781,7 @@ let
echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags
echo "-L${targetLlvmLibraries.libunwind}/lib" >> $out/nix-support/cc-ldflags
''
+ lib.optionalString (!stdenv.targetPlatform.isWasm && stdenv.targetPlatform.useLLVM or false) ''
+ lib.optionalString (!stdenv.targetPlatform.isWasm && stdenv.targetPlatform.unwinderlib == "libunwind") ''
echo "-lunwind" >> $out/nix-support/cc-ldflags
''
+ lib.optionalString stdenv.targetPlatform.isWasm ''
Expand All @@ -803,7 +803,7 @@ let
++ lib.optional (
!stdenv.targetPlatform.isWasm
&& !stdenv.targetPlatform.isFreeBSD
&& stdenv.targetPlatform.useLLVM or false
&& stdenv.targetPlatform.unwinderlib == "libunwind"
) "-lunwind"
++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions";
nixSupport.cc-ldflags = lib.optionals (
Expand Down Expand Up @@ -836,7 +836,7 @@ let
echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags
echo "-L${targetLlvmLibraries.libunwind}/lib" >> $out/nix-support/cc-ldflags
''
+ lib.optionalString (!stdenv.targetPlatform.isWasm && stdenv.targetPlatform.useLLVM or false) ''
+ lib.optionalString (!stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isDarwin && stdenv.targetPlatform.unwinderlib == "libunwind") ''
echo "-lunwind" >> $out/nix-support/cc-ldflags
''
+ lib.optionalString stdenv.targetPlatform.isWasm ''
Expand All @@ -858,7 +858,8 @@ let
++ lib.optional (
!stdenv.targetPlatform.isWasm
&& !stdenv.targetPlatform.isFreeBSD
&& stdenv.targetPlatform.useLLVM or false
&& !stdenv.targetPlatform.isDarwin
&& stdenv.targetPlatform.unwinderlib == "libunwind"
) "-lunwind"
++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions";
nixSupport.cc-ldflags = lib.optionals (
Expand Down Expand Up @@ -1084,7 +1085,7 @@ let
# Darwin needs to use a bootstrap stdenv to avoid an infinite recursion when cross-compiling.
if args.stdenv.hostPlatform.isDarwin then
overrideCC darwin.bootstrapStdenv buildLlvmTools.clangWithLibcAndBasicRtAndLibcxx
else if args.stdenv.hostPlatform.useLLVM or false then
else if args.stdenv.hostPlatform.rtlib == "compiler-rt" && args.stdenv.hostPlatform.cxxlib == "libcxx" then
overrideCC args.stdenv buildLlvmTools.clangWithLibcAndBasicRtAndLibcxx
else
args.stdenv;
Expand All @@ -1093,7 +1094,7 @@ let
patches = compiler-rtPatches;
inherit stdenv;
}
// lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
// lib.optionalAttrs (stdenv.hostPlatform.rtlib == "compiler-rt") {
libxcrypt = (libxcrypt.override { inherit stdenv; }).overrideAttrs (old: {
configureFlags = old.configureFlags ++ [ "--disable-symvers" ];
});
Expand All @@ -1102,7 +1103,7 @@ let

compiler-rt-no-libc = callPackage ./compiler-rt {
patches = compiler-rtPatches;
doFakeLibgcc = stdenv.hostPlatform.useLLVM or false;
doFakeLibgcc = stdenv.hostPlatform.rtlib == "compiler-rt" && !stdenv.hostPlatform.isDarwin;
stdenv =
# Darwin needs to use a bootstrap stdenv to avoid an infinite recursion when cross-compiling.
if stdenv.hostPlatform.isDarwin then
Expand Down
13 changes: 5 additions & 8 deletions pkgs/development/compilers/llvm/common/libcxx/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ let
cxxabiName = "lib${if cxxabi == null then "cxxabi" else cxxabi.libName}";
runtimes = [ "libcxx" ] ++ lib.optional (cxxabi == null) "libcxxabi";

# Note: useLLVM is likely false for Darwin but true under pkgsLLVM
useLLVM = stdenv.hostPlatform.useLLVM or false;

src' = if monorepoSrc != null then
runCommand "${pname}-src-${version}" { inherit (monorepoSrc) passthru; } (''
mkdir -p "$out/llvm"
Expand All @@ -54,7 +51,7 @@ let

cxxabiCMakeFlags = lib.optionals (lib.versionAtLeast release_version "18") [
"-DLIBCXXABI_USE_LLVM_UNWINDER=OFF"
] ++ lib.optionals (useLLVM && !stdenv.hostPlatform.isWasm) (if lib.versionAtLeast release_version "18" then [
] ++ lib.optionals (stdenv.hostPlatform.unwinderlib == "libunwind" && !stdenv.hostPlatform.isWasm && !stdenv.hostPlatform.isDarwin) (if lib.versionAtLeast release_version "18" then [
"-DLIBCXXABI_ADDITIONAL_LIBRARIES=unwind"
"-DLIBCXXABI_USE_COMPILER_RT=ON"
] else [
Expand All @@ -80,15 +77,15 @@ let
"-DLIBCXX_CXX_ABI_INCLUDE_PATHS=${lib.getDev cxxabi}/include"
] ++ lib.optionals (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) [
"-DLIBCXX_HAS_MUSL_LIBC=1"
] ++ lib.optionals (lib.versionAtLeast release_version "18" && !useLLVM && stdenv.hostPlatform.libc == "glibc" && !stdenv.hostPlatform.isStatic) [
] ++ lib.optionals (lib.versionAtLeast release_version "18" && stdenv.hostPlatform.unwinderlib == "libgcc_s" && stdenv.hostPlatform.libc == "glibc" && !stdenv.hostPlatform.isStatic && !stdenv.hostPlatform.isDarwin) [
"-DLIBCXX_ADDITIONAL_LIBRARIES=gcc_s"
] ++ lib.optionals (lib.versionAtLeast release_version "18" && stdenv.hostPlatform.isFreeBSD) [
# Name and documentation claim this is for libc++abi, but its man effect is adding `-lunwind`
# to the libc++.so linker script. We want FreeBSD's so-called libgcc instead of libunwind.
"-DLIBCXXABI_USE_LLVM_UNWINDER=OFF"
] ++ lib.optionals useLLVM [
] ++ lib.optionals (stdenv.hostPlatform.rtlib == "compiler-rt" && !stdenv.hostPlatform.isDarwin) [
"-DLIBCXX_USE_COMPILER_RT=ON"
] ++ lib.optionals (useLLVM && !stdenv.hostPlatform.isFreeBSD && lib.versionAtLeast release_version "16") [
] ++ lib.optionals (stdenv.hostPlatform.rtlib == "compiler-rt" && !stdenv.hostPlatform.isFreeBSD && !stdenv.hostPlatform.isDarwin && lib.versionAtLeast release_version "16") [
"-DLIBCXX_ADDITIONAL_LIBRARIES=unwind"
] ++ lib.optionals stdenv.hostPlatform.isWasm [
"-DLIBCXX_ENABLE_THREADS=OFF"
Expand Down Expand Up @@ -135,7 +132,7 @@ stdenv.mkDerivation (rec {
++ lib.optional (cxxabi != null) lndir;

buildInputs = [ cxxabi ]
++ lib.optionals (useLLVM && !stdenv.hostPlatform.isWasm && !stdenv.hostPlatform.isFreeBSD) [ libunwind ];
++ lib.optionals (stdenv.hostPlatform.unwinderlib == "libunwind" && !stdenv.hostPlatform.isWasm && !stdenv.hostPlatform.isFreeBSD && !stdenv.hostPlatform.isDarwin) [ libunwind ];

# libc++.so is a linker script which expands to multiple libraries,
# libc++.so.1 and libc++abi.so or the external cxxabi. ld-wrapper doesn't
Expand Down
Loading

0 comments on commit 2ef4251

Please sign in to comment.