Skip to content

Is it intended behavior that -shared -s SIDE_MODULE=1 changes function signature? #17559

Answered by kripken
eagleoflqj asked this question in Q&A
Discussion options

You must be logged in to vote

I think what's going on here is that building with -c does not link the file. So it is still a wasm object file. After that object file is linked and we produce an executable it will be legalized (if it needs to be). In this case, we won't legalize anyhow since it is just called from inside wasm - it's not an external interface..

Making a side module does emit an executable, so we do end up legalizing - it's an external interface, we're calling a function from another module, and we need to be fully general there.

Note that you can control this, by setting -sNO_LEGALIZE_JS_FFI to disable the legalization (though I'm not sure if that is supported with side modules or not).

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@eagleoflqj
Comment options

Answer selected by eagleoflqj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants