summary refs log tree commit diff
path: root/pkgs/development/compilers/llvm
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2022-08-01 16:11:33 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2022-08-01 12:18:54 -0400
commitbf39e322721e581f972a14e18310797260f7f35f (patch)
treefcbf249a39cb16b7ebe7a794a18aafb47fbae39c /pkgs/development/compilers/llvm
parent02077da0940754de1c25edff6eedd1df3e564d1f (diff)
downloadnixpkgs-bf39e322721e581f972a14e18310797260f7f35f.tar
nixpkgs-bf39e322721e581f972a14e18310797260f7f35f.tar.gz
nixpkgs-bf39e322721e581f972a14e18310797260f7f35f.tar.bz2
nixpkgs-bf39e322721e581f972a14e18310797260f7f35f.tar.lz
nixpkgs-bf39e322721e581f972a14e18310797260f7f35f.tar.xz
nixpkgs-bf39e322721e581f972a14e18310797260f7f35f.tar.zst
nixpkgs-bf39e322721e581f972a14e18310797260f7f35f.zip
compiler-rt: Fix "bare metal" case boolean logic
It is possible to both be bare metal and have a libc (newlib).

This libc doesn't provide very much --- not enough for CMake to think
the C toolchain works. We therefore adjust our logic so we hit the "bare
metal" case with or without libc.

The "use LLVM" bootstrap is intentionally not affected.
Diffstat (limited to 'pkgs/development/compilers/llvm')
-rw-r--r--pkgs/development/compilers/llvm/12/compiler-rt/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/13/compiler-rt/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/14/compiler-rt/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/git/compiler-rt/default.nix2
4 files changed, 4 insertions, 4 deletions
diff --git a/pkgs/development/compilers/llvm/12/compiler-rt/default.nix b/pkgs/development/compilers/llvm/12/compiler-rt/default.nix
index 4b2907ed307..d1497e6db1e 100644
--- a/pkgs/development/compilers/llvm/12/compiler-rt/default.nix
+++ b/pkgs/development/compilers/llvm/12/compiler-rt/default.nix
@@ -31,7 +31,7 @@ stdenv.mkDerivation {
     "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF"
     "-DCOMPILER_RT_BUILD_PROFILE=OFF"
     "-DCOMPILER_RT_BUILD_MEMPROF=OFF"
-  ] ++ lib.optionals ((useLLVM || bareMetal) && !haveLibc) [
+  ] ++ lib.optionals ((useLLVM && !haveLibc) || bareMetal) [
     "-DCMAKE_C_COMPILER_WORKS=ON"
     "-DCMAKE_CXX_COMPILER_WORKS=ON"
     "-DCOMPILER_RT_BAREMETAL_BUILD=ON"
diff --git a/pkgs/development/compilers/llvm/13/compiler-rt/default.nix b/pkgs/development/compilers/llvm/13/compiler-rt/default.nix
index 10b89b91b96..7b9312eecf2 100644
--- a/pkgs/development/compilers/llvm/13/compiler-rt/default.nix
+++ b/pkgs/development/compilers/llvm/13/compiler-rt/default.nix
@@ -35,7 +35,7 @@ stdenv.mkDerivation {
     "-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) [
+  ] ++ lib.optionals ((useLLVM && !haveLibc) || bareMetal) [
     "-DCMAKE_C_COMPILER_WORKS=ON"
     "-DCMAKE_CXX_COMPILER_WORKS=ON"
     "-DCOMPILER_RT_BAREMETAL_BUILD=ON"
diff --git a/pkgs/development/compilers/llvm/14/compiler-rt/default.nix b/pkgs/development/compilers/llvm/14/compiler-rt/default.nix
index cddfd5c2380..508b9466e7b 100644
--- a/pkgs/development/compilers/llvm/14/compiler-rt/default.nix
+++ b/pkgs/development/compilers/llvm/14/compiler-rt/default.nix
@@ -44,7 +44,7 @@ stdenv.mkDerivation {
     "-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) [
+  ] ++ lib.optionals ((useLLVM && !haveLibc) || bareMetal) [
     "-DCMAKE_C_COMPILER_WORKS=ON"
     "-DCMAKE_CXX_COMPILER_WORKS=ON"
     "-DCOMPILER_RT_BAREMETAL_BUILD=ON"
diff --git a/pkgs/development/compilers/llvm/git/compiler-rt/default.nix b/pkgs/development/compilers/llvm/git/compiler-rt/default.nix
index 59ca5348fed..cc1a8dc0481 100644
--- a/pkgs/development/compilers/llvm/git/compiler-rt/default.nix
+++ b/pkgs/development/compilers/llvm/git/compiler-rt/default.nix
@@ -44,7 +44,7 @@ stdenv.mkDerivation {
     "-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) [
+  ] ++ lib.optionals ((useLLVM && !haveLibc) || bareMetal) [
     "-DCMAKE_C_COMPILER_WORKS=ON"
     "-DCMAKE_CXX_COMPILER_WORKS=ON"
     "-DCOMPILER_RT_BAREMETAL_BUILD=ON"