All of lore.kernel.org
 help / color / mirror / Atom feed
From: Romain Naour <romain.naour@gmail.com>
To: buildroot@buildroot.org
Cc: Romain Naour <romain.naour@gmail.com>
Subject: [Buildroot] [PATCH] arch/xtensa: xtensa little endian target requires an overlay file
Date: Sun,  4 Sep 2022 22:04:09 +0200	[thread overview]
Message-ID: <20220904200409.3153993-1-romain.naour@gmail.com> (raw)

Using a custom Xtensa processor configuration select little endian
by default. But xtensa for little endian requires an xtensa overlay
file containing a version of xtensa-config.h header for gcc setting
XCHAL_HAVE_BE to 0.

When BR2_XTENSA_LITTLE_ENDIAN is selected, we have to check if
an overlay file is provided. Error out if BR2_XTENSA_OVERLAY_FILE
is empty.

Fixes:
http://autobuild.buildroot.org/results/f0b/f0ba47d2534aeb3cc2921124aa639ae3aa072b9b

xtensa-buildroot-linux-uclibc/bin/ld: ldso/ldso/ld-uClibc_so.a(ldso.oS): compiled for a big endian system and target is little endian

[1] https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=include/xtensa-config.h;hb=2ee5e4300186a92ad73f1a1a64cb918dc76c8d67#l28

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Max Filippov <jcmvbkbc@gmail.com>
---
 arch/arch.mk.xtensa | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arch.mk.xtensa b/arch/arch.mk.xtensa
index fd410f6bfa..516d77bf91 100644
--- a/arch/arch.mk.xtensa
+++ b/arch/arch.mk.xtensa
@@ -34,3 +34,11 @@ define arch-xtensa-overlay-extract
 		$(ARCH_XTENSA_OVERLAY_FILE) | \
 	$(TAR) --strip-components=1 -C $(1) $(TAR_OPTIONS) - $(2)
 endef
+
+# By default GCC build xtensa for Big Endian. To build for Little Endian a
+# Xtensa overlay file must be provided.
+ifeq ($(BR2_XTENSA_LITTLE_ENDIAN),y)
+ifeq ($(call qstrip,$(BR2_XTENSA_OVERLAY_FILE)),)
+$(error No xtensa overlay file provided. Check your BR2_XTENSA_OVERLAY_FILE setting)
+endif
+endif
-- 
2.34.3

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

             reply	other threads:[~2022-09-04 20:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-04 20:04 Romain Naour [this message]
2022-09-06 15:56 ` [Buildroot] [PATCH] arch/xtensa: xtensa little endian target requires an overlay file Yann E. MORIN
2022-09-06 16:54   ` Romain Naour
2022-09-07 22:59   ` Max Filippov
2022-09-08  9:46 ` Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220904200409.3153993-1-romain.naour@gmail.com \
    --to=romain.naour@gmail.com \
    --cc=buildroot@buildroot.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.