trunk check-all failing on Linux using compiler-rt and libcxx

Posting to the list first, rather than filing a bug because I’m not sure this is still an intended configuration:

With LLVM configured as:

CXX=clang++ CC=clang cmake …/llvm/

The check-all target is failing to compile the interception tests:

/home/sdowney/bld/llvm-master/llvm/projects/compiler-rt/lib/interception/tests/ error: redefinition of ‘isdigit’
INTERCEPTOR(int, isdigit, int d) {
/usr/include/ctype.h:185:1: note: previous definition is here
__isctype_f (digit)
/usr/include/ctype.h:93:3: note: expanded from macro ‘__isctype_f’
is##type (int __c) __THROW
:835:1: note: expanded from here

Without the tests, clang builds and appears to work. And in the checkin prior to the interception tests, the tests all passed.

We normally avoid this problem by carefully defining interceptors in TUs that don’t include system headers, but when you add gtest into the mix, that’s not possible.

Maybe we should just intercept malloc instead. It seems unlikely that a libc implementation will provide an inline definition of malloc.

What’s the actual intent of the test? Willing to help fix it, but don’t want to destroy the value of it.