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.
This commit is contained in:
Alyssa Ross 2023-12-14 14:09:07 +01:00
parent 8b5ecc55e1
commit 333088006c
7 changed files with 30 additions and 14 deletions

View file

@ -1,4 +1,5 @@
{ lib, stdenv, llvm_meta, version, fetch, cmake, python3, xcbuild, libllvm, libcxxabi, libxcrypt
{ lib, stdenv, llvm_meta, version, fetch
, cmake, python3, xcbuild, libllvm, linuxHeaders, libcxxabi, libxcrypt
, doFakeLibgcc ? stdenv.hostPlatform.isFreeBSD
}:
@ -18,7 +19,9 @@ stdenv.mkDerivation {
nativeBuildInputs = [ cmake 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"

View file

@ -1,4 +1,5 @@
{ lib, stdenv, llvm_meta, version, src, cmake, python3, xcbuild, libllvm, libcxxabi, libxcrypt
{ lib, stdenv, llvm_meta, version, src
, cmake, python3, xcbuild, libllvm, linuxHeaders, libcxxabi, libxcrypt
, doFakeLibgcc ? stdenv.hostPlatform.isFreeBSD
}:
@ -20,7 +21,9 @@ stdenv.mkDerivation {
nativeBuildInputs = [ cmake 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"

View file

@ -1,6 +1,6 @@
{ lib, stdenv, llvm_meta, version
, monorepoSrc, runCommand
, cmake, python3, xcbuild, libllvm, libcxxabi, libxcrypt
, cmake, python3, xcbuild, libllvm, linuxHeaders, libcxxabi, libxcrypt
, doFakeLibgcc ? stdenv.hostPlatform.isFreeBSD
}:
@ -29,7 +29,9 @@ stdenv.mkDerivation {
nativeBuildInputs = [ cmake 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"

View file

@ -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
}:
@ -29,7 +29,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"

View file

@ -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"

View file

@ -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"

View file

@ -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"