[Buildroot] [PATCH] arch/xtensa: xtensa little endian target requires an overlay file

Yann E. MORIN yann.morin.1998 at free.fr
Thu Sep 8 09:46:36 UTC 2022


Romain, All,

On 2022-09-04 22:04 +0200, Romain Naour spake thusly:
> 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 at gmail.com>
> Cc: Max Filippov <jcmvbkbc at 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

Following the discussion in this thread, and the feedback from Max, I've
applied the changes I suggested, and then applied to master, thanks.

Regards,
Yann E. MORIN.

> -- 
> 2.34.3
> 
> _______________________________________________
> buildroot mailing list
> buildroot at buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'



More information about the buildroot mailing list