]> git.ipfire.org Git - people/mfischer/ipfire-2.x.git/commitdiff
vectorscan: Build as a fat library
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 4 Jul 2024 15:39:10 +0000 (15:39 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 4 Jul 2024 15:39:10 +0000 (15:39 +0000)
The build system defaults to building the library for the host system
and therefore uses instructions that might not be available on the
target system.

This patch changes that we will build the library so that it will choose
the most optimised functions at runtime.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
lfs/vectorscan

index 0bcc1bcf40d936c286dc7ef1c6d5ca1702a1f05c..585fc2894adb8521a17b0731d536e8419acb2bd6 100644 (file)
@@ -38,6 +38,22 @@ SUP_ARCH   = x86_64 aarch64
 # smaller machines
 MAX_PARALLELISM = $(shell echo $$(( $(SYSTEM_MEMORY) / 1024)))
 
+ifeq "$(BUILD_ARCH)" "aarch64"
+       EXTRA_ARGS += \
+               -DFAT_RUNTIME=ON \
+               -DBUILD_SVE=ON \
+               -DBUILD_SVE2=ON \
+               -DBUILD_SVE2_BITPERM=ON
+endif
+
+ifeq "$(BUILD_ARCH)" "x86_64"
+       EXTRA_ARGS += \
+               -DFAT_RUNTIME=ON \
+               -DBUILD_AVX2=ON \
+               -DBUILD_AVX512=ON \
+               -DBUILD_AVX512VBMI=ON
+endif
+
 ###############################################################################
 # Top-level Rules
 ###############################################################################
@@ -80,7 +96,9 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
                -DCMAKE_INSTALL_PREFIX:PATH=/usr \
                -DBUILD_SHARED_LIBS=ON \
                -DCMAKE_BUILD_TYPE=RELEASE \
-               -DBUILD_EXAMPLES=OFF
+               -DBUILD_EXAMPLES=OFF \
+               $(EXTRA_ARGS)
+               -Wno-dev
        cd $(DIR_APP) && make $(MAKETUNING)
        cd $(DIR_APP) && make install
        @rm -rf $(DIR_APP)