-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge b8f04a670f27a84412099dd025fa762ee58f4c1a into 13.0.1 #51839
Comments
assigned to @rprichard |
Hi Unassigned, What is your opinion on backporting this? https://reviews.llvm.org/rGb8f04a670f27a84412099dd025fa762ee58f4c1a |
Hi Ryan, What is your opinion on backporting this? https://reviews.llvm.org/rGb8f04a670f27a84412099dd025fa762ee58f4c1a |
There was a bug reported against the NDK complaining about __emutls_get_address, and I'm wondering if we need to revert that LLVM change. (android/ndk#1606) Exporting the symbol from the DSO as weak is fine, but I'm not sure there's a reason to make it weak. The effect it has on the dynamic loader is the same if it's weak or non-weak. Exporting the symbol from the DSO changes how the static linker links things against the DSO. e.g. They start importing the now-exported symbol rather than embedding their own copy of the symbol from the builtins archive. This breaks if the DSO at build-time has __emutls_get_address, but the DSO at load-time doesn't. I suspect that's what happened with the NDK bug. The bug's libavutil.so depends only on platform DSOs The NDK has had this same problem with the unwinder in the past, but now the unwinder symbols are hidden. |
@rprichard So are you saying we shouldn't backport this? |
I wondered if this commit needed to be reverted, but OTOH, maybe the NDK bug is user error for mixing incompatible versions of |
3rd party libraries may build with different version of libc++, and even worse, for example qt5 does not support ndk 22+. i think the commit fixes a rare case but breaks binary compatibility. an easy solution for that case is not using tls var across dso, instead we can set/get the value via a function, just like errno. |
Reverting the change would also be a break in compatibility. As I said on the NDK bug for this, yes, we'd have been better off not taking this change in r23b, but it's too late for that now. Aiui the problem isn't mismatched versions of libc++, the problem is apps shipping an older libc++ than they built against. If the newer library is shipped there's no incompatibility. It's not at all unexpected that compiling against a newer version of a library than you'll run with can cause problems. |
Extended Description
Please merge b8f04a6.
[PATCH] [builtins] Try to ensure single copy of emulated TLS state
Multiple copies of emulated TLS state means inconsistent results when
accessing the same thread-local variable from different shared objects
(android/ndk#1551). Making
__emutls_get_address
be a weak default visibility symbol should make the dynamic linker
ensure only a single copy gets used at runtime. This is best-effort, but
the more robust approach of putting emulated TLS into its own shared
object would (a) be a much bigger change, and (b) shared objects are
pretty heavyweight, and adding a new one to a space-constrained
environment isn't an easy sell. Given the expected rarity of direct
accesses to emulated TLS variables across different shared objects, the
best-effort approach should suffice.
The text was updated successfully, but these errors were encountered: