]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Don't use -march=native when doing LD4 test for ARM/AArch64.
authorMika Lindqvist <postmaster@raasu.org>
Fri, 18 Feb 2022 06:27:18 +0000 (08:27 +0200)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Sat, 19 Feb 2022 18:41:57 +0000 (19:41 +0100)
configure

index 7c6b769b41555f8d47f7d511573c7f5f53a480a6..0ff33c34ce3e4413a35b3db6c0564182c2fcbcbb 100755 (executable)
--- a/configure
+++ b/configure
@@ -1170,6 +1170,13 @@ EOF
 }
 
 check_neon_ld4_intrinsics() {
+    if test $buildneon -eq 1 && test $native -eq 0; then
+        if test "$CC_ARCH" = "aarch64" || test "$CC_ARCH" = "aarch64_be"; then
+            neonflag="-march=armv8-a+simd"
+        elif test $MFPU_NEON_AVAILABLE -eq 1; then
+            neonflag="-mfpu=neon"
+        fi
+    fi
     cat > $test.c << EOF
 #ifdef _M_ARM64
 #  include <arm64_neon.h>
@@ -1183,7 +1190,7 @@ int main(void) {
     return 0;
 }
 EOF
-    if try $CC -c $CFLAGS -march=native $test.c; then
+    if try $CC -c $CFLAGS $neonflag $test.c; then
         NEON_HAS_LD4=1
         echo "check whether compiler supports 4 wide register loads ... Yes." | tee -a configure.log
     else