Skip to content

Commit 2497867

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 2149996 commit 2497867

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
@@ -31,18 +31,6 @@ $(call set-feature, LOG_COLOR)
3131
ENABLE_SYSTEM ?= 0
3232
$(call set-feature, SYSTEM)
3333

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-
4634
ifeq ($(call has, SYSTEM), 1)
4735
OBJS_EXT += system.o
4836
endif
@@ -78,6 +66,22 @@ endif
7866
ENABLE_ARCH_TEST ?= 0
7967
$(call set-feature, ARCH_TEST)
8068

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

0 commit comments

Comments
 (0)