Skip to content

Commit 3f48e09

Browse files
committed
Fix insufficient memory on some platforms
[Problem] The MEM_SIZE is hard-corded, but on some platforms, memory is insufficient. Perhaps we should allow user to config accordingly [Solution] Expose an environment variable, CONFIG_MEM_SIZE, to allow user config the memory size with it [Test] * before $> make $> ./build/rv32emu ./build/hello.elf rv32emu: src/riscv.c:199: rv_create: Assertion `attr->mem' failed. Aborted (core dumped) * after $> CONFIG_MEM_SIZE=0x40000000 make $> ./build/rv32emu ./build/hello.elf Hello World! Hello World! Hello World! Hello World! Hello World! inferior exit code 0 [Reference] [#488](#448)
1 parent a968310 commit 3f48e09

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ LDFLAGS += -flto=thin
3737
endif
3838
endif
3939

40+
# Allow user to config the memory size accordingly
41+
ifdef CONFIG_MEM_SIZE
42+
CFLAGS += -DMEM_SIZE=$(CONFIG_MEM_SIZE)
43+
endif
44+
4045
# Disable Intel's Control-flow Enforcement Technology (CET)
4146
CFLAGS += $(CFLAGS_NO_CET)
4247

0 commit comments

Comments
 (0)