Skip to content
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

Don't run static constructors on arbitrary user exports. #328

Merged
merged 2 commits into from
Sep 29, 2022

Conversation

sunfishcode
Copy link
Member

Previously, "new-style commmands" considered every user-defined export to be a potential command entrypoint, so wasi-libc and wasm-ld cooperated to run the user's static constructors on each entrypoint.

This form of new-style command turned out not to be useful, and it interferes with some use cases, so disable it.

This is done by making an explicit call to __wasm_call_ctors, which tells wasm-ld that it shouldn't synthesize any calls to __wasm_call_ctors on its own.

Previously, "new-style commmands" considered every user-defined
export to be a potential command entrypoint, so wasi-libc and wasm-ld
cooperated to run the user's static constructors on each entrypoint.

This form of new-style command turned out not to be useful, and it
interferes with some use cases, so disable it.

This is done by making an explicit call to `__wasm_call_ctors`, which
tells wasm-ld that it shouldn't synthesize any calls to
`__wasm_call_ctors` on its own.
Copy link
Contributor

@yamt yamt left a comment

Choose a reason for hiding this comment

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

lgtm, thank you.

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.

None yet

3 participants