summaryrefslogtreecommitdiff
path: root/tool/wasm-clangw
diff options
context:
space:
mode:
Diffstat (limited to 'tool/wasm-clangw')
-rwxr-xr-xtool/wasm-clangw9
1 files changed, 9 insertions, 0 deletions
diff --git a/tool/wasm-clangw b/tool/wasm-clangw
new file mode 100755
index 0000000000..9ebdfda75a
--- /dev/null
+++ b/tool/wasm-clangw
@@ -0,0 +1,9 @@
+#!/bin/sh
+# A Clang wrapper script to fake the clang linker driver.
+# Clang linker automatically uses wasm-opt with -O if it found.
+# However optimization before asyncify causes misoptimization,
+# so wrap clang to insert our fake wasm-opt, which does nothing, in PATH.
+
+src_dir="$(cd "$(dirname "$0")/../wasm" && pwd)"
+export PATH="$src_dir:$PATH"
+exec "$@"