Skip to content

Commit

Permalink
disable out-of-line atomics since ndk23+ for resolving linking issue …
Browse files Browse the repository at this point in the history
…with old ndk
  • Loading branch information
nihui committed Nov 21, 2022
1 parent f527fe8 commit 4e3579f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,12 @@ if(((IOS AND CMAKE_OSX_ARCHITECTURES MATCHES "arm64") OR (APPLE AND CMAKE_OSX_AR
endif()
endif()
target_compile_options(ncnn PRIVATE ${ARM_MARCH_FLAG})

if(ANDROID_NDK_MAJOR AND (ANDROID_NDK_MAJOR GREATER_EQUAL 23))
# llvm 12 in ndk-23 enables out-of-line atomics by default
# disable this feature for fixing linking atomic builtins issue with old ndk
target_compile_options(ncnn PRIVATE -mno-outline-atomics)
endif()
endif()

if(NCNN_TARGET_ARCH STREQUAL "mips")
Expand Down

0 comments on commit 4e3579f

Please sign in to comment.