[vlc-devel] [PATCH 2/2] contrib: soxr: fix SIMD32 detection on aarch64

Alexandre Janniaux ajanni at videolabs.io
Tue Nov 26 14:50:38 CET 2019


SIMD32 CMake script only matches CMAKE_SYSTEM_PROCESSOR against "^arm",
while it is "aarch64" when building for arm64.

Fix the detection by adding the match against "^aarch64" too to
generate NEON code on arm64.
---
 ...ake-SIMD32-fix-detection-for-aarch64.patch | 35 +++++++++++++++++++
 contrib/src/soxr/rules.mak                    |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 contrib/src/soxr/0005-cmake-SIMD32-fix-detection-for-aarch64.patch

diff --git a/contrib/src/soxr/0005-cmake-SIMD32-fix-detection-for-aarch64.patch b/contrib/src/soxr/0005-cmake-SIMD32-fix-detection-for-aarch64.patch
new file mode 100644
index 0000000000..1cfd85b394
--- /dev/null
+++ b/contrib/src/soxr/0005-cmake-SIMD32-fix-detection-for-aarch64.patch
@@ -0,0 +1,35 @@
+From d68eedd3cfe632c50e3859219f3868bedc3a4a34 Mon Sep 17 00:00:00 2001
+From: Alexandre Janniaux <ajanni at videolabs.io>
+Date: Tue, 26 Nov 2019 11:38:25 +0100
+Subject: [PATCH] cmake: SIMD32: fix ARM detection for aarch64
+
+When compiling for android for arm64, the settings exposed to cmake will
+be the following:
+
++ Android: API '21'
++ Architecture: 'arm64'
++ ABI: 'arm64-v8a'
++ Processor: 'aarch64'
+
+So CMAKE_SYSTEM_PROCESSOR must also be checked for aarch64 so as to
+generate NEON code.
+---
+ cmake/Modules/FindSIMD32.cmake | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/cmake/Modules/FindSIMD32.cmake b/cmake/Modules/FindSIMD32.cmake
+index 9e42373..eaf5864 100644
+--- a/cmake/Modules/FindSIMD32.cmake
++++ b/cmake/Modules/FindSIMD32.cmake
+@@ -9,7 +9,8 @@
+
+ if (DEFINED SIMD32_C_FLAGS)
+   set (TRIAL_C_FLAGS)
+-elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
++elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^arm"
++        OR CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64")
+   set (TRIAL_C_FLAGS
+     # Gcc
+     "-mfpu=neon-vfpv4 -mcpu=cortex-a7"
+--
+2.24.0
diff --git a/contrib/src/soxr/rules.mak b/contrib/src/soxr/rules.mak
index a26557b6fb..d861790c6d 100644
--- a/contrib/src/soxr/rules.mak
+++ b/contrib/src/soxr/rules.mak
@@ -21,6 +21,7 @@ soxr: soxr-$(SOXR_VERSION)-Source.tar.xz .sum-soxr
 	$(APPLY) $(SRC)/soxr/0003-add-aarch64-support.patch
 	$(APPLY) $(SRC)/soxr/0004-arm-fix-SIGILL-when-doing-divisions-on-some-old-arch.patch
 	$(APPLY) $(SRC)/soxr/find_ff_pkgconfig.patch
+	$(APPLY) $(SRC)/soxr/0005-cmake-SIMD32-fix-detection-for-aarch64.patch
 	$(call pkg_static,"src/soxr.pc.in")
 	$(MOVE)
 
-- 
2.24.0



More information about the vlc-devel mailing list