Skip to content

Commit 6a15181

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 8234e97 commit 6a15181

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
@@ -15,13 +15,6 @@ CFLAGS += -include src/common.h -Isrc/
1515

1616
OBJS_EXT :=
1717

18-
# In the system test suite, the executable is an ELF file (e.g., MMU).
19-
# However, the Linux kernel emulation includes the Image, DT, and
20-
# root filesystem (rootfs). Therefore, the test suite needs this
21-
# flag to load the ELF and differentiate it from the kernel emulation.
22-
ENABLE_ELF_LOADER ?= 0
23-
$(call set-feature, ELF_LOADER)
24-
2518
# Enable MOP fusion, easier for ablation study
2619
ENABLE_MOP_FUSION ?= 1
2720
$(call set-feature, MOP_FUSION)
@@ -38,6 +31,18 @@ $(call set-feature, LOG_COLOR)
3831
ENABLE_SYSTEM ?= 0
3932
$(call set-feature, SYSTEM)
4033

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

0 commit comments

Comments
 (0)