[compiler-rt] dcafbd0 - [compiler-rt] Remove explicit Android libatomic linking

Shoaib Meenai via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 28 17:35:37 PDT 2023


Author: Shoaib Meenai
Date: 2023-08-28T17:34:48-07:00
New Revision: dcafbd0c673eb7513f2bf7b05e758c58de022af4

URL: https://github.com/llvm/llvm-project/commit/dcafbd0c673eb7513f2bf7b05e758c58de022af4
DIFF: https://github.com/llvm/llvm-project/commit/dcafbd0c673eb7513f2bf7b05e758c58de022af4.diff

LOG: [compiler-rt] Remove explicit Android libatomic linking

The comments date back to NDK r10, which is ancient. libatomic isn't
always needed anymore, and even when it is, it's bundled into
compiler-rt in the NDK so we'll get it automatically. Remove the
unnecessary explicit links.

Reviewed By: srhines

Differential Revision: https://reviews.llvm.org/D158793

Added: 
    

Modified: 
    compiler-rt/lib/asan/tests/CMakeLists.txt
    compiler-rt/lib/interception/tests/CMakeLists.txt
    compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/asan/tests/CMakeLists.txt b/compiler-rt/lib/asan/tests/CMakeLists.txt
index 9dbdc70b1f9bf4..6ee2fb01c0df49 100644
--- a/compiler-rt/lib/asan/tests/CMakeLists.txt
+++ b/compiler-rt/lib/asan/tests/CMakeLists.txt
@@ -102,8 +102,6 @@ set(ASAN_DYNAMIC_UNITTEST_INSTRUMENTED_LINK_FLAGS
   -shared-libasan)
 
 set(ASAN_UNITTEST_INSTRUMENTED_LIBS)
-# NDK r10 requires -latomic almost always.
-append_list_if(ANDROID atomic ASAN_UNITTEST_INSTRUMENTED_LIBS)
 
 set(ASAN_UNITTEST_NOINST_LINK_FLAGS ${ASAN_UNITTEST_COMMON_LINK_FLAGS})
 if(NOT APPLE)
@@ -117,8 +115,6 @@ endif()
 # TODO(eugenis): move all -l flags above to _LIBS?
 set(ASAN_UNITTEST_NOINST_LIBS)
 append_list_if(COMPILER_RT_HAS_LIBLOG log ASAN_UNITTEST_NOINST_LIBS)
-# NDK r10 requires -latomic almost always.
-append_list_if(ANDROID atomic ASAN_UNITTEST_NOINST_LIBS)
 
 # Main AddressSanitizer unit tests.
 add_custom_target(AsanUnitTests)

diff  --git a/compiler-rt/lib/interception/tests/CMakeLists.txt b/compiler-rt/lib/interception/tests/CMakeLists.txt
index 0db7cfa9c75330..644a57664cc490 100644
--- a/compiler-rt/lib/interception/tests/CMakeLists.txt
+++ b/compiler-rt/lib/interception/tests/CMakeLists.txt
@@ -62,8 +62,6 @@ endif()
 
 set(INTERCEPTION_TEST_LINK_LIBS)
 append_list_if(COMPILER_RT_HAS_LIBLOG log INTERCEPTION_TEST_LINK_LIBS)
-# NDK r10 requires -latomic almost always.
-append_list_if(ANDROID atomic INTERCEPTION_TEST_LINK_LIBS)
 
 append_list_if(COMPILER_RT_HAS_LIBDL -ldl INTERCEPTION_TEST_LINK_FLAGS_COMMON)
 append_list_if(COMPILER_RT_HAS_LIBRT -lrt INTERCEPTION_TEST_LINK_FLAGS_COMMON)

diff  --git a/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt b/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt
index 5378c2e75a778c..3c709e411e48be 100644
--- a/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt
+++ b/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt
@@ -124,8 +124,6 @@ endif()
 
 set(SANITIZER_TEST_LINK_LIBS)
 append_list_if(COMPILER_RT_HAS_LIBLOG log SANITIZER_TEST_LINK_LIBS)
-# NDK r10 requires -latomic almost always.
-append_list_if(ANDROID atomic SANITIZER_TEST_LINK_LIBS)
 
 append_list_if(COMPILER_RT_HAS_LIBDL -ldl SANITIZER_TEST_LINK_FLAGS_COMMON)
 append_list_if(COMPILER_RT_HAS_LIBRT -lrt SANITIZER_TEST_LINK_FLAGS_COMMON)


        


More information about the llvm-commits mailing list