From: Jiaxun Yang <jiaxun.yang@flygoat.com>
Date: Tue, 18 Jun 2024 13:56:04 +0000 (+0100)
Subject: xtensa: Define PLATFORM_ELFFLAGS
X-Git-Tag: v2025.01-rc5-pxa1908~428^2~8
X-Git-Url: http://git.dujemihanovic.xyz/img/%7B%7B?a=commitdiff_plain;h=76a0b9f5b4bf96523398bf07c907efe3e353754a;p=u-boot.git

xtensa: Define PLATFORM_ELFFLAGS

u-boot.elf target requires it to work.

Tested-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---

diff --git a/arch/xtensa/config.mk b/arch/xtensa/config.mk
index b0809999e4..200b66f850 100644
--- a/arch/xtensa/config.mk
+++ b/arch/xtensa/config.mk
@@ -7,3 +7,9 @@ PLATFORM_CPPFLAGS += -D__XTENSA__ -mlongcalls -mforce-no-pic \
 		     -ffunction-sections -fdata-sections
 
 LDFLAGS_FINAL += --gc-sections
+
+ifeq ($(CONFIG_SYS_BIG_ENDIAN),y)
+PLATFORM_CPPFLAGS += -B xtensa -O elf32-xtensa-be
+else
+PLATFORM_ELFFLAGS += -B xtensa -O elf32-xtensa-le
+endif