Skip to content

Commit

Permalink
llvmPackages_15.compiler-rt: gate the libxcrypt dep on `plat.libc =…
Browse files Browse the repository at this point in the history
…= "glibc"`

This restores this check to what it originally was in NixOS#196909 (see:
NixOS#196909 (comment)) and
lets `compiler-rt` eval successfully when trying to compile the
`llvmPackages_15` set for mingw targets (i.e. a platform that *is* GNU
but does *not* use glibc).

---

It's not clear to me what the `haveLibc` check is doing here (platforms
that seem to use glibc like `x86_64-linux` and have
`plat.libc == "glibc"` have `haveLibc = false` because `stdenv.cc.libc`
is `null`).
  • Loading branch information
rrbutani authored and xanderio committed Feb 13, 2023
1 parent 5a1bf7d commit 0421cd1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkgs/development/compilers/llvm/15/compiler-rt/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ stdenv.mkDerivation {
"-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON"
"-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}"
"-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}"
] ++ lib.optionals (haveLibc && isGnu) [
] ++ lib.optionals (haveLibc && stdenv.hostPlatform.libc == "glibc") [
"-DSANITIZER_COMMON_CFLAGS=-I${libxcrypt}/include"
] ++ lib.optionals (useLLVM || bareMetal || isMusl) [
"-DCOMPILER_RT_BUILD_SANITIZERS=OFF"
Expand Down

0 comments on commit 0421cd1

Please sign in to comment.