]> git.ipfire.org Git - people/mfischer/ipfire-2.x.git/commitdiff
vectorscan: Fix check for CPU support
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 2 Aug 2024 16:49:15 +0000 (16:49 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 2 Aug 2024 16:50:44 +0000 (16:50 +0000)
According to the documentation, Vectorscan checks whether the CPU is
supporting the minimum requirement of SSE4.2. However the check is still
checking for SSSE3 which makes the library fail on systems without
SSE4.2.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
lfs/vectorscan
src/patches/vectorscan-5.4.11-sse4.2.patch [new file with mode: 0644]

index 585fc2894adb8521a17b0731d536e8419acb2bd6..b56243c42f61998de16e2247f4009be253d5d926 100644 (file)
@@ -92,6 +92,7 @@ $(subst %,%_BLAKE2,$(objects)) :
 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @$(PREBUILD)
        @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/vectorscan-5.4.11-sse4.2.patch
        cd $(DIR_APP) && cmake . \
                -DCMAKE_INSTALL_PREFIX:PATH=/usr \
                -DBUILD_SHARED_LIBS=ON \
diff --git a/src/patches/vectorscan-5.4.11-sse4.2.patch b/src/patches/vectorscan-5.4.11-sse4.2.patch
new file mode 100644 (file)
index 0000000..feb867a
--- /dev/null
@@ -0,0 +1,16 @@
+diff --git a/src/hs_valid_platform.c b/src/hs_valid_platform.c
+index 0af36b6c..12ae5d9a 100644
+--- a/src/hs_valid_platform.c
++++ b/src/hs_valid_platform.c
+@@ -37,9 +37,9 @@
+ HS_PUBLIC_API
+ hs_error_t HS_CDECL hs_valid_platform(void) {
+-    /* Hyperscan requires SSSE3, anything else is a bonus */
++    /* Vectorscan requires SSE4.2, anything else is a bonus */
+ #if defined(ARCH_IA32) || defined(ARCH_X86_64)
+-    if (check_ssse3()) {
++    if (check_sse42()) {
+         return HS_SUCCESS;
+     } else {
+         return HS_ARCH_ERROR;