From: Simon Glass <simon.glass@canonical.com> The RISC-V LDFLAGS_u-boot includes -static -pie, which conflicts with the -shared flag needed for building EFI applications as shared objects. Guard these flags with ifndef CONFIG_EFI_APP so that EFI app builds can use their own linker flags. Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Simon Glass <simon.glass@canonical.com> --- arch/riscv/config.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/riscv/config.mk b/arch/riscv/config.mk index 9f16dda92a0..123b5d24cca 100644 --- a/arch/riscv/config.mk +++ b/arch/riscv/config.mk @@ -27,7 +27,9 @@ endif PLATFORM_CPPFLAGS += -ffixed-x3 -fpic PLATFORM_RELFLAGS += -fno-common -ffunction-sections -fdata-sections +ifndef CONFIG_EFI_APP LDFLAGS_u-boot += --gc-sections -static -pie +endif EFI_CRT0 := crt0_riscv_efi.o EFI_RELOC := reloc_riscv_efi.o -- 2.43.0