about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libhwy
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2024-02-13 12:25:07 +0100
committerAlyssa Ross <hi@alyssa.is>2024-02-13 12:25:07 +0100
commita5e1520e4538e29ecfbd4b168306f890566d7bfd (patch)
tree28099c268b5d4b1e33c2b29f0714c45f0b961382 /nixpkgs/pkgs/development/libraries/libhwy
parent822f7c15c04567fbdc27020e862ea2b70cfbf8eb (diff)
parent3560d1c8269d0091b9aae10731b5e85274b7bbc1 (diff)
downloadnixlib-a5e1520e4538e29ecfbd4b168306f890566d7bfd.tar
nixlib-a5e1520e4538e29ecfbd4b168306f890566d7bfd.tar.gz
nixlib-a5e1520e4538e29ecfbd4b168306f890566d7bfd.tar.bz2
nixlib-a5e1520e4538e29ecfbd4b168306f890566d7bfd.tar.lz
nixlib-a5e1520e4538e29ecfbd4b168306f890566d7bfd.tar.xz
nixlib-a5e1520e4538e29ecfbd4b168306f890566d7bfd.tar.zst
nixlib-a5e1520e4538e29ecfbd4b168306f890566d7bfd.zip
Merge branch 'nixos-unstable-small' of https://github.com/NixOS/nixpkgs
Conflicts:
	nixpkgs/nixos/modules/services/mail/rss2email.nix
	nixpkgs/pkgs/build-support/go/module.nix
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libhwy')
-rw-r--r--nixpkgs/pkgs/development/libraries/libhwy/default.nix15
1 files changed, 15 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libhwy/default.nix b/nixpkgs/pkgs/development/libraries/libhwy/default.nix
index b2f32cbe7252..664378d42b6d 100644
--- a/nixpkgs/pkgs/development/libraries/libhwy/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libhwy/default.nix
@@ -4,6 +4,7 @@
 , ninja
 , gtest
 , fetchFromGitHub
+, fetchpatch
 }:
 
 stdenv.mkDerivation rec {
@@ -17,6 +18,15 @@ stdenv.mkDerivation rec {
     hash = "sha256-Z+mAR9nSAbCskUvo6oK79Yd85bu0HtI2aR5THS1EozM=";
   };
 
+  patches = lib.optional stdenv.hostPlatform.isRiscV
+    # Adds CMake option HWY_CMAKE_RVV
+    # https://github.com/google/highway/pull/1743
+    (fetchpatch {
+      name = "libhwy-add-rvv-optout.patch";
+      url = "https://github.com/google/highway/commit/5d58d233fbcec0c6a39df8186a877329147324b3.patch";
+      hash = "sha256-ileSNYddOt1F5rooRB0fXT20WkVlnG+gP5w7qJdBuww=";
+    });
+
   nativeBuildInputs = [ cmake ninja ];
 
   # Required for case-insensitive filesystems ("BUILD" exists)
@@ -43,6 +53,11 @@ stdenv.mkDerivation rec {
     #   HwyMathTestGroup/HwyMathTest.TestAllAtanh/EMU128
     #   HwyMathTestGroup/HwyMathTest.TestAllLog1p/EMU128
     "-DHWY_CMAKE_SSE2=ON"
+  ] ++ lib.optionals stdenv.hostPlatform.isRiscV [
+    # Runtime dispatch is not implemented https://github.com/google/highway/issues/838
+    # so tests (and likely normal operation) fail with SIGILL on processors without V.
+    # Until the issue is resolved, we disable RVV completely.
+    "-DHWY_CMAKE_RVV=OFF"
   ];
 
   # hydra's darwin machines run into https://github.com/libjxl/libjxl/issues/408