llvmPackages_git.compiler-rt: disable building ctx_profile when build sanitizers are disabled (#332918)

This commit is contained in:
Artturin 2024-09-07 17:42:49 +03:00 committed by GitHub
commit d1f2bc2931
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -39,6 +39,7 @@ let
haveLibcxx = stdenv.cc.libcxx != null; haveLibcxx = stdenv.cc.libcxx != null;
isDarwinStatic = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isStatic && lib.versionAtLeast release_version "16"; isDarwinStatic = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isStatic && lib.versionAtLeast release_version "16";
inherit (stdenv.hostPlatform) isMusl isAarch64; inherit (stdenv.hostPlatform) isMusl isAarch64;
noSanitizers = !haveLibc || bareMetal || isMusl || isDarwinStatic;
baseName = "compiler-rt"; baseName = "compiler-rt";
pname = baseName + lib.optionalString (haveLibc) "-libc"; pname = baseName + lib.optionalString (haveLibc) "-libc";
@ -94,7 +95,7 @@ stdenv.mkDerivation ({
"-DCOMPILER_RT_BUILD_LIBFUZZER=OFF" "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF"
] ++ lib.optionals (useLLVM && haveLibc) [ ] ++ lib.optionals (useLLVM && haveLibc) [
"-DCOMPILER_RT_BUILD_SANITIZERS=ON" "-DCOMPILER_RT_BUILD_SANITIZERS=ON"
] ++ lib.optionals (!haveLibc || bareMetal || isMusl || isDarwinStatic) [ ] ++ lib.optionals (noSanitizers) [
"-DCOMPILER_RT_BUILD_SANITIZERS=OFF" "-DCOMPILER_RT_BUILD_SANITIZERS=OFF"
] ++ lib.optionals ((useLLVM && !haveLibcxx) || !haveLibc || bareMetal || isMusl || isDarwinStatic) [ ] ++ lib.optionals ((useLLVM && !haveLibcxx) || !haveLibc || bareMetal || isMusl || isDarwinStatic) [
"-DCOMPILER_RT_BUILD_XRAY=OFF" "-DCOMPILER_RT_BUILD_XRAY=OFF"
@ -131,6 +132,8 @@ stdenv.mkDerivation ({
"-DCOMPILER_RT_ENABLE_IOS=OFF" "-DCOMPILER_RT_ENABLE_IOS=OFF"
]) ++ lib.optionals (lib.versionAtLeast version "19" && stdenv.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinMinVersion "10.13") [ ]) ++ lib.optionals (lib.versionAtLeast version "19" && stdenv.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinMinVersion "10.13") [
"-DSANITIZER_MIN_OSX_VERSION=10.10" "-DSANITIZER_MIN_OSX_VERSION=10.10"
] ++ lib.optionals (noSanitizers && lib.versionAtLeast release_version "19") [
"-DCOMPILER_RT_BUILD_CTX_PROFILE=OFF"
]; ];
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];