bytecodealliance / wizer

The WebAssembly Pre-Initializer
Apache License 2.0
942 stars 55 forks source link

Avoid duplicate call to _initialize with `-f=_initialize` #84

Closed Mrmaxmeier closed 1 year ago

Mrmaxmeier commented 1 year ago

Hi,

I'm using wizer to pre-initialize reactor modules with --init-func="_initialize". wasi-libc recently added a check against calling the reactor initializer multiple times (https://github.com/WebAssembly/wasi-libc/pull/388), which shows that wizer calls it twice in this case. (Once because the reactor initializer is automatically called and a second time because I'm setting it as the init function.)

I think it's reasonable to simply skip the second call for --init-func=_initialize. :slightly_smiling_face: