Skip to content

Commit 734cdcd

Browse files
committed
Tweak emcc CFLAGS
The build directory has a build dependency file (.o.d), SHA checksum file of prebuilt artifact and else which are useless for WASM execution. Additionally, these files increase the size of WASM, leading to longer download time for WASM. Thus, only embed mandatory artifacts when build. Enlarge the MEM_SIZE to make all ELF runnable.
1 parent 096a27d commit 734cdcd

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

mk/wasm.mk

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,19 @@ CFLAGS_emcc += -sINITIAL_MEMORY=2GB \
2929
-s"EXPORTED_FUNCTIONS=$(EXPORTED_FUNCS)" \
3030
-sSTACK_SIZE=4MB \
3131
-sPTHREAD_POOL_SIZE=navigator.hardwareConcurrency \
32-
--embed-file build@/ \
32+
--embed-file build/jit-bf.elf@/jit-bf.elf \
33+
--embed-file build/coro.elf@/coro.elf \
34+
--embed-file build/fibonacci.elf@/fibonacci.elf \
35+
--embed-file build/hello.elf@/hello.elf \
36+
--embed-file build/ieee754.elf@/ieee754.elf \
37+
--embed-file build/perfcount.elf@/perfcount.elf \
38+
--embed-file build/readelf.elf@/readelf.elf \
39+
--embed-file build/smolnes.elf@/smolnes.elf \
3340
--embed-file build/riscv32@/riscv32 \
41+
--embed-file build/DOOM1.WAD@/DOOM1.WAD \
42+
--embed-file build/id1/pak0.pak@/id1/pak0.pak \
3443
--embed-file build/timidity@/etc/timidity \
35-
-DMEM_SIZE=0x40000000 \
44+
-DMEM_SIZE=0x60000000 \
3645
-DCYCLE_PER_STEP=2000000 \
3746
--pre-js $(WEB_JS_RESOURCES)/pre.js \
3847
-O3 \

0 commit comments

Comments
 (0)