File tree Expand file tree Collapse file tree 3 files changed +4
-5
lines changed Expand file tree Collapse file tree 3 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -176,6 +176,7 @@ check_cxx_compiler_flag(-nostdlib++ COMPILER_RT_HAS_NOSTDLIBXX_FLAG)
176
176
check_include_files ("sys/auxv.h" COMPILER_RT_HAS_AUXV )
177
177
178
178
# Libraries.
179
+ check_library_exists (atomic __atomic_load_8 "" COMPILER_RT_HAS_LIBATOMIC )
179
180
check_library_exists (dl dlopen "" COMPILER_RT_HAS_LIBDL )
180
181
check_library_exists (rt shm_open "" COMPILER_RT_HAS_LIBRT )
181
182
check_library_exists (m pow "" COMPILER_RT_HAS_LIBM )
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ set(RTSAN_UNITTEST_LINK_FLAGS
36
36
${SANITIZER_TEST_CXX_LIBRARIES}
37
37
-no-pie )
38
38
39
+ append_list_if (COMPILER_RT_HAS_LIBATOMIC -latomic RTSAN_UNITTEST_LINK_FLAGS )
39
40
append_list_if (COMPILER_RT_HAS_LIBDL -ldl RTSAN_UNITTEST_LINK_FLAGS )
40
41
append_list_if (COMPILER_RT_HAS_LIBRT -lrt RTSAN_UNITTEST_LINK_FLAGS )
41
42
append_list_if (COMPILER_RT_HAS_LIBM -lm RTSAN_UNITTEST_LINK_FLAGS )
Original file line number Diff line number Diff line change @@ -46,11 +46,8 @@ set(SCUDO_UNITTEST_LINK_FLAGS
46
46
${COMPILER_RT_UNWINDER_LINK_LIBS}
47
47
${SANITIZER_TEST_CXX_LIBRARIES} )
48
48
list (APPEND SCUDO_UNITTEST_LINK_FLAGS -pthread -no-pie )
49
- # Linking against libatomic is required with some compilers
50
- check_library_exists (atomic __atomic_load_8 "" COMPILER_RT_HAS_LIBATOMIC )
51
- if (COMPILER_RT_HAS_LIBATOMIC )
52
- list (APPEND SCUDO_UNITTEST_LINK_FLAGS -latomic )
53
- endif ()
49
+
50
+ append_list_if (COMPILER_RT_HAS_LIBATOMIC -latomic SCUDO_UNITTEST_LINK_FLAGS )
54
51
55
52
set (SCUDO_TEST_HEADERS
56
53
scudo_unit_test.h
You can’t perform that action at this time.
0 commit comments