| ... | @@ -765,12 +765,8 @@ fn linkWithLLD(self: *Wasm, comp: *Compilation) !void { | ... | @@ -765,12 +765,8 @@ fn linkWithLLD(self: *Wasm, comp: *Compilation) !void { |
| 765 | if (self.base.options.wasi_exec_model == .reactor) { | 765 | if (self.base.options.wasi_exec_model == .reactor) { |
| 766 | // Reactor execution model does not have _start so lld doesn't look for it. | 766 | // Reactor execution model does not have _start so lld doesn't look for it. |
| 767 | try argv.append("--no-entry"); | 767 | try argv.append("--no-entry"); |
| 768 | // Make sure "_initialize" is exported even if this is pure Zig WASI reactor | 768 | // Make sure "_initialize" and other used-defined functions are exported if this is WASI reactor. |
| 769 | // where WASM_SYMBOL_EXPORTED flag in LLVM is not set on _initialize. | 769 | try argv.append("--export-dynamic"); |
| 770 | try argv.appendSlice(&[_][]const u8{ | | |
| 771 | "--export", | | |
| 772 | "_initialize", | | |
| 773 | }); | | |
| 774 | } | 770 | } |
| 775 | } else { | 771 | } else { |
| 776 | try argv.append("--no-entry"); // So lld doesn't look for _start. | 772 | try argv.append("--no-entry"); // So lld doesn't look for _start. |