This is necessary for enabling LSAN on Android (D89251) because:
- LSAN will have false negatives if run with emulated-tls.
- Bionic ELF-TLS is not compatible with Gold (hence the need for LLD)
Differential D89615
Disable emulated-tls and use LLD for compiler-rt+tests on Android oontvoo on Oct 16 2020, 11:08 PM. Authored by
Details This is necessary for enabling LSAN on Android (D89251) because:
Diff Detail
Event TimelineComment Actions Maybe I misunderstood the question, but this is exactly what this patch is trying to do. (We can't switch to ELF TLS unless we know Bionic supports it. The idea is the build would set this ANDROID_HAS_ELF_TLS variable when building for Q+ ) Comment Actions It seems to me that ideally the NDK clang should be defaulting to -fno-emulated-tls for android with a new enough target platform version, and should also be defaulting to use lld. I think that's been the plan for a while -- do you know if it's going to actually happen soon? That might then make some of these changes unnecessary. Comment Actions @danalbert to make sure I don't mix this up. https://android.googlesource.com/platform/ndk/+/master/docs/Roadmap.md#ndk-r22 shows that NDK r22 (which is going to beta soon) does indeed change the default linker to LLD. For TLS, this is indeed sensitive to target API, and Android will still be targeting those older APIs for quite some time (so we can't just remove support for them). Comment Actions This library is special - we target an old sdk level to be compatible with those devices, but use the new features under runtime checks, including all thread-local variable access. Comment Actions if I read this correctly we can switch Android to lld unconditionally right now now? Comment Actions The bot[0] needs to use ndk22. It's using 16.
Sorry, I'm not sure which changes you'd like to be split.
|
This appears to cause the following failure with cmake version 3.16.5