From f843e215f3f640de377d8fd60e85bb372fb138fd Mon Sep 17 00:00:00 2001 From: Tzachi Zidenberg Date: Sun, 5 Jul 2020 15:21:43 +0300 Subject: [PATCH] aarch64: use compiler flag outline-atomics if available outline-atomics compilation flag changes behaviour of builtin_atomics, by adding runtime detection of LSE atomics. If these are supported, they will be used. This gains LSE atomics use without hurting compatibility with older aarch64 machines. --- configure.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configure.cmake b/configure.cmake index 43c32fda0ee..5dd45a6b05d 100644 --- a/configure.cmake +++ b/configure.cmake @@ -69,6 +69,11 @@ IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "i686" AND CMAKE_COMPILER_IS_GNUCC AND SET(PLUGIN_QUERY_RESPONSE_TIME NO CACHE BOOL "Disabled, gcc is too old") ENDIF() +# use runtime atomic-support detection in aarch64 +IF(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") + MY_CHECK_AND_SET_COMPILER_FLAG("-moutline-atomics") +ENDIF() + IF(WITHOUT_DYNAMIC_PLUGINS) MESSAGE("Dynamic plugins are disabled.") ENDIF(WITHOUT_DYNAMIC_PLUGINS)