about summary refs log tree commit diff
path: root/pkgs/development/compilers/llvm/git
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-12-14 14:09:07 +0100
committerAlyssa Ross <hi@alyssa.is>2023-12-19 11:34:37 +0100
commit333088006cc26591250fd1e2b8cc972855aa9c4b (patch)
tree4f3c8e3dce9ea52896d1c32773f17b0a2bbae855 /pkgs/development/compilers/llvm/git
parent8b5ecc55e1801f3db13bde4d558c9a4a572530b0 (diff)
downloadnixlib-333088006cc26591250fd1e2b8cc972855aa9c4b.tar
nixlib-333088006cc26591250fd1e2b8cc972855aa9c4b.tar.gz
nixlib-333088006cc26591250fd1e2b8cc972855aa9c4b.tar.bz2
nixlib-333088006cc26591250fd1e2b8cc972855aa9c4b.tar.lz
nixlib-333088006cc26591250fd1e2b8cc972855aa9c4b.tar.xz
nixlib-333088006cc26591250fd1e2b8cc972855aa9c4b.tar.zst
nixlib-333088006cc26591250fd1e2b8cc972855aa9c4b.zip
pkgsLLVM.llvmPackages.compiler-rt: fix for RISC-V
compiler-rt includes <linux/unistd.h> on RISC-V.  This only seems to
be necessary for useLLVM, but looking at the source code I can't
see any reason for that, so probably in the non-useLLVM case it just
gets propagated in.
Diffstat (limited to 'pkgs/development/compilers/llvm/git')
-rw-r--r--pkgs/development/compilers/llvm/git/compiler-rt/default.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkgs/development/compilers/llvm/git/compiler-rt/default.nix b/pkgs/development/compilers/llvm/git/compiler-rt/default.nix
index 7add8fab0f91..808df140e772 100644
--- a/pkgs/development/compilers/llvm/git/compiler-rt/default.nix
+++ b/pkgs/development/compilers/llvm/git/compiler-rt/default.nix
@@ -1,6 +1,6 @@
 { lib, stdenv, llvm_meta, version
 , monorepoSrc, runCommand
-, cmake, ninja, python3, xcbuild, libllvm, libcxxabi, libxcrypt
+, cmake, ninja, python3, xcbuild, libllvm, linuxHeaders, libcxxabi, libxcrypt
 , doFakeLibgcc ? stdenv.hostPlatform.isFreeBSD
 }:
 
@@ -30,7 +30,9 @@ stdenv.mkDerivation {
 
   nativeBuildInputs = [ cmake ninja python3 libllvm.dev ]
     ++ lib.optional stdenv.isDarwin xcbuild.xcrun;
-  buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi;
+  buildInputs =
+    lib.optional (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isRiscV) linuxHeaders
+    ++ lib.optional stdenv.hostPlatform.isDarwin libcxxabi;
 
   env.NIX_CFLAGS_COMPILE = toString ([
     "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0"