On Android 11 and newer, we use Scudo standalone as the platform
allocator inside of libc. This causes a problem, as the platform version
of scudo owns the sanitizer TLS slot. When we run compiler-rt-based
scudo tests on a newer device, these two version of Scudo fight over the
slot.
This used to not break things as the compiler-rt version would just
clobber the TLS slot, and the platform version was never invoked. After
https://android-review.googlesource.com/c/platform/bionic/+/1299034/
however, the platform version re-clobbers the TLS slot after it's been
initialised by the constructors for the compiler-rt version under test.
To work around this, on newer devices that support ELF TLS, we add ELF
TLS support to compiler-rt scudo. This requires targeting a higher API
level (at least 29). If the user is targeting a lower API level and is
running an Android 11-or-greater device, the tests will be automatically
disabled as there's no reasonable way to resolve the conflict.
FWIW - I'm fairly sure this was broken before (Android 10 was the first with ELF TLS at API level 29?), but it was just untested on the bots because they're currently running at API level 24.