Skip to content

Conversation

@sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Nov 5, 2024

The main thread TLS region get initialized via a static constructor in library_wasm_worker.c. Without this change programs that don't otherwise reference library_wasm_worker.c will not have this static constructor run.

Fixes: #22852

@sbc100 sbc100 requested review from juj and kripken November 5, 2024 22:36
Copy link
Member

@kripken kripken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess there is no size downside here since that library has a single C file, and is almost always referred to anyhow?

@sbc100
Copy link
Collaborator Author

sbc100 commented Nov 5, 2024

I guess there is no size downside here since that library has a single C file, and is almost always referred to anyhow?

yes, exactly. Passing -sWASM_WORKERS but not references that file should be a outlier case.

@sbc100 sbc100 requested a review from kripken November 5, 2024 23:35
@sbc100 sbc100 enabled auto-merge (squash) November 5, 2024 23:35
The main thread TLS region get initialized via a static constructor
in `library_wasm_worker.c`.  Without this change programs that don't
otherwise reference `library_wasm_worker.c` will not have this static
constructor run.

Fixes: emscripten-core#22852
@sbc100 sbc100 merged commit 94f4173 into emscripten-core:main Nov 6, 2024
28 checks passed
@sbc100 sbc100 deleted the fix_ww_init branch November 6, 2024 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

setjmp/longjmp and sigsetjmp/siglongjmp hang if -sWASM_WORKERS is used

2 participants