Use -Wa,-march with older ARM toolchains

This commit is contained in:
Cameron Cawley 2024-02-29 21:56:20 +00:00 committed by Hans Kristian Rosbach
parent 7ea78f12c8
commit 231c4b3a64
2 changed files with 33 additions and 0 deletions

View 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()

18
configure vendored
View File

@ -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