Skip to content

Commit d1f2bc2

Browse files
authored
llvmPackages_git.compiler-rt: disable building ctx_profile when build sanitizers are disabled (#332918)
2 parents 3b1256e + d390ce7 commit d1f2bc2

File tree

1 file changed

+4
-1
lines changed
  • pkgs/development/compilers/llvm/common/compiler-rt

1 file changed

+4
-1
lines changed

pkgs/development/compilers/llvm/common/compiler-rt/default.nix

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ let
3939
haveLibcxx = stdenv.cc.libcxx != null;
4040
isDarwinStatic = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isStatic && lib.versionAtLeast release_version "16";
4141
inherit (stdenv.hostPlatform) isMusl isAarch64;
42+
noSanitizers = !haveLibc || bareMetal || isMusl || isDarwinStatic;
4243

4344
baseName = "compiler-rt";
4445
pname = baseName + lib.optionalString (haveLibc) "-libc";
@@ -94,7 +95,7 @@ stdenv.mkDerivation ({
9495
"-DCOMPILER_RT_BUILD_LIBFUZZER=OFF"
9596
] ++ lib.optionals (useLLVM && haveLibc) [
9697
"-DCOMPILER_RT_BUILD_SANITIZERS=ON"
97-
] ++ lib.optionals (!haveLibc || bareMetal || isMusl || isDarwinStatic) [
98+
] ++ lib.optionals (noSanitizers) [
9899
"-DCOMPILER_RT_BUILD_SANITIZERS=OFF"
99100
] ++ lib.optionals ((useLLVM && !haveLibcxx) || !haveLibc || bareMetal || isMusl || isDarwinStatic) [
100101
"-DCOMPILER_RT_BUILD_XRAY=OFF"
@@ -131,6 +132,8 @@ stdenv.mkDerivation ({
131132
"-DCOMPILER_RT_ENABLE_IOS=OFF"
132133
]) ++ lib.optionals (lib.versionAtLeast version "19" && stdenv.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinMinVersion "10.13") [
133134
"-DSANITIZER_MIN_OSX_VERSION=10.10"
135+
] ++ lib.optionals (noSanitizers && lib.versionAtLeast release_version "19") [
136+
"-DCOMPILER_RT_BUILD_CTX_PROFILE=OFF"
134137
];
135138

136139
outputs = [ "out" "dev" ];

0 commit comments

Comments
 (0)