@ -4,8 +4,7 @@ WASI_CC := ${WASI_ROOT}/bin/clang
WASI_CFLAGS := --target= wasm32 \
--sysroot= ${ WASI_ROOT } /share/wasi-sysroot \
-z stack-size= 4096 \
-nostdlib \
-O0 -g -Wall \
-O2 -nostdlib \
-Wl,--no-entry \
-Wl,--initial-memory= 65536 \
-Wl,--export-all \
@ -16,7 +15,8 @@ WASI_CFLAGS := --target=wasm32 \
WAMR := /opt/wamr
IWASM_LIB := /opt/wamr-libiwasm
CC := gcc
CFLAGS := -I. -include arch/${ ARCH } /lib.c -O0 -g -m32 -fomit-frame-pointer
# NOTE: Without -fomit-frame-pointer I get "error: bp cannot be used in ‘ asm’ here"
CFLAGS := -I. -O2 -m32 -ffunction-sections -fomit-frame-pointer
LDFLAGS := -Wl,-T linker.ld $^ -Wl,--build-id= none -static -nostdlib -m32 \
-Wl,-rpath,${ IWASM_LIB } -L${ IWASM_LIB } -liwasm
INCL := -I${ WAMR } /core/iwasm/include \
@ -29,7 +29,6 @@ INCL := -I${WAMR}/core/iwasm/include \
WAMRC := /opt/wamr-wamrc/wamrc
WAMRCFLAGS := --target= i386 --format= object
XXD := busybox xxd
WASM2C := wasm2c
################################################################
@ -45,7 +44,7 @@ ${BUILD_DIR}/%/module.wasm: %.c
# ${WAMRC} ${WAMRCFLAGS} -o ${BUILD_DIR}/$*/system.o ${BUILD_DIR}/$*/module.wasm
#
# ${BUILD_DIR}/startup.o: arch/bochs/startup.s
# ${CC} $< ${CFLAGS} -c -ffunction-sections -o $@
# ${CC} $< ${CFLAGS} -c -o $@
#
# ${BUILD_DIR}/%/system.elf: ${BUILD_DIR}/%/system.o ${BUILD_DIR}/startup.o
# ${CC} ${LDFLAGS} -o $@
@ -66,10 +65,10 @@ ${BUILD_DIR}/%/system.o: ${BUILD_DIR}/%/module_wasm.c
-e " s/__WASM_ARRAY__/build_bochs_ $* _module_aot/g " \
-e " s/__WASM_ARRAY_LEN__/build_bochs_ $* _module_aot_len/g " \
${ BUILD_DIR } /$* /module_host.c
${ CC } ${ CFLAGS } ${ INCL } -c -ffunction-sections ${ BUILD_DIR } /$* /module_host.c -o $@
${ CC } ${ CFLAGS } ${ INCL } -c ${ BUILD_DIR } /$* /module_host.c -o $@
${BUILD_DIR}/startup.o : arch /bochs /startup .s
${ CC } $< ${ CFLAGS } -c -ffunction-sections -o $@
${ CC } $< ${ CFLAGS } -c -o $@
${BUILD_DIR}/%/system.elf : ${BUILD_DIR }/%/system .o ${BUILD_DIR }/startup .o
${ CC } ${ LDFLAGS } -o $@