Skip to content

Commit

Permalink
support runtime LSE atomics detection for aarch64
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Tsahi Zidenberg committed Aug 25, 2020
1 parent f8cdce8 commit ec711bf
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CMakeLists.txt
Expand Up @@ -866,6 +866,15 @@ ELSE()
OPTION(USE_LD_GOLD "Use GNU gold linker" OFF)
ENDIF()

#for aarch64 - allow dynamic use of LSE atomics
IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
MY_CHECK_CXX_COMPILER_FLAG( "-moutline-atomics" HAVE_OUTLINE_ATOMICS)
IF(HAVE_OUTLINE_ATOMICS)
STRING_APPEND(CMAKE_C_FLAGS " -moutline-atomics")
STRING_APPEND(CMAKE_CXX_FLAGS " -moutline-atomics")
ENDIF()
ENDIF()

IF(LINUX)
OPTION(LINK_RANDOMIZE "Randomize the order of all symbols in the binary" OFF)
SET(LINK_RANDOMIZE_SEED "mysql"
Expand Down

0 comments on commit ec711bf

Please sign in to comment.