From: Simon Glass <simon.glass@canonical.com> EFI applications use their own entry point (CRT0) and run on top of UEFI firmware, so the bare-metal startup code (start.o), machine-mode trap handler (mtrap.o) and generic DRAM init (dram.o) are not needed and cause link conflicts. Skip these objects when CONFIG_EFI_APP is set. Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Simon Glass <simon.glass@canonical.com> --- arch/riscv/cpu/Makefile | 7 ++++++- arch/riscv/cpu/generic/Makefile | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/riscv/cpu/Makefile b/arch/riscv/cpu/Makefile index 6bf6f911c67..331810b819d 100644 --- a/arch/riscv/cpu/Makefile +++ b/arch/riscv/cpu/Makefile @@ -2,6 +2,11 @@ # # Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com> +ifndef CONFIG_EFI_APP extra-y = start.o +endif -obj-y += cpu.o mtrap.o +obj-y += cpu.o +ifndef CONFIG_EFI_APP +obj-y += mtrap.o +endif diff --git a/arch/riscv/cpu/generic/Makefile b/arch/riscv/cpu/generic/Makefile index a9be44ec387..7eda97d2f55 100644 --- a/arch/riscv/cpu/generic/Makefile +++ b/arch/riscv/cpu/generic/Makefile @@ -2,4 +2,6 @@ # # Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com> +ifndef CONFIG_EFI_APP obj-y += dram.o +endif -- 2.43.0