From d86755c1a86b134da13db20604ba8dab6fa4eab2 Mon Sep 17 00:00:00 2001 From: ZauberNerd Date: Fri, 18 Mar 2022 10:42:32 +0000 Subject: [PATCH] targets/wasi: remove --export-dynamic linker flag Exporting symbols seems to embed them in the WASM exports section which causes wasmtime to fail: https://github.com/bytecodealliance/wasmtime/issues/2587 As a workaround, it is possible to specify the `--allow-unknown-exports` flag on wasmtime. But as discussed in the above linked issue, this seems to only be a workaround. For the Rust compiler the fix was to remove the `--export-dynamic` linker flag when targeting `wasm32-wasi`: https://github.com/rust-lang/rust/pull/81255 Which is waht this commit does for Tinygo too. --- targets/wasi.json | 1 - 1 file changed, 1 deletion(-) diff --git a/targets/wasi.json b/targets/wasi.json index 9caec7a574..9ae96a338d 100644 --- a/targets/wasi.json +++ b/targets/wasi.json @@ -11,7 +11,6 @@ "ldflags": [ "--allow-undefined", "--stack-first", - "--export-dynamic", "--no-demangle" ], "emulator": ["wasmtime"],