arch/xtensa: xtensa little endian target requires an overlay file
PATCH 1/1 arch/xtensa: xtensa little endian target requires an overlay file
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
--- arch/arch.mk.xtensa | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/arch.mk.xtensa +8 -0
@@ -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
Signature · 6 lines
2.34.3 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Romain, All,
On 2022-09-04 22:04 +0200, Romain Naour spake thusly:
Quoted 8 lines
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.hheader for gcc settingXCHAL_HAVE_BEto 0.When
BR2_XTENSA_LITTLE_ENDIANis selected, we have to check if an overlay file is provided. Error out ifBR2_XTENSA_OVERLAY_FILEis empty.
Well, why don't we always check for an overlay when BR2_XTENSA_CUSTOM=y?
Indeed, whether big or little endian, if the user selects a custom xtensa configuration, they better provide the overlay for that configuration, otherwise that does not make sense, and they should be using BR2_xtensa_fsf=y instead.
So, maybe just this
diff --git a/arch/arch.mk.xtensa b/arch/arch.mk.xtensa
index fd410f6bfa..9cf6f45678 100644
--- a/arch/arch.mk.xtensa
+++ b/arch/arch.mk.xtensa
@@ -10,6 +10,9 @@
# endif
################################################################################
BR_ARCH_XTENSA_OVERLAY_FILE = $(call qstrip,$(BR2_XTENSA_OVERLAY_FILE))
+ifeq ($(BR_BUILDING)$(BR2_XTENSA_CUSTOM):$(BR_ARCH_XTENSA_OVERLAY_FILE),yy:)
+$(error No xtensa overlay file provided. Check your BR2_XTENSA_OVERLAY_FILE setting)
+endif
ifneq ($(filter http://% https://% ftp://% scp://%,$(BR_ARCH_XTENSA_OVERLAY_FILE)),)
ARCH_XTENSA_OVERLAY_URL = $(BR_ARCH_XTENSA_OVERLAY_FILE)
ARCH_XTENSA_OVERLAY_FILE = $($(PKG)_DL_DIR)/$(notdir $(BR_ARCH_XTENSA_OVERLAY_FILE))Thoughts?
Regards,
Yann E. MORIN.
Quoted 36 lines
Fixes:
http://autobuild.buildroot.org/results/f0b/f0ba47d2534aeb3cc2921124aa639ae3aa072b9bxtensa-buildroot-linux-uclibc/bin/ld: ldso/ldso/ld-uClibc_so.a(ldso.oS): compiled for a big endian system and target is little endian
Signed-off-by Romain Naour <[email protected]>Cc Max Filippov <[email protected]>--- arch/arch.mk.xtensa | 8 ++++++++ 1 file changed, 8 insertions(+)arch/arch.mk.xtensa +8
-0@@ -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 +endifSignature · 6 lines
2.34.3 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------. | 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. | '------------------------------^-------^------------------^--------------------' _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Le 06/09/2022 à 17:56, Yann E. MORIN a écrit :
Quoted 36 lines
Romain, All,
On 2022-09-04 22:04 +0200, Romain Naour spake thusly:
Quoted 8 lines
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.hheader for gcc settingXCHAL_HAVE_BEto 0.When
BR2_XTENSA_LITTLE_ENDIANis selected, we have to check if an overlay file is provided. Error out ifBR2_XTENSA_OVERLAY_FILEis empty.Well, why don't we always check for an overlay when BR2_XTENSA_CUSTOM=y?
Indeed, whether big or little endian, if the user selects a custom xtensa configuration, they better provide the overlay for that configuration, otherwise that does not make sense, and they should be using BR2_xtensa_fsf=y instead.
So, maybe just this
diff --git a/arch/arch.mk.xtensa b/arch/arch.mk.xtensa index fd410f6bfa..9cf6f45678 100644 --- a/arch/arch.mk.xtensa +++ b/arch/arch.mk.xtensa @@ -10,6 +10,9 @@ # endif ################################################################################ BR_ARCH_XTENSA_OVERLAY_FILE = $(call qstrip,$(BR2_XTENSA_OVERLAY_FILE)) +ifeq ($(BR_BUILDING)$(BR2_XTENSA_CUSTOM):$(BR_ARCH_XTENSA_OVERLAY_FILE),yy:) +$(error No xtensa overlay file provided. Check your BR2_XTENSA_OVERLAY_FILE setting) +endif ifneq ($(filter http://% https://% ftp://% scp://%,$(BR_ARCH_XTENSA_OVERLAY_FILE)),) ARCH_XTENSA_OVERLAY_URL = $(BR_ARCH_XTENSA_OVERLAY_FILE) ARCH_XTENSA_OVERLAY_FILE = $($(PKG)_DL_DIR)/$(notdir $(BR_ARCH_XTENSA_OVERLAY_FILE))
Quoted 1 line
Thoughts?
Yes, that can be an option.
Adding Max Filippov in Cc.
Best regards,
Romain
Quoted 36 lines
Regards,
Yann E. MORIN.Quoted 32 lines
Fixes:
http://autobuild.buildroot.org/results/f0b/f0ba47d2534aeb3cc2921124aa639ae3aa072b9bxtensa-buildroot-linux-uclibc/bin/ld: ldso/ldso/ld-uClibc_so.a(ldso.oS): compiled for a big endian system and target is little endian
Signed-off-by Romain Naour <[email protected]>Cc Max Filippov <[email protected]>--- arch/arch.mk.xtensa | 8 ++++++++ 1 file changed, 8 insertions(+)arch/arch.mk.xtensa +8
-0@@ -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 +endifSignature · 1 line
2.34.3
Quoted 5 lines
Quoted 4 lines
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 10 lines · Yann E. MORIN
On 2022-09-04 22:04 +0200, Romain Naour spake thusly:
Quoted 8 lines
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.hheader for gcc settingXCHAL_HAVE_BEto 0.When
BR2_XTENSA_LITTLE_ENDIANis selected, we have to check if an overlay file is provided. Error out ifBR2_XTENSA_OVERLAY_FILEis empty.
Quoted 6 lines
Well, why don't we always check for an overlay when BR2_XTENSA_CUSTOM=y?
Indeed, whether big or little endian, if the user selects a custom xtensa configuration, they better provide the overlay for that configuration, otherwise that does not make sense, and they should be using BR2_xtensa_fsf=y instead.
This sounds perfectly reasonable to me.
Signature · 6 lines
Thanks. -- Max _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Romain, All,
On 2022-09-04 22:04 +0200, Romain Naour spake thusly:
Quoted 28 lines
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.hheader for gcc settingXCHAL_HAVE_BEto 0.When
BR2_XTENSA_LITTLE_ENDIANis selected, we have to check if an overlay file is provided. Error out ifBR2_XTENSA_OVERLAY_FILEis empty.Fixes:
http://autobuild.buildroot.org/results/f0b/f0ba47d2534aeb3cc2921124aa639ae3aa072b9bxtensa-buildroot-linux-uclibc/bin/ld: ldso/ldso/ld-uClibc_so.a(ldso.oS): compiled for a big endian system and target is little endian
Signed-off-by Romain Naour <[email protected]>Cc Max Filippov <[email protected]>--- arch/arch.mk.xtensa | 8 ++++++++ 1 file changed, 8 insertions(+)arch/arch.mk.xtensa +0
-0@@ -34,3 +34,11 @@ define arch-xtensa-overlay-extract $(ARCH_XTENSA_OVERLAY_FILE) | \
arch/arch.mk.xtensa define arch-xtensa-overlay-extract · line 44
Quoted 10 lines
arch/arch.mk.xtensa +8
-0$(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.
Quoted 7 lines
Signature · 6 lines
2.34.3 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------. | 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. | '------------------------------^-------^------------------^--------------------' _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot