Description
Is there a specification to mark whether a component model should be (as a suggestion) a static library or a dynamic library?
Assume lib.wasm
is a library, app.wasm
is an application, and depends on lib.wasm
.
- Static library means the product is only one file [
app-final.wasm
] - Dynamic library means the product is two files [
app-final.wasm
,lib.wasm
]- Unless the user forces static linking of this library (similar to
--static-link lib.wasm
)
- Unless the user forces static linking of this library (similar to
Motivation
Although dynamic linking hell is a very bad problem, I think limited dynamic linking helps reduce the overall size of the final executable file
I developed a command line tool legion.wasm
, which automatically looks for legion-plugin.wasm
when encountering unknown instructions.
The plugin needs to use some definitions of the original application, which makes the plugin even larger.
Therefore, I hope there is some convention to specify that some dependencies should be compiled as a shared library as a whole, This can effectively reduce the overall size.