Skip to content

Commit 2b06e85

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, except for architecture tests which have their own binary loading mechanism.
1 parent 169ca45 commit 2b06e85

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

Makefile

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,6 @@ $(call set-feature, LOG_COLOR)
3636
ENABLE_SYSTEM ?= 0
3737
$(call set-feature, SYSTEM)
3838

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-
5139
ifeq ($(call has, SYSTEM), 1)
5240
OBJS_EXT += system.o
5341
endif
@@ -85,6 +73,22 @@ endif
8573
ENABLE_ARCH_TEST ?= 0
8674
$(call set-feature, ARCH_TEST)
8775

76+
# In the system test suite, the executable is an ELF file (e.g., MMU).
77+
# However, the Linux kernel emulation includes the Image, DT, and
78+
# root filesystem (rootfs). Therefore, the test suite needs this
79+
# flag to load the ELF and differentiate it from the kernel emulation.
80+
# User-space emulation (SYSTEM=0) always needs ELF loader, except for architecture tests.
81+
ifeq ($(ENABLE_SYSTEM), 0)
82+
ifneq ($(ENABLE_ARCH_TEST), 1)
83+
override ENABLE_ELF_LOADER := 1
84+
else
85+
ENABLE_ELF_LOADER ?= 0
86+
endif
87+
else
88+
ENABLE_ELF_LOADER ?= 0
89+
endif
90+
$(call set-feature, ELF_LOADER)
91+
8892
# ThreadSanitizer support
8993
# TSAN on x86-64 memory layout:
9094
# Shadow: 0x02a000000000 - 0x7cefffffffff (reserved by TSAN)

0 commit comments

Comments
 (0)