[compiler-rt][test] Add REQUIRES for checking static libc++abi
authorLeonard Chan <leonardchan@google.com>
Wed, 22 Sep 2021 22:25:05 +0000 (15:25 -0700)
committerLeonard Chan <leonardchan@google.com>
Wed, 22 Sep 2021 22:25:05 +0000 (15:25 -0700)
commitac191bcc99e2fc4ab7993138f5e82a0b75b7e9db
treebd4c088572d16f872abd8a0b30c3588aeb93f1d3
parent747b1a67a3dd706ffab9df9ee6f816b75ccaa5b6
[compiler-rt][test] Add REQUIRES for checking static libc++abi

intercept-rethrow-exception.cc fails when running runtimes tests if linking in
a hermetic libc++abi. This is because if libc++abi is used, then asan expects
to intercept __cxa_rethrow_primary_exception on linux, which should unpoison the
stack. If we statically link in libc++abi though, it will contain a strong
definition for __cxa_rethrow_primary_exception which wins over the weakly
defined interceptor provided by asan, causing the test to fail by not unpoisoning
the stack on the exception being thrown.

It's likely no one has encountered this before and possible that upstream tests
opt for dynamically linking where the interceptor can work properly. An ideal
long term solution would be to update the interceptor and libc++[abi] APIs to
work for this case, but that will likely take a long time to work out. In the
meantime, since the test isn't necessarily broken, we can just add another
REQUIRES check to make sure that it's only run if we aren't statically linking
in libc++abi.

Differential Revision: https://reviews.llvm.org/D109938
compiler-rt/CMakeLists.txt
compiler-rt/test/asan/TestCases/intercept-rethrow-exception.cpp
compiler-rt/test/lit.common.cfg.py
compiler-rt/test/lit.common.configured.in