Skip to content

Commit f616fa1

Browse files
committed
Fix user-space emulation requiring ELF loader
User-space emulation tests were failing because ENABLE_ELF_LOADER defaulted to 0, preventing ELF file loading. The fix automatically enables ELF_LOADER when SYSTEM=0, as user-space mode always requires it to load test ELF files.
1 parent e362fba commit f616fa1

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

Makefile

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,6 @@ CFLAGS += -include src/common.h -Isrc/
2020

2121
OBJS_EXT :=
2222

23-
# In the system test suite, the executable is an ELF file (e.g., MMU).
24-
# However, the Linux kernel emulation includes the Image, DT, and
25-
# root filesystem (rootfs). Therefore, the test suite needs this
26-
# flag to load the ELF and differentiate it from the kernel emulation.
27-
ENABLE_ELF_LOADER ?= 0
28-
$(call set-feature, ELF_LOADER)
29-
3023
# Enable MOP fusion, easier for ablation study
3124
ENABLE_MOP_FUSION ?= 1
3225
$(call set-feature, MOP_FUSION)
@@ -43,6 +36,18 @@ $(call set-feature, LOG_COLOR)
4336
ENABLE_SYSTEM ?= 0
4437
$(call set-feature, SYSTEM)
4538

39+
# In the system test suite, the executable is an ELF file (e.g., MMU).
40+
# However, the Linux kernel emulation includes the Image, DT, and
41+
# root filesystem (rootfs). Therefore, the test suite needs this
42+
# flag to load the ELF and differentiate it from the kernel emulation.
43+
# User-space emulation (SYSTEM=0) always needs ELF loader.
44+
ifeq ($(ENABLE_SYSTEM), 0)
45+
override ENABLE_ELF_LOADER := 1
46+
else
47+
ENABLE_ELF_LOADER ?= 0
48+
endif
49+
$(call set-feature, ELF_LOADER)
50+
4651
ifeq ($(call has, SYSTEM), 1)
4752
OBJS_EXT += system.o
4853
endif

0 commit comments

Comments
 (0)