Skip to content

Commit

Permalink
tools: Optimize size by wasm-opt
Browse files Browse the repository at this point in the history
wasm-opt is a tool from binaryen that can do
further optimization for Wasm module, to reduce
the size of bytecode.

Signed-off-by: Huang Qi <[email protected]>
  • Loading branch information
no1wudi committed Nov 18, 2024
1 parent fee82bd commit 10595e7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tools/Wasm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ define LINK_WASM
$(if $(RETVAL), \
$(error wasm build failed for $(PROGNAME).wasm) \
) \
$(call WAMR_AOT_COMPILE) \
$(eval RETVAL=$(shell $(WASI_SDK_PATH)/wasm-opt -Oz -o $(BINDIR)$(DELIM)wasm$(DELIM)$(PROGNAME).wasm \
$(BINDIR)$(DELIM)wasm$(DELIM)$(PROGNAME).wasm || echo 1;)) \
$(if $(RETVAL), \
$(error wasm build failed for $(PROGNAME).wasm) \
) \
$(call WAMR_AOT_COMPILE) \
) \
)
endef
Expand Down

0 comments on commit 10595e7

Please sign in to comment.