aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/global_flags.compiler.gnu.march.cmake
diff options
context:
space:
mode:
authorAlexander Smirnov <alex@ydb.tech>2024-01-31 17:22:33 +0300
committerAlexander Smirnov <alex@ydb.tech>2024-01-31 17:22:33 +0300
commit52be5dbdd420165c68e7e90ba8f1d2f00da041f6 (patch)
tree5d47f5b2ff4e6a7c8e75d33931a1e683949b7229 /cmake/global_flags.compiler.gnu.march.cmake
parentea57c8867ceca391357c3c5ffcc5ba6738b49adc (diff)
parent809f0cf2fdfddfbeacc2256ffdbaaf5808ce5ed4 (diff)
downloadydb-52be5dbdd420165c68e7e90ba8f1d2f00da041f6.tar.gz
Merge branch 'mergelibs12' into main
Diffstat (limited to 'cmake/global_flags.compiler.gnu.march.cmake')
-rw-r--r--cmake/global_flags.compiler.gnu.march.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/cmake/global_flags.compiler.gnu.march.cmake b/cmake/global_flags.compiler.gnu.march.cmake
index a81af88c70..a9c619efc6 100644
--- a/cmake/global_flags.compiler.gnu.march.cmake
+++ b/cmake/global_flags.compiler.gnu.march.cmake
@@ -29,6 +29,13 @@ if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(i686|x86_64|AMD64)$")
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
string(APPEND _GNU_MARCH_C_CXX_FLAGS " -D_YNDX_LIBUNWIND_ENABLE_EXCEPTION_BACKTRACE")
endif()
+elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm64|aarch64)$")
+ if (CMAKE_SYSTEM_NAME MATCHES "^(Darwin|Linux)$")
+ # Clang 13+ generates outline atomics by default if '-rtlib=compiler_rt' is specified or system's
+ # libgcc version is >= 9.3.1 : https://github.com/llvm/llvm-project/commit/c5e7e649d537067dec7111f3de1430d0fc8a4d11
+ # Disable this behaviour because our build links with contrib/libs/cxxsupp/builtins that does not contain outline atomics yet
+ string(APPEND _GNU_MARCH_C_CXX_FLAGS " -mno-outline-atomics")
+ endif()
elseif (ANDROID AND (CMAKE_ANDROID_ARCH_ABI STREQUAL "armeabi-v7a"))
string(APPEND _GNU_MARCH_C_CXX_FLAGS " -mfloat-abi=softfp")
endif()