Skip to content

Commit 6a03fd2

Browse files
committed
Explicitly link pthread library for unit tests
1 parent e5aa799 commit 6a03fd2

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

compiler-rt/lib/rtsan/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ else()
8484
${RTSAN_COMMON_RUNTIME_OBJECT_LIBS}
8585
LINK_FLAGS ${RTSAN_LINK_FLAGS}
8686
CFLAGS ${RTSAN_CFLAGS}
87+
LINK_LIBS ${RTSAN_LINK_LIBS}
8788
PARENT_TARGET rtsan)
8889
endif()
8990

compiler-rt/lib/rtsan/tests/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ set(RTSAN_UNITTEST_LINK_FLAGS
3636
${SANITIZER_TEST_CXX_LIBRARIES}
3737
-no-pie)
3838

39+
append_list_if(COMPILER_RT_HAS_LIBPTHREAD -pthread RTSAN_UNITTEST_LINK_FLAGS)
40+
3941
if (APPLE)
4042
add_weak_symbols("sanitizer_common" WEAK_SYMBOL_LINK_FLAGS)
4143
list(APPEND RTSAN_UNITTEST_LINK_FLAGS ${WEAK_SYMBOL_LINK_FLAGS})

0 commit comments

Comments
 (0)