authorgravatar for takeshi@tetrate.ioTakeshi Yoneda <takeshi@tetrate.io> 2021-08-24 21:03:50+09:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2021-08-24 14:03:50+02:00
log5c79370e9c3edee271d4f0e65e718d12b8db8a1e
tree3c99651b1f930a547a87e8c94da90734d9f2aed2
parent8a37fe21764659c5f742454a4eb9950b5c747a42
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

wasm: pass --export-dynamic to wasm-ld for WASI reactors. (#9605)

Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>

1 files changed, 2 insertions(+), 6 deletions(-)

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