From 6c6f4a97242017ada74071f947e6538d353d62b2 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Sat, 3 Sep 2022 15:44:53 +0200 Subject: [PATCH 1/2] llvm*: Fix core usage in tests lit (LLVM Integrated Tester) [0] by default uses as many threads as the build host has cores, ignoring the user's core settings for the build. This passes the configured core count on to lit, along with LLVM's default settings for it which we otherwise override in the process [1]. [0]: https://www.llvm.org/docs/CommandGuide/lit.html [1]: https://github.com/llvm/llvm-project/blob/329fda39c507e8740978d10458451dcdb21563be/llvm/CMakeLists.txt#L559-L565 --- pkgs/development/compilers/llvm/10/llvm/default.nix | 1 + pkgs/development/compilers/llvm/11/llvm/default.nix | 1 + pkgs/development/compilers/llvm/12/llvm/default.nix | 1 + pkgs/development/compilers/llvm/13/llvm/default.nix | 1 + pkgs/development/compilers/llvm/14/llvm/default.nix | 1 + pkgs/development/compilers/llvm/5/llvm/default.nix | 1 + pkgs/development/compilers/llvm/6/llvm/default.nix | 1 + pkgs/development/compilers/llvm/7/llvm/default.nix | 1 + pkgs/development/compilers/llvm/8/llvm/default.nix | 1 + pkgs/development/compilers/llvm/9/llvm/default.nix | 1 + pkgs/development/compilers/llvm/git/llvm/default.nix | 1 + 11 files changed, 11 insertions(+) diff --git a/pkgs/development/compilers/llvm/10/llvm/default.nix b/pkgs/development/compilers/llvm/10/llvm/default.nix index bb1b90b36a92..64e000fefdfd 100644 --- a/pkgs/development/compilers/llvm/10/llvm/default.nix +++ b/pkgs/development/compilers/llvm/10/llvm/default.nix @@ -179,6 +179,7 @@ in stdenv.mkDerivation (rec { "-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_ENABLE_DUMP=ON" + "-DLLVM_LIT_ARGS=-svj\${NIX_BUILD_CORES}" ] ++ optionals enableManpages [ "-DLLVM_BUILD_DOCS=ON" "-DLLVM_ENABLE_SPHINX=ON" diff --git a/pkgs/development/compilers/llvm/11/llvm/default.nix b/pkgs/development/compilers/llvm/11/llvm/default.nix index a038795a4df1..214d6b05caff 100644 --- a/pkgs/development/compilers/llvm/11/llvm/default.nix +++ b/pkgs/development/compilers/llvm/11/llvm/default.nix @@ -181,6 +181,7 @@ in stdenv.mkDerivation (rec { "-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_ENABLE_DUMP=ON" + "-DLLVM_LIT_ARGS=-svj\${NIX_BUILD_CORES}" ] ++ optionals stdenv.hostPlatform.isStatic [ # Disables building of shared libs, -fPIC is still injected by cc-wrapper "-DLLVM_ENABLE_PIC=OFF" diff --git a/pkgs/development/compilers/llvm/12/llvm/default.nix b/pkgs/development/compilers/llvm/12/llvm/default.nix index 435744b073f7..3428a1aa27c3 100644 --- a/pkgs/development/compilers/llvm/12/llvm/default.nix +++ b/pkgs/development/compilers/llvm/12/llvm/default.nix @@ -171,6 +171,7 @@ in stdenv.mkDerivation (rec { "-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_ENABLE_DUMP=ON" + "-DLLVM_LIT_ARGS=-svj\${NIX_BUILD_CORES}" ] ++ optionals stdenv.hostPlatform.isStatic [ # Disables building of shared libs, -fPIC is still injected by cc-wrapper "-DLLVM_ENABLE_PIC=OFF" diff --git a/pkgs/development/compilers/llvm/13/llvm/default.nix b/pkgs/development/compilers/llvm/13/llvm/default.nix index 6372655b7ed4..8ab3cd74c56f 100644 --- a/pkgs/development/compilers/llvm/13/llvm/default.nix +++ b/pkgs/development/compilers/llvm/13/llvm/default.nix @@ -133,6 +133,7 @@ in stdenv.mkDerivation (rec { "-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_ENABLE_DUMP=ON" + "-DLLVM_LIT_ARGS=-svj\${NIX_BUILD_CORES}" ] ++ optionals stdenv.hostPlatform.isStatic [ # Disables building of shared libs, -fPIC is still injected by cc-wrapper "-DLLVM_ENABLE_PIC=OFF" diff --git a/pkgs/development/compilers/llvm/14/llvm/default.nix b/pkgs/development/compilers/llvm/14/llvm/default.nix index 395f2b22b964..689358372ba3 100644 --- a/pkgs/development/compilers/llvm/14/llvm/default.nix +++ b/pkgs/development/compilers/llvm/14/llvm/default.nix @@ -144,6 +144,7 @@ in stdenv.mkDerivation (rec { "-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_ENABLE_DUMP=ON" + "-DLLVM_LIT_ARGS=-svj\${NIX_BUILD_CORES}" ] ++ optionals stdenv.hostPlatform.isStatic [ # Disables building of shared libs, -fPIC is still injected by cc-wrapper "-DLLVM_ENABLE_PIC=OFF" diff --git a/pkgs/development/compilers/llvm/5/llvm/default.nix b/pkgs/development/compilers/llvm/5/llvm/default.nix index cf668cd566a6..720268e34afb 100644 --- a/pkgs/development/compilers/llvm/5/llvm/default.nix +++ b/pkgs/development/compilers/llvm/5/llvm/default.nix @@ -154,6 +154,7 @@ stdenv.mkDerivation (rec { "-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}" "-DTARGET_TRIPLE=${stdenv.hostPlatform.config}" + "-DLLVM_LIT_ARGS=-svj\${NIX_BUILD_CORES}" ] ++ lib.optionals enableManpages [ "-DLLVM_BUILD_DOCS=ON" diff --git a/pkgs/development/compilers/llvm/6/llvm/default.nix b/pkgs/development/compilers/llvm/6/llvm/default.nix index 61f9234274d3..7bb82a999191 100644 --- a/pkgs/development/compilers/llvm/6/llvm/default.nix +++ b/pkgs/development/compilers/llvm/6/llvm/default.nix @@ -149,6 +149,7 @@ stdenv.mkDerivation (rec { "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly" "-DLLVM_ENABLE_DUMP=ON" + "-DLLVM_LIT_ARGS=-svj\${NIX_BUILD_CORES}" ] ++ optionals enableManpages [ "-DLLVM_BUILD_DOCS=ON" "-DLLVM_ENABLE_SPHINX=ON" diff --git a/pkgs/development/compilers/llvm/7/llvm/default.nix b/pkgs/development/compilers/llvm/7/llvm/default.nix index b324e1a0e4d6..5237d4383183 100644 --- a/pkgs/development/compilers/llvm/7/llvm/default.nix +++ b/pkgs/development/compilers/llvm/7/llvm/default.nix @@ -168,6 +168,7 @@ in stdenv.mkDerivation (rec { "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly" "-DLLVM_ENABLE_DUMP=ON" + "-DLLVM_LIT_ARGS=-svj\${NIX_BUILD_CORES}" ] ++ optionals enableManpages [ "-DLLVM_BUILD_DOCS=ON" "-DLLVM_ENABLE_SPHINX=ON" diff --git a/pkgs/development/compilers/llvm/8/llvm/default.nix b/pkgs/development/compilers/llvm/8/llvm/default.nix index efd1707eb337..383be10a17a6 100644 --- a/pkgs/development/compilers/llvm/8/llvm/default.nix +++ b/pkgs/development/compilers/llvm/8/llvm/default.nix @@ -161,6 +161,7 @@ in stdenv.mkDerivation (rec { "-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_ENABLE_DUMP=ON" + "-DLLVM_LIT_ARGS=-svj\${NIX_BUILD_CORES}" ] ++ optionals enableManpages [ "-DLLVM_BUILD_DOCS=ON" "-DLLVM_ENABLE_SPHINX=ON" diff --git a/pkgs/development/compilers/llvm/9/llvm/default.nix b/pkgs/development/compilers/llvm/9/llvm/default.nix index 1dd1455ed6d6..1d9dfca7f142 100644 --- a/pkgs/development/compilers/llvm/9/llvm/default.nix +++ b/pkgs/development/compilers/llvm/9/llvm/default.nix @@ -176,6 +176,7 @@ in stdenv.mkDerivation (rec { "-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_ENABLE_DUMP=ON" + "-DLLVM_LIT_ARGS=-svj\${NIX_BUILD_CORES}" ] ++ optionals enableManpages [ "-DLLVM_BUILD_DOCS=ON" "-DLLVM_ENABLE_SPHINX=ON" diff --git a/pkgs/development/compilers/llvm/git/llvm/default.nix b/pkgs/development/compilers/llvm/git/llvm/default.nix index fe6d650cdcd5..d161e664643f 100644 --- a/pkgs/development/compilers/llvm/git/llvm/default.nix +++ b/pkgs/development/compilers/llvm/git/llvm/default.nix @@ -130,6 +130,7 @@ in stdenv.mkDerivation (rec { "-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_ENABLE_DUMP=ON" + "-DLLVM_LIT_ARGS=-svj\${NIX_BUILD_CORES}" ] ++ optionals stdenv.hostPlatform.isStatic [ # Disables building of shared libs, -fPIC is still injected by cc-wrapper "-DLLVM_ENABLE_PIC=OFF" From bd332c848c521de8cdaf664ce307e914c5e5987d Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Sat, 3 Sep 2022 17:14:18 +0200 Subject: [PATCH 2/2] llvm*: Don't show progress bar on tests Since the progress bar results in large output that is broken due to the use of ncurses and we already use the flag that gives verbose output on test failures, let's just disable the progress bar. --- pkgs/development/compilers/llvm/10/llvm/default.nix | 8 +++++++- pkgs/development/compilers/llvm/11/llvm/default.nix | 8 +++++++- pkgs/development/compilers/llvm/12/llvm/default.nix | 8 +++++++- pkgs/development/compilers/llvm/13/llvm/default.nix | 8 +++++++- pkgs/development/compilers/llvm/14/llvm/default.nix | 8 +++++++- pkgs/development/compilers/llvm/5/llvm/default.nix | 8 +++++++- pkgs/development/compilers/llvm/6/llvm/default.nix | 8 +++++++- pkgs/development/compilers/llvm/7/llvm/default.nix | 8 +++++++- pkgs/development/compilers/llvm/8/llvm/default.nix | 8 +++++++- pkgs/development/compilers/llvm/9/llvm/default.nix | 8 +++++++- pkgs/development/compilers/llvm/git/llvm/default.nix | 8 +++++++- 11 files changed, 77 insertions(+), 11 deletions(-) diff --git a/pkgs/development/compilers/llvm/10/llvm/default.nix b/pkgs/development/compilers/llvm/10/llvm/default.nix index 64e000fefdfd..78b0adcaadfb 100644 --- a/pkgs/development/compilers/llvm/10/llvm/default.nix +++ b/pkgs/development/compilers/llvm/10/llvm/default.nix @@ -151,6 +151,13 @@ in stdenv.mkDerivation (rec { done ''; + preConfigure = '' + # Workaround for configure flags that need to have spaces + cmakeFlagsArray+=( + -DLLVM_LIT_ARGS='-svj''${NIX_BUILD_CORES} --no-progress-bar' + ) + ''; + # hacky fix: created binaries need to be run before installation preBuild = '' mkdir -p $out/ @@ -179,7 +186,6 @@ in stdenv.mkDerivation (rec { "-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_ENABLE_DUMP=ON" - "-DLLVM_LIT_ARGS=-svj\${NIX_BUILD_CORES}" ] ++ optionals enableManpages [ "-DLLVM_BUILD_DOCS=ON" "-DLLVM_ENABLE_SPHINX=ON" diff --git a/pkgs/development/compilers/llvm/11/llvm/default.nix b/pkgs/development/compilers/llvm/11/llvm/default.nix index 214d6b05caff..1623d06c7f7a 100644 --- a/pkgs/development/compilers/llvm/11/llvm/default.nix +++ b/pkgs/development/compilers/llvm/11/llvm/default.nix @@ -150,6 +150,13 @@ in stdenv.mkDerivation (rec { done ''; + preConfigure = '' + # Workaround for configure flags that need to have spaces + cmakeFlagsArray+=( + -DLLVM_LIT_ARGS='-svj''${NIX_BUILD_CORES} --no-progress-bar' + ) + ''; + # hacky fix: created binaries need to be run before installation preBuild = '' mkdir -p $out/ @@ -181,7 +188,6 @@ in stdenv.mkDerivation (rec { "-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_ENABLE_DUMP=ON" - "-DLLVM_LIT_ARGS=-svj\${NIX_BUILD_CORES}" ] ++ optionals stdenv.hostPlatform.isStatic [ # Disables building of shared libs, -fPIC is still injected by cc-wrapper "-DLLVM_ENABLE_PIC=OFF" diff --git a/pkgs/development/compilers/llvm/12/llvm/default.nix b/pkgs/development/compilers/llvm/12/llvm/default.nix index 3428a1aa27c3..d330b7387595 100644 --- a/pkgs/development/compilers/llvm/12/llvm/default.nix +++ b/pkgs/development/compilers/llvm/12/llvm/default.nix @@ -140,6 +140,13 @@ in stdenv.mkDerivation (rec { done ''; + preConfigure = '' + # Workaround for configure flags that need to have spaces + cmakeFlagsArray+=( + -DLLVM_LIT_ARGS='-svj''${NIX_BUILD_CORES} --no-progress-bar' + ) + ''; + # hacky fix: created binaries need to be run before installation preBuild = '' mkdir -p $out/ @@ -171,7 +178,6 @@ in stdenv.mkDerivation (rec { "-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_ENABLE_DUMP=ON" - "-DLLVM_LIT_ARGS=-svj\${NIX_BUILD_CORES}" ] ++ optionals stdenv.hostPlatform.isStatic [ # Disables building of shared libs, -fPIC is still injected by cc-wrapper "-DLLVM_ENABLE_PIC=OFF" diff --git a/pkgs/development/compilers/llvm/13/llvm/default.nix b/pkgs/development/compilers/llvm/13/llvm/default.nix index 8ab3cd74c56f..5b8ec69853f2 100644 --- a/pkgs/development/compilers/llvm/13/llvm/default.nix +++ b/pkgs/development/compilers/llvm/13/llvm/default.nix @@ -102,6 +102,13 @@ in stdenv.mkDerivation (rec { patchShebangs test/BugPoint/compile-custom.ll.py ''; + preConfigure = '' + # Workaround for configure flags that need to have spaces + cmakeFlagsArray+=( + -DLLVM_LIT_ARGS='-svj''${NIX_BUILD_CORES} --no-progress-bar' + ) + ''; + # hacky fix: created binaries need to be run before installation preBuild = '' mkdir -p $out/ @@ -133,7 +140,6 @@ in stdenv.mkDerivation (rec { "-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_ENABLE_DUMP=ON" - "-DLLVM_LIT_ARGS=-svj\${NIX_BUILD_CORES}" ] ++ optionals stdenv.hostPlatform.isStatic [ # Disables building of shared libs, -fPIC is still injected by cc-wrapper "-DLLVM_ENABLE_PIC=OFF" diff --git a/pkgs/development/compilers/llvm/14/llvm/default.nix b/pkgs/development/compilers/llvm/14/llvm/default.nix index 689358372ba3..191f465be6c9 100644 --- a/pkgs/development/compilers/llvm/14/llvm/default.nix +++ b/pkgs/development/compilers/llvm/14/llvm/default.nix @@ -113,6 +113,13 @@ in stdenv.mkDerivation (rec { patchShebangs test/BugPoint/compile-custom.ll.py ''; + preConfigure = '' + # Workaround for configure flags that need to have spaces + cmakeFlagsArray+=( + -DLLVM_LIT_ARGS='-svj''${NIX_BUILD_CORES} --no-progress-bar' + ) + ''; + # hacky fix: created binaries need to be run before installation preBuild = '' mkdir -p $out/ @@ -144,7 +151,6 @@ in stdenv.mkDerivation (rec { "-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_ENABLE_DUMP=ON" - "-DLLVM_LIT_ARGS=-svj\${NIX_BUILD_CORES}" ] ++ optionals stdenv.hostPlatform.isStatic [ # Disables building of shared libs, -fPIC is still injected by cc-wrapper "-DLLVM_ENABLE_PIC=OFF" diff --git a/pkgs/development/compilers/llvm/5/llvm/default.nix b/pkgs/development/compilers/llvm/5/llvm/default.nix index 720268e34afb..a4d04f0618c7 100644 --- a/pkgs/development/compilers/llvm/5/llvm/default.nix +++ b/pkgs/development/compilers/llvm/5/llvm/default.nix @@ -125,6 +125,13 @@ stdenv.mkDerivation (rec { done ''; + preConfigure = '' + # Workaround for configure flags that need to have spaces + cmakeFlagsArray+=( + -DLLVM_LIT_ARGS='-svj''${NIX_BUILD_CORES} --no-progress-bar' + ) + ''; + # hacky fix: created binaries need to be run before installation preBuild = '' mkdir -p $out/ @@ -154,7 +161,6 @@ stdenv.mkDerivation (rec { "-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}" "-DTARGET_TRIPLE=${stdenv.hostPlatform.config}" - "-DLLVM_LIT_ARGS=-svj\${NIX_BUILD_CORES}" ] ++ lib.optionals enableManpages [ "-DLLVM_BUILD_DOCS=ON" diff --git a/pkgs/development/compilers/llvm/6/llvm/default.nix b/pkgs/development/compilers/llvm/6/llvm/default.nix index 7bb82a999191..d18bf2149e1d 100644 --- a/pkgs/development/compilers/llvm/6/llvm/default.nix +++ b/pkgs/development/compilers/llvm/6/llvm/default.nix @@ -120,6 +120,13 @@ stdenv.mkDerivation (rec { done ''; + preConfigure = '' + # Workaround for configure flags that need to have spaces + cmakeFlagsArray+=( + -DLLVM_LIT_ARGS='-svj''${NIX_BUILD_CORES} --no-progress-bar' + ) + ''; + # hacky fix: created binaries need to be run before installation preBuild = '' mkdir -p $out/ @@ -149,7 +156,6 @@ stdenv.mkDerivation (rec { "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly" "-DLLVM_ENABLE_DUMP=ON" - "-DLLVM_LIT_ARGS=-svj\${NIX_BUILD_CORES}" ] ++ optionals enableManpages [ "-DLLVM_BUILD_DOCS=ON" "-DLLVM_ENABLE_SPHINX=ON" diff --git a/pkgs/development/compilers/llvm/7/llvm/default.nix b/pkgs/development/compilers/llvm/7/llvm/default.nix index 5237d4383183..1aa85f543ea2 100644 --- a/pkgs/development/compilers/llvm/7/llvm/default.nix +++ b/pkgs/development/compilers/llvm/7/llvm/default.nix @@ -139,6 +139,13 @@ in stdenv.mkDerivation (rec { done ''; + preConfigure = '' + # Workaround for configure flags that need to have spaces + cmakeFlagsArray+=( + -DLLVM_LIT_ARGS='-svj''${NIX_BUILD_CORES} --no-progress-bar' + ) + ''; + # hacky fix: created binaries need to be run before installation preBuild = '' mkdir -p $out/ @@ -168,7 +175,6 @@ in stdenv.mkDerivation (rec { "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly" "-DLLVM_ENABLE_DUMP=ON" - "-DLLVM_LIT_ARGS=-svj\${NIX_BUILD_CORES}" ] ++ optionals enableManpages [ "-DLLVM_BUILD_DOCS=ON" "-DLLVM_ENABLE_SPHINX=ON" diff --git a/pkgs/development/compilers/llvm/8/llvm/default.nix b/pkgs/development/compilers/llvm/8/llvm/default.nix index 383be10a17a6..3e01c7ac9ca1 100644 --- a/pkgs/development/compilers/llvm/8/llvm/default.nix +++ b/pkgs/development/compilers/llvm/8/llvm/default.nix @@ -133,6 +133,13 @@ in stdenv.mkDerivation (rec { done ''; + preConfigure = '' + # Workaround for configure flags that need to have spaces + cmakeFlagsArray+=( + -DLLVM_LIT_ARGS='-svj''${NIX_BUILD_CORES} --no-progress-bar' + ) + ''; + # hacky fix: created binaries need to be run before installation preBuild = '' mkdir -p $out/ @@ -161,7 +168,6 @@ in stdenv.mkDerivation (rec { "-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_ENABLE_DUMP=ON" - "-DLLVM_LIT_ARGS=-svj\${NIX_BUILD_CORES}" ] ++ optionals enableManpages [ "-DLLVM_BUILD_DOCS=ON" "-DLLVM_ENABLE_SPHINX=ON" diff --git a/pkgs/development/compilers/llvm/9/llvm/default.nix b/pkgs/development/compilers/llvm/9/llvm/default.nix index 1d9dfca7f142..6c0a37cadd90 100644 --- a/pkgs/development/compilers/llvm/9/llvm/default.nix +++ b/pkgs/development/compilers/llvm/9/llvm/default.nix @@ -148,6 +148,13 @@ in stdenv.mkDerivation (rec { done ''; + preConfigure = '' + # Workaround for configure flags that need to have spaces + cmakeFlagsArray+=( + -DLLVM_LIT_ARGS='-svj''${NIX_BUILD_CORES} --no-progress-bar' + ) + ''; + # hacky fix: created binaries need to be run before installation preBuild = '' mkdir -p $out/ @@ -176,7 +183,6 @@ in stdenv.mkDerivation (rec { "-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_ENABLE_DUMP=ON" - "-DLLVM_LIT_ARGS=-svj\${NIX_BUILD_CORES}" ] ++ optionals enableManpages [ "-DLLVM_BUILD_DOCS=ON" "-DLLVM_ENABLE_SPHINX=ON" diff --git a/pkgs/development/compilers/llvm/git/llvm/default.nix b/pkgs/development/compilers/llvm/git/llvm/default.nix index d161e664643f..656c226574a4 100644 --- a/pkgs/development/compilers/llvm/git/llvm/default.nix +++ b/pkgs/development/compilers/llvm/git/llvm/default.nix @@ -99,6 +99,13 @@ in stdenv.mkDerivation (rec { patchShebangs test/BugPoint/compile-custom.ll.py ''; + preConfigure = '' + # Workaround for configure flags that need to have spaces + cmakeFlagsArray+=( + -DLLVM_LIT_ARGS='-svj''${NIX_BUILD_CORES} --no-progress-bar' + ) + ''; + # hacky fix: created binaries need to be run before installation preBuild = '' mkdir -p $out/ @@ -130,7 +137,6 @@ in stdenv.mkDerivation (rec { "-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}" "-DLLVM_ENABLE_DUMP=ON" - "-DLLVM_LIT_ARGS=-svj\${NIX_BUILD_CORES}" ] ++ optionals stdenv.hostPlatform.isStatic [ # Disables building of shared libs, -fPIC is still injected by cc-wrapper "-DLLVM_ENABLE_PIC=OFF"