Skip to content

Commit 2cc7b01

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 f6b94f1 commit 2cc7b01

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

Makefile

Lines changed: 16 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)
@@ -80,6 +73,22 @@ endif
8073
ENABLE_ARCH_TEST ?= 0
8174
$(call set-feature, ARCH_TEST)
8275

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+
8392
# ThreadSanitizer support
8493
# TSAN on x86-64 memory layout:
8594
# Shadow: 0x02a000000000 - 0x7cefffffffff (reserved by TSAN)

0 commit comments

Comments
 (0)