-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Fix __errno_location under wasm workers. NFC
#22744
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
__EMSCRIPTEN_PTHREADS__ in __errno_location.c
a55f4a2 to
d68d47f
Compare
|
@eyebrowsoffire I'm running into the fact the |
8180dba to
2559ddc
Compare
2559ddc to
975a5f4
Compare
__EMSCRIPTEN_PTHREADS__ in __errno_location.c__errno_location under wasm workers. NFC
|
Updated PR description and title to better reflect the purpose of this change. |
tools/system_libs.py
Outdated
| @classmethod | ||
| def get_default_variation(cls, **kwargs): | ||
| return super().get_default_variation(is_mt=settings.PTHREADS, is_ww=settings.WASM_WORKERS and not settings.PTHREADS, **kwargs) | ||
| return super().get_default_variation(is_mt=settings.PTHREADS, is_ww=settings.SHARED_MEMORY and not settings.PTHREADS, **kwargs) |
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.
Is this needed in this PR?
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.
@eyebrowsoffire, is this maybe enough to resolve #22683
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 reason this is needed for this PR is because it makes __errno_location into a function that, in non-threads build, has TLS erased, making it incompatible with -sSHARED_MEMORY, which triggers the problem found in #22683. Basically it make the problem found in #22683 happen is way more cases, including simple hello world programs.
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.
lgtm otherwise
5e6053c to
3ec754a
Compare
Previously the wasm workers build of `__errno_location` was using the single threaded code path which doesn't use a thead local location. In addition this change avoids the use of `__EMSCRIPTEN_PTHREADS__` in `__errno_location.c` which is helpful for unifying the shared memory libc build. See emscripten-core#22735.
3ec754a to
d260235
Compare
Previously the wasm workers build of
__errno_locationwas using thesingle threaded code path which doesn't use a thead local location.
In addition this change avoids the use of
__EMSCRIPTEN_PTHREADS__in__errno_location.cwhich is helpful for unifying the shared memorylibc build. See #22735.