From fe9bb31b09b69cd957e9206c300b0c99f7d5645e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Pawe=C5=82=20Stefaniak?= <3462925+pstef@users.noreply.github.com> Date: Mon, 6 May 2024 14:34:27 +0200 Subject: [PATCH] Avoid repeating the -march flag Under the right circumstances, both -march=armv8.1-a and -march=native were added. But it only makes sense to use one or the other. --- buildfiles/cmake/ConfigureCompiler.cmake | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/buildfiles/cmake/ConfigureCompiler.cmake b/buildfiles/cmake/ConfigureCompiler.cmake index 3b2db2b828..b4f21e88ab 100644 --- a/buildfiles/cmake/ConfigureCompiler.cmake +++ b/buildfiles/cmake/ConfigureCompiler.cmake @@ -33,7 +33,9 @@ else() add_compile_options(-fno-exceptions) add_compile_options(-fstack-protector) - if (COMPILER_ARM) + if(USE_NATIVE_INSTRUCTIONS AND COMPILER_SUPPORTS_MARCH_NATIVE) + add_compile_options(-march=native) + elseif(COMPILER_ARM) # This section needs a review. Apple claims armv8.5-a on M-series but doesn't support SVE. # Note that compared to the rest of the 8.x family, 8.1 is very restrictive and we'll have to bump the requirement in future to get anything meaningful. if (APPLE) @@ -90,10 +92,6 @@ else() add_compile_options(-Wno-class-memaccess) endif() - if(USE_NATIVE_INSTRUCTIONS AND COMPILER_SUPPORTS_MARCH_NATIVE) - add_compile_options(-march=native) - endif() - if(NOT APPLE AND NOT WIN32) # This hides our LLVM from mesa's LLVM, otherwise we get some unresolvable conflicts. add_link_options(-Wl,--exclude-libs,ALL)