-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Move pthread TLS state native code using wasm globals #12839
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
Conversation
a4234ec
to
3b16cc3
Compare
is_runtime_thread: | ||
|
||
.globl pthread_self | ||
pthread_self: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, so any function that is defined in .s
file gets a _
prefixed to it? So pthread_self
here becomes _pthread_self
?
And any functions defined in C/C++ files do not get a _
prefix?
That is actually pretty backwards: in native compilers all assembly code is unprefixed, and all C/C++ code is prefixed with _
. Is there a specific reason why this was flipped for Wasm backend? That seems a bit arbitrary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The _
prefix is added to all native symbols by the emscripten JS code. We do this purely for legacy/asm.js compatability.
The actual compiler, llvm, does not emit the _
mangling for any symbols. I think maybe the _
mangling is some kind of mac or windows convention. It certainly doesn't exist on windows.
From the linker's POV there is no way to way to the difference between a C symbol and an assembler symbols. They are all just "native" sybmols and we mangle all of them when we import them into JS.
One day we should completely remove the mangling...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created an issue to remove this mangling completely one day: #12844
946f80d
to
e7f8bc6
Compare
e7f8bc6
to
9ef57be
Compare
bcc4c4f
to
98c0f00
Compare
This moves pthead_self and other thread state into native code.
98c0f00
to
34142fd
Compare
This appears to have regressed something:
That fails from this commit, due to
|
Oh, nm, I had to clear the cache... I forgot we don't bump the version number for things like that any more...sorry for the noise. |
This moves pthead_self and other thread state into
native code.