mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-03 13:30:36 +00:00
ispc: fix riscv64-linux build (#562779)
This commit is contained in:
@@ -15,6 +15,8 @@
|
||||
testedTargets ?
|
||||
if stdenv.hostPlatform.isAarch64 || stdenv.hostPlatform.isAarch32 then
|
||||
[ "neon-i32x4" ]
|
||||
else if stdenv.hostPlatform.isRiscV64 then
|
||||
[ "rvv-x4" ]
|
||||
else
|
||||
[ "sse2-i32x4" ],
|
||||
}:
|
||||
@@ -58,6 +60,11 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
inherit testedTargets;
|
||||
|
||||
# run_tests.py does not know riscv64 hosts and defaults to x86 targets
|
||||
patches = lib.optionals stdenv.hostPlatform.isRiscV64 [
|
||||
./run-tests-riscv64.patch
|
||||
];
|
||||
|
||||
doCheck = true;
|
||||
|
||||
# the compiler enforces -Werror, and -fno-strict-overflow makes it mad.
|
||||
@@ -87,12 +94,13 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
(lib.cmakeFeature "CLANGPP_EXECUTABLE" "${llvmPackages.clang}/bin/clang++")
|
||||
(lib.cmakeBool "ISPC_INCLUDE_EXAMPLES" false)
|
||||
(lib.cmakeBool "ISPC_INCLUDE_UTILS" false)
|
||||
(lib.cmakeFeature "ARM_ENABLED=" (
|
||||
(lib.cmakeFeature "ARM_ENABLED" (
|
||||
if stdenv.hostPlatform.isAarch64 || stdenv.hostPlatform.isAarch32 then "TRUE" else "FALSE"
|
||||
))
|
||||
(lib.cmakeFeature "X86_ENABLED=" (
|
||||
(lib.cmakeFeature "X86_ENABLED" (
|
||||
if stdenv.hostPlatform.isx86_64 || stdenv.hostPlatform.isx86_32 then "TRUE" else "FALSE"
|
||||
))
|
||||
(lib.cmakeFeature "RISCV_ENABLED" (if stdenv.hostPlatform.isRiscV64 then "TRUE" else "FALSE"))
|
||||
];
|
||||
|
||||
meta = {
|
||||
|
||||
12
pkgs/by-name/is/ispc/run-tests-riscv64.patch
Normal file
12
pkgs/by-name/is/ispc/run-tests-riscv64.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
--- a/scripts/run_tests.py
|
||||
+++ b/scripts/run_tests.py
|
||||
@@ -1368,6 +1368,9 @@
|
||||
elif platform.machine() == "ppc64le":
|
||||
default_target = "generic-i32x4"
|
||||
default_arch = "ppc64le"
|
||||
+elif platform.machine() == "riscv64":
|
||||
+ default_target = "rvv-x4"
|
||||
+ default_arch = "riscv64"
|
||||
elif "86" in platform.machine() or platform.machine() == "AMD64":
|
||||
# Some variant of x86: x86_64, i386, i486, i586, i686
|
||||
# Windows reports platform as AMD64
|
||||
Reference in New Issue
Block a user