Skip to content

Commit f8da95c

Browse files
committed
[compiler-rt] Add shared_cxxabi requirement to some tests
This adds REQUIRES: shared_cxxabi to a bunch of tests that would fail if this weak reference in sanitizer common was undefined. This is necessary in cases where libc++abi.a is statically linked in. Because there is no strong reference to __cxa_demangle in compiler-rt, then if libc++abi is linked in via a static archive, then the linker will not extract the archive member that would define that weak symbol. This causes a handful of tests to fail because this leads to the symbolizer printing mangled symbols where tests expect them demangled. Technically, this feature is WAI since sanitizer runtimes shouldn't fail if this symbol isn't resolved, and linking statically means you wouldn't need to link in all of libc++abi. As a workaround, we can simply make it a requirement that these tests use shared libc++abis. Differential Revision: https://reviews.llvm.org/D109639
1 parent a5211bf commit f8da95c

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

compiler-rt/test/asan/TestCases/Linux/odr-vtable.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Fails with debug checks: https://bugs.llvm.org/show_bug.cgi?id=46862
22
// XFAIL: !compiler-rt-optimized && !riscv64
33

4+
// REQUIRES: shared_cxxabi
5+
46
/// Not using private alias or enabling ODR indicator can detect ODR issues.
57
// RUN: %clangxx_asan -fno-rtti -DBUILD_SO1 -fPIC -shared -mllvm -asan-use-private-alias=0 %s -o %dynamiclib1
68
// RUN: %clangxx_asan -fno-rtti -DBUILD_SO2 -fPIC -shared -mllvm -asan-use-private-alias=0 %s -o %dynamiclib2

compiler-rt/test/ubsan/TestCases/TypeCheck/vptr-virtual-base.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// RUN: %clangxx -frtti -fsanitize=null,vptr -fno-sanitize-recover=vptr -g %s -O3 -o %t
22
// RUN: not %run %t 2>&1 | FileCheck %s
33

4+
// REQUIRES: shared_cxxabi
45
// REQUIRES: cxxabi
56
// UNSUPPORTED: windows-msvc
67
// Nested crash reported

0 commit comments

Comments
 (0)