disable -O2

This commit is contained in:
2026-02-05 17:55:22 +01:00
parent fc57777a5b
commit 6307a01b6f

View File

@ -4,7 +4,7 @@ WASI_CC := ${WASI_ROOT}/bin/clang
WASI_CFLAGS := --target=wasm32 \
--sysroot=${WASI_ROOT}/share/wasi-sysroot \
-z stack-size=4096 \
-O2 -nostdlib \
-O0 -nostdlib \
-Wl,--no-entry \
-Wl,--initial-memory=65536 \
-Wl,--export-all \
@ -15,17 +15,15 @@ WASI_CFLAGS := --target=wasm32 \
WAMR := /opt/wamr
IWASM_LIB := /opt/wamr-libiwasm
CC := gcc
# 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
# NOTE: When compiling I get "error: bp cannot be used in asm here"
# I could remove "ebp" from the clobber list (ARCH_ASM_CLOBBER_ALL) or
# use the -fomit-frame-pointer flag to tell gcc it shouldn't rely on ebp for enter/leave...
CFLAGS := -I. -O0 -m32 -ffunction-sections -std=c11 -fomit-frame-pointer
LDFLAGS = -Wl,-T linker.ld $^ -Wl,--build-id=none -static -nostdlib -m32 \
-Wl,-rpath,${IWASM_LIB} -L${IWASM_LIB} -liwasm -lgcc
INCL := -I${WAMR}/core/iwasm/include \
-I${WAMR}/core/iwasm/common \
-I${WAMR}/core/shared/platform/include \
-I${WAMR}/core/shared/platform/linux \
-I${WAMR}/core/shared/mem-alloc \
-I${WAMR}/core/shared/utils \
-I${WAMR}/core/shared/utils/uncommon
-I${WAMR}/core/shared/utils \
-I${WAMR}/core/shared/platform/baremetal
WAMRC := /opt/wamr-wamrc/wamrc
WAMRCFLAGS := --target=i386 --format=object
XXD := busybox xxd
@ -87,11 +85,12 @@ BOCHS_RUNNER_ARGS = \
-V arch/bochs/vgabios.bin \
-b arch/bochs/BIOS-bochs-latest \
${BUILD_DIR}/%/trace.pb: ${BUILD_DIR}/%/system.iso
# ${BUILD_DIR}/%/trace.pb: ${BUILD_DIR}/%/system.iso
${BUILD_DIR}/%/trace.pb:
${BOCHS_RUNNER} ${BOCHS_RUNNER_ARGS} -1 \
-f ${FAIL_TRACE} \
-e $(shell dirname $<)/system.elf \
-i $(shell dirname $<)/system.iso \
-e $(shell dirname $<)/$*/system.elf \
-i $(shell dirname $<)/$*/system.iso \
-- \
-Wf,--state-file=$(shell dirname $<)/state \
-Wf,--trace-file=$(shell dirname $<)/trace.pb \