Skip to content

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

Merged
sunfishcode merged 2 commits into
mainfrom
sunfishcode/dont-run-ctors-on-exports
Sep 29, 2022
Merged

Don't run static constructors on arbitrary user exports.#328
sunfishcode merged 2 commits into
mainfrom
sunfishcode/dont-run-ctors-on-exports

Conversation

@sunfishcode

Copy link
Copy Markdown
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.

@yamt yamt left a comment

Copy link
Copy Markdown
Contributor

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.

3 participants