]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Use -Wa,-march with older ARM toolchains
authorCameron Cawley <ccawley2011@gmail.com>
Thu, 29 Feb 2024 21:56:20 +0000 (21:56 +0000)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Wed, 12 Feb 2025 12:54:30 +0000 (13:54 +0100)
cmake/detect-intrinsics.cmake
configure

index 9ab351af23b3b0246ffba528e97a6434bef106bd..cf0ee5268d9cb39224cf96a5eb525d7061064ab3 100644 (file)
@@ -11,6 +11,16 @@ macro(check_armv8_compiler_flag)
                 check_c_compiler_flag("-march=armv8-a+crc+simd" HAVE_MARCH_ARMV8_CRC_SIMD)
                 if(HAVE_MARCH_ARMV8_CRC_SIMD)
                     set(ARMV8FLAG "-march=armv8-a+crc+simd" CACHE INTERNAL "Compiler option to enable ARMv8 support")
+                else()
+                    check_c_compiler_flag("-Wa,-march=armv8-a+crc" HAVE_WA_MARCH_ARMV8_CRC)
+                    if(HAVE_WA_MARCH_ARMV8_CRC)
+                        set(ARMV8FLAG "-Wa,-march=armv8-a+crc" CACHE INTERNAL "Compiler option to enable ARMv8 support")
+                    else()
+                        check_c_compiler_flag("-Wa,-march=armv8-a+crc+simd" HAVE_WA_MARCH_ARMV8_CRC_SIMD)
+                        if(HAVE_WA_MARCH_ARMV8_CRC_SIMD)
+                            set(ARMV8FLAG "-Wa,-march=armv8-a+crc+simd" CACHE INTERNAL "Compiler option to enable ARMv8 support")
+                        endif()
+                    endif()
                 endif()
             endif()
         endif()
@@ -52,6 +62,11 @@ macro(check_armv6_compiler_flag)
             check_c_compiler_flag("-march=armv6" HAVE_MARCH_ARMV6)
             if(HAVE_MARCH_ARMV6)
                 set(ARMV6FLAG "-march=armv6" CACHE INTERNAL "Compiler option to enable ARMv6 support")
+            else()
+                check_c_compiler_flag("-Wa,-march=armv6" HAVE_WA_MARCH_ARMV6)
+                if(HAVE_WA_MARCH_ARMV6)
+                    set(ARMV6FLAG "-Wa,-march=armv6" CACHE INTERNAL "Compiler option to enable ARMv6 support")
+                endif()
             endif()
         endif()
     endif()
index c5b570d0289d63e0f83143df64f7d01ab22a42cd..c365d1bfb0ae554458a8ec4f96ab693f58241d1b 100755 (executable)
--- a/configure
+++ b/configure
@@ -1136,6 +1136,18 @@ EOF
             armv8flag="-march=armv8-a+crc+simd"
         else
             echo "Check whether -march=armv8-a+crc+simd works ... No." | tee -a configure.log
+            if try $CC -c $CFLAGS -Wa,-march=armv8-a+crc $test.c; then
+                echo "Check whether -Wa,-march=armv8-a+crc works ... Yes." | tee -a configure.log
+                armv8flag="-Wa,-march=armv8-a+crc"
+            else
+                echo "Check whether -Wa,-march=armv8-a+crc works ... No." | tee -a configure.log
+                if try $CC -c $CFLAGS -Wa,-march=armv8-a+crc+simd $test.c; then
+                    echo "Check whether -Wa,-march=armv8-a+crc+simd works ... Yes." | tee -a configure.log
+                    armv8flag="-Wa,-march=armv8-a+crc+simd"
+                else
+                    echo "Check whether -Wa,-march=armv8-a+crc+simd works ... No." | tee -a configure.log
+                fi
+            fi
         fi
     fi
 
@@ -1230,6 +1242,12 @@ EOF
         echo "Check whether -march=armv6 works ... Yes." | tee -a configure.log
     else
         echo "Check whether -march=armv6 works ... No." | tee -a configure.log
+        if try $CC -c $CFLAGS -Wa,-march=armv6 $test.c; then
+            armv6flag=-Wa,-march=armv6
+            echo "Check whether -Wa,-march=armv6 works ... Yes." | tee -a configure.log
+        else
+            echo "Check whether -Wa,-march=armv6 works ... No." | tee -a configure.log
+        fi
     fi
 
     # Check whether compiler supports ARMv6 inline asm