Skip to content

Commit ec711bf

Browse files
author
Tsahi Zidenberg
committed
support runtime LSE atomics detection for aarch64
Outline-atomics flag modifies builtin atomics to detect CPU support for atomic instructions in runtime, thus getting menefits of using LSE atomics without hurting compatibility. This flag has no effect if compiling for aarch64 >=v8.1.
1 parent f8cdce8 commit ec711bf

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -866,6 +866,15 @@ ELSE()
866866
OPTION(USE_LD_GOLD "Use GNU gold linker" OFF)
867867
ENDIF()
868868

869+
#for aarch64 - allow dynamic use of LSE atomics
870+
IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
871+
MY_CHECK_CXX_COMPILER_FLAG( "-moutline-atomics" HAVE_OUTLINE_ATOMICS)
872+
IF(HAVE_OUTLINE_ATOMICS)
873+
STRING_APPEND(CMAKE_C_FLAGS " -moutline-atomics")
874+
STRING_APPEND(CMAKE_CXX_FLAGS " -moutline-atomics")
875+
ENDIF()
876+
ENDIF()
877+
869878
IF(LINUX)
870879
OPTION(LINK_RANDOMIZE "Randomize the order of all symbols in the binary" OFF)
871880
SET(LINK_RANDOMIZE_SEED "mysql"

0 commit comments

Comments
 (0)