From e9fb64a5d43c27beaaf719fa6f0489082a40a393 Mon Sep 17 00:00:00 2001 From: Yureka Date: Mon, 15 Aug 2022 11:49:43 +0200 Subject: [PATCH 1/2] llvm 14 compiler-rt: enable libclang_rt.profile-....a build --- pkgs/development/compilers/llvm/14/compiler-rt/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/llvm/14/compiler-rt/default.nix b/pkgs/development/compilers/llvm/14/compiler-rt/default.nix index cc1a8dc0481f7..28c77d5ffb39f 100644 --- a/pkgs/development/compilers/llvm/14/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/14/compiler-rt/default.nix @@ -41,9 +41,10 @@ stdenv.mkDerivation { "-DCOMPILER_RT_BUILD_SANITIZERS=OFF" "-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) [ + "-DCOMPILER_RT_BUILD_PROFILE=OFF" ] ++ lib.optionals ((useLLVM && !haveLibc) || bareMetal) [ "-DCMAKE_C_COMPILER_WORKS=ON" "-DCMAKE_CXX_COMPILER_WORKS=ON" From 89b13b7f8d483e221f62972a639eb7eceb1cb2ed Mon Sep 17 00:00:00 2001 From: Yureka Date: Mon, 15 Aug 2022 11:50:47 +0200 Subject: [PATCH 2/2] llvm 14 lld: build with 2M stack size to fix firefox lto --- pkgs/development/compilers/llvm/14/lld/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/compilers/llvm/14/lld/default.nix b/pkgs/development/compilers/llvm/14/lld/default.nix index 1ae6d4ea6fceb..2e0d893c7febe 100644 --- a/pkgs/development/compilers/llvm/14/lld/default.nix +++ b/pkgs/development/compilers/llvm/14/lld/default.nix @@ -37,6 +37,7 @@ stdenv.mkDerivation rec { cmakeFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" ]; + LDFLAGS = lib.optionalString stdenv.hostPlatform.isMusl "-Wl,-z,stack-size=2097152"; outputs = [ "out" "lib" "dev" ];