aboutsummaryrefslogtreecommitdiff
path: root/src/link
diff options
context:
space:
mode:
authorTakeshi Yoneda <takeshi@tetrate.io>2021-08-24 21:03:50 +0900
committerGitHub <noreply@github.com>2021-08-24 14:03:50 +0200
commit5c79370e9c3edee271d4f0e65e718d12b8db8a1e (patch)
tree3c99651b1f930a547a87e8c94da90734d9f2aed2 /src/link
parent8a37fe21764659c5f742454a4eb9950b5c747a42 (diff)
downloadzig-5c79370e9c3edee271d4f0e65e718d12b8db8a1e.tar.gz
zig-5c79370e9c3edee271d4f0e65e718d12b8db8a1e.zip
wasm: pass --export-dynamic to wasm-ld for WASI reactors. (#9605)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
Diffstat (limited to 'src/link')
-rw-r--r--src/link/Wasm.zig8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/link/Wasm.zig b/src/link/Wasm.zig
index 3c3cd4eef3..fc559948c4 100644
--- a/src/link/Wasm.zig
+++ b/src/link/Wasm.zig
@@ -765,12 +765,8 @@ fn linkWithLLD(self: *Wasm, comp: *Compilation) !void {
if (self.base.options.wasi_exec_model == .reactor) {
// Reactor execution model does not have _start so lld doesn't look for it.
try argv.append("--no-entry");
- // Make sure "_initialize" is exported even if this is pure Zig WASI reactor
- // where WASM_SYMBOL_EXPORTED flag in LLVM is not set on _initialize.
- try argv.appendSlice(&[_][]const u8{
- "--export",
- "_initialize",
- });
+ // Make sure "_initialize" and other used-defined functions are exported if this is WASI reactor.
+ try argv.append("--export-dynamic");
}
} else {
try argv.append("--no-entry"); // So lld doesn't look for _start.