Skip to content

Commit 30358cf

Browse files
PiJoulesmemfrob
authored andcommitted
[compiler-rt][test] Add shared_unwind requirement
When using a static libunwind, the check_memcpy.c can fail because it checks that tsan intercepted all memcpy/memmoves in the final binary. Though if the static libunwind is not instrumented, then this will fail because it may contain regular memcpy/memmoves. This adds a new REQUIRES check for ensuring that this test won't run unless a dynamic libunwind.so is provided. Differential Revision: https://reviews.llvm.org/D111194
1 parent 364be60 commit 30358cf

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

compiler-rt/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ endif()
233233

234234
option(SANITIZER_USE_STATIC_LLVM_UNWINDER
235235
"Use static LLVM unwinder." ${DEFAULT_SANITIZER_USE_STATIC_LLVM_UNWINDER})
236+
pythonize_bool(SANITIZER_USE_STATIC_LLVM_UNWINDER)
236237

237238
set(DEFAULT_SANITIZER_USE_STATIC_CXX_ABI OFF)
238239
if (DEFINED LIBCXXABI_ENABLE_SHARED AND NOT LIBCXXABI_ENABLE_SHARED)

compiler-rt/test/lit.common.cfg.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,9 @@ def get_ios_commands_dir():
366366
if not getattr(config, 'sanitizer_uses_static_cxxabi', False):
367367
config.available_features.add('shared_cxxabi')
368368

369+
if not getattr(config, 'sanitizer_uses_static_unwind', False):
370+
config.available_features.add('shared_unwind')
371+
369372
if config.has_lld:
370373
config.available_features.add('lld-available')
371374

compiler-rt/test/lit.common.configured.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ set_default("apple_platform", "osx")
3434
set_default("apple_platform_min_deployment_target_flag", "-mmacosx-version-min")
3535
set_default("sanitizer_can_use_cxxabi", @SANITIZER_CAN_USE_CXXABI_PYBOOL@)
3636
set_default("sanitizer_uses_static_cxxabi", @SANITIZER_USE_STATIC_CXX_ABI_PYBOOL@)
37+
set_default("sanitizer_uses_static_unwind", @SANITIZER_USE_STATIC_LLVM_UNWINDER_PYBOOL@)
3738
set_default("has_lld", @COMPILER_RT_HAS_LLD_PYBOOL@)
3839
set_default("can_symbolize", @CAN_SYMBOLIZE@)
3940
set_default("use_lld", @COMPILER_RT_TEST_USE_LLD_PYBOOL@)

compiler-rt/test/tsan/Linux/check_memcpy.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
// memcpy/memmove calls. It builds the binary with TSan and check's
33
// its objdump.
44

5+
// This could fail if using a static libunwind because that static libunwind
6+
// could be uninstrumented and contain memcpy/memmove calls not intercepted by
7+
// tsan.
8+
// REQUIRES: shared_unwind
9+
510
// RUN: %clang_tsan -O1 %s -o %t
611
// RUN: llvm-objdump -d -l %t | FileCheck %s
712

0 commit comments

Comments
 (0)