[Concept,12/15] riscv: Exclude unwanted startup code for EFI app builds

Message ID 20260212001410.1919749-13-sjg@u-boot.org
State New
Headers
Series riscv: Add EFI-application support |

Commit Message

Simon Glass Feb. 12, 2026, 12:14 a.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

The EFI application uses its own CRT0 entry point instead of the
bare-metal start.o file. Exclude it so it is not linked as the entry
point to the binary.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 arch/riscv/Makefile | 2 ++
 1 file changed, 2 insertions(+)
  

Patch

diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile
index 6f80f4a7108..aaa5a02e17c 100644
--- a/arch/riscv/Makefile
+++ b/arch/riscv/Makefile
@@ -55,7 +55,9 @@  endif
 PLATFORM_CPPFLAGS	+= $(ARCH_FLAGS)
 CFLAGS_EFI		+= $(ARCH_FLAGS)
 
+ifndef CONFIG_EFI_APP
 head-y := arch/riscv/cpu/start.o
+endif
 
 libs-y += arch/riscv/cpu/
 libs-y += arch/riscv/cpu/$(CPU)/