[PATCH] D147849: [Android] Use ELF TLS for Android API level 29+
Ryan Prichard via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 10 14:32:41 PDT 2023
rprichard added a comment.
nit: In the description/commit message, the "when the API level is > 29" should be "when the API level is >= 29".
I think it's OK, but I'd like confirmation that it works with LTO?
One issue I noticed earlier was that the compiler flag (`-f[no-]emulated-tls`) doesn't work with LTO:
- The flag is ignored when the compiler is only outputting LLVM IR, and
- The flag is also ignored at link-time when the IR is converted to emutls-or-efltls machine code.
This link-time LTO setting can be changed using `-Wl,-plugin-opt,-emulated-tls={0,1}`.
It's not clear to me from the patch whether the new default applies when `-flto` is used to compile. (I suspect that it does, but a confirmation might be useful?)
Also: This is technically an ABI break, but it only applies when a thread-local variable is accessed across an ABI boundary, which seems unlikely/rare. It seems like the change is worth it, in any case.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D147849/new/
https://reviews.llvm.org/D147849
More information about the llvm-commits
mailing list