From 115a6f077fc29e7dc846618be86ece84c6d6aea7 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Tue, 4 Jan 2022 12:30:40 +0100 Subject: [PATCH] llvmPackages_{12,13,git}.compiler-rt: remove new runtimes in useLLVM LLVM 12 added the memory profiling runtime and LLVM 13 the ORC runtime. Both need a libc in order to build (or at least headers not present in clang's resource root), so we'll disable them for any sort of baremetal-ish build. memprof likely doesn't work in a baremetal situation at all, orc is unknown. Whether both would compile with musl is to be checked. --- pkgs/development/compilers/llvm/12/compiler-rt/default.nix | 1 + pkgs/development/compilers/llvm/13/compiler-rt/default.nix | 2 ++ pkgs/development/compilers/llvm/git/compiler-rt/default.nix | 2 ++ 3 files changed, 5 insertions(+) diff --git a/pkgs/development/compilers/llvm/12/compiler-rt/default.nix b/pkgs/development/compilers/llvm/12/compiler-rt/default.nix index 13c611ca8cc6..4b2907ed3078 100644 --- a/pkgs/development/compilers/llvm/12/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/12/compiler-rt/default.nix @@ -30,6 +30,7 @@ stdenv.mkDerivation { "-DCOMPILER_RT_BUILD_XRAY=OFF" "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF" "-DCOMPILER_RT_BUILD_PROFILE=OFF" + "-DCOMPILER_RT_BUILD_MEMPROF=OFF" ] ++ lib.optionals ((useLLVM || bareMetal) && !haveLibc) [ "-DCMAKE_C_COMPILER_WORKS=ON" "-DCMAKE_CXX_COMPILER_WORKS=ON" diff --git a/pkgs/development/compilers/llvm/13/compiler-rt/default.nix b/pkgs/development/compilers/llvm/13/compiler-rt/default.nix index e30db5fcd954..10b89b91b96f 100644 --- a/pkgs/development/compilers/llvm/13/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/13/compiler-rt/default.nix @@ -33,6 +33,8 @@ stdenv.mkDerivation { "-DCOMPILER_RT_BUILD_SANITIZERS=OFF" "-DCOMPILER_RT_BUILD_XRAY=OFF" "-DCOMPILER_RT_BUILD_PROFILE=OFF" + "-DCOMPILER_RT_BUILD_MEMPROF=OFF" + "-DCOMPILER_RT_BUILD_ORC=OFF" # may be possible to build with musl if necessary ] ++ lib.optionals ((useLLVM || bareMetal) && !haveLibc) [ "-DCMAKE_C_COMPILER_WORKS=ON" "-DCMAKE_CXX_COMPILER_WORKS=ON" diff --git a/pkgs/development/compilers/llvm/git/compiler-rt/default.nix b/pkgs/development/compilers/llvm/git/compiler-rt/default.nix index 5874a91e03c8..019148039d17 100644 --- a/pkgs/development/compilers/llvm/git/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/git/compiler-rt/default.nix @@ -32,6 +32,8 @@ stdenv.mkDerivation { "-DCOMPILER_RT_BUILD_XRAY=OFF" "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF" "-DCOMPILER_RT_BUILD_PROFILE=OFF" + "-DCOMPILER_RT_BUILD_MEMPROF=OFF" + "-DCOMPILER_RT_BUILD_ORC=OFF" # may be possible to build with musl if necessary ] ++ lib.optionals ((useLLVM || bareMetal) && !haveLibc) [ "-DCMAKE_C_COMPILER_WORKS=ON" "-DCMAKE_CXX_COMPILER_WORKS=ON"