Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit caeb469

Browse files
committed
[TSan] Ensure libc++ can be linked when built with TSan
Required change to make "Swift CI preset for LLVM libdispatch tests" [1] work. This goes the opposite direction of [2, 3], ensuring that the link step succeeds for the prodcued dynamic library (*.so). In the future versions of compiler-rt this will not be necessary since we will create a static archive instead. [1] swiftlang/swift#24330 [2] https://reviews.llvm.org/D58013 [3] https://reviews.llvm.org/rG0a9cb239a6c91a709a98c96bbf60b6c006d5a07b
1 parent e8dc6bb commit caeb469

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/tsan/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ if(COMPILER_RT_LIBCXX_PATH AND
248248
set(LIBCXX_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/libcxx_tsan_${arch})
249249
add_custom_libcxx(libcxx_tsan_${arch} ${LIBCXX_PREFIX}
250250
DEPS ${TSAN_RUNTIME_LIBRARIES}
251-
CFLAGS ${TARGET_CFLAGS} -fsanitize=thread
251+
CFLAGS ${TARGET_CFLAGS} -fsanitize=thread ${COMPILER_RT_TEST_LIBDISPATCH_CFLAGS}
252252
USE_TOOLCHAIN)
253253
list(APPEND libcxx_tsan_deps libcxx_tsan_${arch}-build)
254254
endforeach()

test/tsan/libdispatch/sync-block-copy.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
// RUN: %run %t_no_tsan 2>&1 | FileCheck %s
77
// RUN: %run %t_with_tsan 2>&1 | FileCheck %s --implicit-check-not='ThreadSanitizer'
88

9+
// Requires changes for how libc++ is built under TSan, which aren't included in
10+
// the swift-5.1-branch.
11+
// REQUIRES: disabled
12+
913
#include <dispatch/dispatch.h>
1014

1115
#include <stdio.h>

0 commit comments

Comments
 (0)