
"If mylibrary_init was mistakenly typed as mylibraryinit, then the final binary would import the mylibraryinit symbol instead of calling the linked mylibrary_init C symbol."
"All native platforms consider undefined symbols to be an error by default. Therefore, by passing --allow-undefined rustc introduces surprising behavior on WebAssembly targets."
"If the final WebAssembly binary imports unexpected symbols, then it's likely the binary won't be runnable in the desired embedding, as the desired embedding probably doesn't provide the symbol as a definition."
Mistakenly typing mylibrary_init as mylibraryinit results in importing the wrong symbol. If mylibrary is not linked, an undefined symbol error occurs instead of a linker error. Tools like wasm-bindgen may produce unclear error messages. Web errors can indicate unexpected symbol imports, masking the true issue of undefined symbols. Native platforms treat undefined symbols as errors, but WebAssembly's behavior can be surprising with --allow-undefined. The change aims to align WebAssembly with native behavior, improving diagnostics without significantly breaking existing functionality.
Read at InfoWorld
Unable to calculate read time
Collection
[
|
...
]