]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
[ARM] We need to include NEON headers when testing for -mfpu=neon.
authorMika Lindqvist <postmaster@raasu.org>
Tue, 31 May 2022 12:58:17 +0000 (15:58 +0300)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Thu, 2 Jun 2022 10:25:24 +0000 (12:25 +0200)
* If -mfpu is already specified in C_FLAGS, it can disable NEON support.

cmake/detect-intrinsics.cmake
configure

index c638b3bc263415d2d0747e5c1baf10466802b24d..1ddab22537b62d82294893caf8be7ca1798d4197 100644 (file)
@@ -152,7 +152,12 @@ macro(check_neon_compiler_flag)
     # Check whether compiler supports NEON flag
     set(CMAKE_REQUIRED_FLAGS "${NEONFLAG} ${NATIVEFLAG}")
     check_c_source_compiles(
-        "int main() { return 0; }"
+        "#ifdef _M_ARM64
+        #  include <arm64_neon.h>
+        #else
+        #  include <arm_neon.h>
+        #endif
+        int main() { return 0; }"
         MFPU_NEON_AVAILABLE FAIL_REGEX "not supported")
     set(CMAKE_REQUIRED_FLAGS)
 endmacro()
index b90c2342fc7ffccd4f659b00864cc816c37b1deb..26529dbb5cb51e5fa5030dab53044f1ba1aced3d 100755 (executable)
--- a/configure
+++ b/configure
@@ -1106,6 +1106,11 @@ EOF
 check_neon_compiler_flag() {
     # Check whether -mfpu=neon is available on ARM processors.
     cat > $test.c << EOF
+#ifdef _M_ARM64
+ #  include <arm64_neon.h>
+ #else
+ #  include <arm_neon.h>
+#endif
 int main() { return 0; }
 EOF
     if try $CC -c $CFLAGS -mfpu=neon $test.c; then