From 228dab381b257b2e1ea478cc2e325164a9fcdcdd Mon Sep 17 00:00:00 2001 From: Tristan Ross Date: Sat, 29 Mar 2025 23:22:44 -0700 Subject: [PATCH] llvmPackages_{12,13,14,15,16,17,18,19,20,git}.compiler-rt: condense cmake flags --- .../compilers/llvm/common/compiler-rt/default.nix | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pkgs/development/compilers/llvm/common/compiler-rt/default.nix b/pkgs/development/compilers/llvm/common/compiler-rt/default.nix index 60f050bb2530..3569d15c41d3 100644 --- a/pkgs/development/compilers/llvm/common/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/common/compiler-rt/default.nix @@ -188,6 +188,7 @@ stdenv.mkDerivation (finalAttrs: { ] ++ lib.optionals (useLLVM && haveLibc) [ (lib.cmakeBool "COMPILER_RT_BUILD_SANITIZERS" true) + (lib.cmakeBool "COMPILER_RT_BUILD_PROFILE" true) ] ++ lib.optionals (noSanitizers) [ (lib.cmakeBool "COMPILER_RT_BUILD_SANITIZERS" false) @@ -198,20 +199,15 @@ stdenv.mkDerivation (finalAttrs: { (lib.cmakeBool "COMPILER_RT_BUILD_MEMPROF" false) (lib.cmakeBool "COMPILER_RT_BUILD_ORC" false) # may be possible to build with musl if necessary ] - ++ lib.optionals (useLLVM && haveLibc) [ - (lib.cmakeBool "COMPILER_RT_BUILD_PROFILE" true) - ] ++ lib.optionals (!haveLibc || bareMetal) [ (lib.cmakeBool "COMPILER_RT_BUILD_PROFILE" false) - ] - ++ lib.optionals (!haveLibc || bareMetal || isDarwinStatic) [ - (lib.cmakeBool "CMAKE_CXX_COMPILER_WORKS" true) - ] - ++ lib.optionals (!haveLibc || bareMetal) [ (lib.cmakeBool "CMAKE_C_COMPILER_WORKS" true) (lib.cmakeBool "COMPILER_RT_BAREMETAL_BUILD" true) (lib.cmakeFeature "CMAKE_SIZEOF_VOID_P" (toString (stdenv.hostPlatform.parsed.cpu.bits / 8))) ] + ++ lib.optionals (!haveLibc || bareMetal || isDarwinStatic) [ + (lib.cmakeBool "CMAKE_CXX_COMPILER_WORKS" true) + ] ++ lib.optionals (!haveLibc) [ (lib.cmakeFeature "CMAKE_C_FLAGS" "-nodefaultlibs") ]