component-model icon indicating copy to clipboard operation
component-model copied to clipboard

Multiple `cabi_start` functions in Canonical ABI

Open sunfishcode opened this issue 3 years ago • 0 comments

The component AST permits multiple start functions. Currently, the canonical ABI mangles them with the cabi version number and the signature, so if two start functions have the same signature, they'll mangle to the same thing. However, core wasm doesn't permit two exports to have the same name.

One option would be to add a sequence number to the mangling, like cabi_start{sequence=0,cabi=0.1}: func() or so. so that multiple start functions have distinct names, and canonicalABI consumers know what order to call them in.

sunfishcode avatar Aug 15 '22 15:08 sunfishcode