Make use of the newly added thread-properties API (available since 31)
Side-effect change: set -fno-emulated-tls for lsan/asan libraries and skip their tests on pre-S Android.
oontvoo on Aug 13 2020, 12:53 PM.Authored by
There are a very large number of changes, so older changes are hidden. Show Older Changes
Try this one, it's the same script that runs on the buildbot. Be careful, it can mess up anything in the current directory (it expect source/build trees there for a possible incremental run).
There are a few small things, search for "lsan" in compiler-rt/lib/asan. The main one is an allocator interface for scanning, and a few hooks for initializing lsan and passing the runtime flags.
Updated a few tests to work on Android.
@eugenis: I think this is ready to be reviewed now.
(Note: The i686 needs some fix in Bionic or it'd sigsev https://android-review.googlesource.com/c/platform/bionic/+/1419435)
updated per review comments
This caused a build break in our compiler-rt build for Android: use of undeclared identifier '__interceptor_memalign'
The name is referenced from https://github.com/llvm/llvm-project/blob/85e578f53ad1ba21771470dc9516068a259d29cf/compiler-rt/lib/asan/asan_malloc_linux.cpp#L274 but the definition is no longer provided now that SANITIZER_INTERCEPT_MEMALIGN has excluded Android.
For anyone playing along at home: this landed in https://github.com/llvm/llvm-project/commit/a2291a58bf1c860d026581fee6fe96019dc25440, not sure why Phab didn't automatically mention that here.
Thanks for the report!
Are you also building with API 16? (From your second comment)
I landed it with git push instead of arc land ... maybe that's the issue?
Included the fix now.
memalign is callled during lsan init for Android, causing the "ENSURE_LSAN_INITED" check and the stack-trace to fail.