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)
176176check_include_files("sys/auxv.h" COMPILER_RT_HAS_AUXV)
177177
178178# Libraries.
179+ check_library_exists(atomic __atomic_load_8 "" COMPILER_RT_HAS_LIBATOMIC)
179180check_library_exists(dl dlopen "" COMPILER_RT_HAS_LIBDL)
180181check_library_exists(rt shm_open "" COMPILER_RT_HAS_LIBRT)
181182check_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
3636 ${SANITIZER_TEST_CXX_LIBRARIES}
3737 -no -pie)
3838
39+ append_list_if(COMPILER_RT_HAS_LIBATOMIC -latomic RTSAN_UNITTEST_LINK_FLAGS)
3940append_list_if(COMPILER_RT_HAS_LIBDL -ldl RTSAN_UNITTEST_LINK_FLAGS)
4041append_list_if(COMPILER_RT_HAS_LIBRT -lrt RTSAN_UNITTEST_LINK_FLAGS)
4142append_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
4646 ${COMPILER_RT_UNWINDER_LINK_LIBS}
4747 ${SANITIZER_TEST_CXX_LIBRARIES} )
4848list (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)
5451
5552set (SCUDO_TEST_HEADERS
5653 scudo_unit_test.h
You can’t perform that action at this time.
0 commit comments