All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] uclibc-ng build failures on Xtensa
@ 2022-07-22  8:09 Thomas Petazzoni via buildroot
  2022-07-22 11:24 ` Max Filippov
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-07-22  8:09 UTC (permalink / raw)
  To: Max Filippov; +Cc: buildroot

Hello Max,

We are seeing build failures of uclibc-ng on Xtensa:

  http://autobuild.buildroot.net/?reason=uclibc%&arch=xtensa

A relevant one is:

  http://autobuild.buildroot.net/results/38e/38e9d9a76f1877e7952ad5c20a405382642fd227/build-end.log

Which goes like this:


/home/autobuild/autobuild/instance-7/output-1/host/lib/gcc/xtensa-buildroot-linux-uclibc/10.3.0/../../../../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
/home/autobuild/autobuild/instance-7/output-1/host/lib/gcc/xtensa-buildroot-linux-uclibc/10.3.0/../../../../xtensa-buildroot-linux-uclibc/bin/ld: failed to merge target specific data of file ldso/ldso/ld-uClibc_so.a(ldso.oS)
/home/autobuild/autobuild/instance-7/output-1/host/lib/gcc/xtensa-buildroot-linux-uclibc/10.3.0/../../../../xtensa-buildroot-linux-uclibc/bin/ld: ldso/ldso/ld-uClibc_so.a(dl-tlsdesc.oS): compiled for a big endian system and target is little endian
/home/autobuild/autobuild/instance-7/output-1/host/lib/gcc/xtensa-buildroot-linux-uclibc/10.3.0/../../../../xtensa-buildroot-linux-uclibc/bin/ld: failed to merge target specific data of file ldso/ldso/ld-uClibc_so.a(dl-tlsdesc.oS)
/home/autobuild/autobuild/instance-7/output-1/host/lib/gcc/xtensa-buildroot-linux-uclibc/10.3.0/../../../../xtensa-buildroot-linux-uclibc/bin/ld: ldso/ldso/ld-uClibc_so.a(resolve.oS): compiled for a big endian system and target is little endian
/home/autobuild/autobuild/instance-7/output-1/host/lib/gcc/xtensa-buildroot-linux-uclibc/10.3.0/../../../../xtensa-buildroot-linux-uclibc/bin/ld: failed to merge target specific data of file ldso/ldso/ld-uClibc_so.a(resolve.oS)
/home/autobuild/autobuild/instance-7/output-1/host/lib/gcc/xtensa-buildroot-linux-uclibc/10.3.0/../../../../xtensa-buildroot-linux-uclibc/bin/ld: little endian output does not match Xtensa configuration

This happens on configurations that have:

BR2_XTENSA_CUSTOM=y

Indeed, in Buildroot we support two Xtensa variants:

config BR2_XTENSA_CUSTOM
        bool "Custom Xtensa processor configuration"
        select BR2_ARCH_HAS_MMU_OPTIONAL

config BR2_xtensa_fsf
        bool "fsf - Default configuration"
        select BR2_ARCH_HAS_MMU_MANDATORY

So far, all builds were done using BR2_xtensa_fsf but with the full
randomization, we've started doing builds with BR2_XTENSA_CUSTOM.
However, for BR2_XTENSA_CUSTOM, the endianess is configurable:

choice
        prompt "Target Architecture Endianness"
        default BR2_XTENSA_LITTLE_ENDIAN
        depends on BR2_XTENSA_CUSTOM

config BR2_XTENSA_LITTLE_ENDIAN
        bool "Little endian"

config BR2_XTENSA_BIG_ENDIAN
        bool "Big endian"

endchoice

And the default is BR2_XTENSA_LITTLE_ENDIAN, while normally for
BR2_xtensa_fsf, the endianness is BIG.

Which configurations are supported? Is there something to fix here, or
we just need to disallow the usage of little endian?

Thanks a lot for your input,

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Buildroot] uclibc-ng build failures on Xtensa
  2022-07-22  8:09 [Buildroot] uclibc-ng build failures on Xtensa Thomas Petazzoni via buildroot
@ 2022-07-22 11:24 ` Max Filippov
  2022-07-22 12:17   ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 4+ messages in thread
From: Max Filippov @ 2022-07-22 11:24 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: buildroot

Hi Thomas,

On Fri, Jul 22, 2022 at 1:09 AM Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
> We are seeing build failures of uclibc-ng on Xtensa:
>
>   http://autobuild.buildroot.net/?reason=uclibc%&arch=xtensa
>
> A relevant one is:
>
>   http://autobuild.buildroot.net/results/38e/38e9d9a76f1877e7952ad5c20a405382642fd227/build-end.log
>
> Which goes like this:
>
> /home/autobuild/autobuild/instance-7/output-1/host/lib/gcc/xtensa-buildroot-linux-uclibc/10.3.0/../../../../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
> /home/autobuild/autobuild/instance-7/output-1/host/lib/gcc/xtensa-buildroot-linux-uclibc/10.3.0/../../../../xtensa-buildroot-linux-uclibc/bin/ld: failed to merge target specific data of file ldso/ldso/ld-uClibc_so.a(ldso.oS)
> /home/autobuild/autobuild/instance-7/output-1/host/lib/gcc/xtensa-buildroot-linux-uclibc/10.3.0/../../../../xtensa-buildroot-linux-uclibc/bin/ld: ldso/ldso/ld-uClibc_so.a(dl-tlsdesc.oS): compiled for a big endian system and target is little endian
> /home/autobuild/autobuild/instance-7/output-1/host/lib/gcc/xtensa-buildroot-linux-uclibc/10.3.0/../../../../xtensa-buildroot-linux-uclibc/bin/ld: failed to merge target specific data of file ldso/ldso/ld-uClibc_so.a(dl-tlsdesc.oS)
> /home/autobuild/autobuild/instance-7/output-1/host/lib/gcc/xtensa-buildroot-linux-uclibc/10.3.0/../../../../xtensa-buildroot-linux-uclibc/bin/ld: ldso/ldso/ld-uClibc_so.a(resolve.oS): compiled for a big endian system and target is little endian
> /home/autobuild/autobuild/instance-7/output-1/host/lib/gcc/xtensa-buildroot-linux-uclibc/10.3.0/../../../../xtensa-buildroot-linux-uclibc/bin/ld: failed to merge target specific data of file ldso/ldso/ld-uClibc_so.a(resolve.oS)
> /home/autobuild/autobuild/instance-7/output-1/host/lib/gcc/xtensa-buildroot-linux-uclibc/10.3.0/../../../../xtensa-buildroot-linux-uclibc/bin/ld: little endian output does not match Xtensa configuration
>
> This happens on configurations that have:
>
> BR2_XTENSA_CUSTOM=y
>
> Indeed, in Buildroot we support two Xtensa variants:
>
> config BR2_XTENSA_CUSTOM
>         bool "Custom Xtensa processor configuration"
>         select BR2_ARCH_HAS_MMU_OPTIONAL
>
> config BR2_xtensa_fsf
>         bool "fsf - Default configuration"
>         select BR2_ARCH_HAS_MMU_MANDATORY
>
> So far, all builds were done using BR2_xtensa_fsf but with the full
> randomization, we've started doing builds with BR2_XTENSA_CUSTOM.
> However, for BR2_XTENSA_CUSTOM, the endianess is configurable:
>
> choice
>         prompt "Target Architecture Endianness"
>         default BR2_XTENSA_LITTLE_ENDIAN
>         depends on BR2_XTENSA_CUSTOM
>
> config BR2_XTENSA_LITTLE_ENDIAN
>         bool "Little endian"
>
> config BR2_XTENSA_BIG_ENDIAN
>         bool "Big endian"
>
> endchoice
>
> And the default is BR2_XTENSA_LITTLE_ENDIAN, while normally for
> BR2_xtensa_fsf, the endianness is BIG.
>
> Which configurations are supported?

When BR2_XTENSA_CUSTOM is selected BR2_XTENSA_OVERLAY_FILE
must be specified and selected endianness must match the endianness of the
configuration in the overlay file. Empty BR2_XTENSA_OVERLAY_FILE is
equivalent to fsf and it is big endian.

> Is there something to fix here, or
> we just need to disallow the usage of little endian?

Little endian xtensa configurations are well supported, see e.g.
configs/qemu_xtensa_lx60_defconfig that uses the dc233c core.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Buildroot] uclibc-ng build failures on Xtensa
  2022-07-22 11:24 ` Max Filippov
@ 2022-07-22 12:17   ` Thomas Petazzoni via buildroot
  2022-07-23 13:15     ` Max Filippov
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-07-22 12:17 UTC (permalink / raw)
  To: Max Filippov; +Cc: buildroot

Hello Max,

Thanks for your feedback, very useful as usual!

On Fri, 22 Jul 2022 04:24:16 -0700
Max Filippov <jcmvbkbc@gmail.com> wrote:

> > And the default is BR2_XTENSA_LITTLE_ENDIAN, while normally for
> > BR2_xtensa_fsf, the endianness is BIG.
> >
> > Which configurations are supported?  
> 
> When BR2_XTENSA_CUSTOM is selected BR2_XTENSA_OVERLAY_FILE
> must be specified and selected endianness must match the endianness of the
> configuration in the overlay file. Empty BR2_XTENSA_OVERLAY_FILE is
> equivalent to fsf and it is big endian.

Hm, OK. So what should we do from a testing point of view? Disregard
any testing of the BR2_XTENSA_CUSTOM case?

It's kind of weird to have BR2_XTENSA_LITTLE_ENDIAN be the default if
the default is actually big endian (when there is no overlay file).

What do you think of:

diff --git a/arch/Config.in.xtensa b/arch/Config.in.xtensa
index 45ad2dc487..a69964f515 100644
--- a/arch/Config.in.xtensa
+++ b/arch/Config.in.xtensa
@@ -31,7 +31,7 @@ config BR2_XTENSA_OVERLAY_FILE
 choice
        prompt "Target Architecture Endianness"
        default BR2_XTENSA_LITTLE_ENDIAN
-       depends on BR2_XTENSA_CUSTOM
+       depends on BR2_XTENSA_CUSTOM && BR2_XTENSA_OVERLAY_FILE != ""
 
 config BR2_XTENSA_LITTLE_ENDIAN
        bool "Little endian"
@@ -43,7 +43,9 @@ endchoice
 
 config BR2_ENDIAN
        default "LITTLE"        if BR2_XTENSA_LITTLE_ENDIAN
-       default "BIG"           if BR2_xtensa_fsf || BR2_XTENSA_BIG_ENDIAN
+       default "BIG"           if BR2_xtensa_fsf
+       default "BIG"           if BR2_XTENSA_CUSTOM && BR2_XTENSA_OVERLAY_FILE = ""
+       default "BIG"           if BR2_XTENSA_BIG_ENDIAN
 
 config BR2_ARCH
        default "xtensa"        if BR2_xtensa

i.e basically: don't choice the endianness choice when the overlay file
is empty, and enforce the fact that the endianess is big when
BR2_XTENSA_CUSTOM with an empty overlay file.

> > Is there something to fix here, or
> > we just need to disallow the usage of little endian?  
> 
> Little endian xtensa configurations are well supported, see e.g.
> configs/qemu_xtensa_lx60_defconfig that uses the dc233c core.

I see there are quite a few overlays at
https://github.com/jcmvbkbc/xtensa-toolchain-build/tree/master/overlays
for well-known cores. Would it make sense to have explicit support for
some of them in Buildroot? At least having support for one of the
little endian cores seems useful to increase the testing coverage.

Thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Buildroot] uclibc-ng build failures on Xtensa
  2022-07-22 12:17   ` Thomas Petazzoni via buildroot
@ 2022-07-23 13:15     ` Max Filippov
  0 siblings, 0 replies; 4+ messages in thread
From: Max Filippov @ 2022-07-23 13:15 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: buildroot

Hi Thomas,

On Fri, Jul 22, 2022 at 5:17 AM Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
> On Fri, 22 Jul 2022 04:24:16 -0700  Max Filippov <jcmvbkbc@gmail.com> wrote:
>
> > > And the default is BR2_XTENSA_LITTLE_ENDIAN, while normally for
> > > BR2_xtensa_fsf, the endianness is BIG.
> > >
> > > Which configurations are supported?
> >
> > When BR2_XTENSA_CUSTOM is selected BR2_XTENSA_OVERLAY_FILE
> > must be specified and selected endianness must match the endianness of the
> > configuration in the overlay file. Empty BR2_XTENSA_OVERLAY_FILE is
> > equivalent to fsf and it is big endian.
>
> Hm, OK. So what should we do from a testing point of view? Disregard
> any testing of the BR2_XTENSA_CUSTOM case?
>
> It's kind of weird to have BR2_XTENSA_LITTLE_ENDIAN be the default if
> the default is actually big endian (when there is no overlay file).

I agree.

> What do you think of:
>
> diff --git a/arch/Config.in.xtensa b/arch/Config.in.xtensa
> index 45ad2dc487..a69964f515 100644
> --- a/arch/Config.in.xtensa
> +++ b/arch/Config.in.xtensa
> @@ -31,7 +31,7 @@ config BR2_XTENSA_OVERLAY_FILE
>  choice
>         prompt "Target Architecture Endianness"
>         default BR2_XTENSA_LITTLE_ENDIAN
> -       depends on BR2_XTENSA_CUSTOM
> +       depends on BR2_XTENSA_CUSTOM && BR2_XTENSA_OVERLAY_FILE != ""
>
>  config BR2_XTENSA_LITTLE_ENDIAN
>         bool "Little endian"
> @@ -43,7 +43,9 @@ endchoice
>
>  config BR2_ENDIAN
>         default "LITTLE"        if BR2_XTENSA_LITTLE_ENDIAN
> -       default "BIG"           if BR2_xtensa_fsf || BR2_XTENSA_BIG_ENDIAN
> +       default "BIG"           if BR2_xtensa_fsf
> +       default "BIG"           if BR2_XTENSA_CUSTOM && BR2_XTENSA_OVERLAY_FILE = ""
> +       default "BIG"           if BR2_XTENSA_BIG_ENDIAN
>
>  config BR2_ARCH
>         default "xtensa"        if BR2_xtensa
>
> i.e basically: don't choice the endianness choice when the overlay file
> is empty, and enforce the fact that the endianess is big when
> BR2_XTENSA_CUSTOM with an empty overlay file.

This looks reasonable, yes.

> > > Is there something to fix here, or
> > > we just need to disallow the usage of little endian?
> >
> > Little endian xtensa configurations are well supported, see e.g.
> > configs/qemu_xtensa_lx60_defconfig that uses the dc233c core.
>
> I see there are quite a few overlays at
> https://github.com/jcmvbkbc/xtensa-toolchain-build/tree/master/overlays
> for well-known cores. Would it make sense to have explicit support for
> some of them in Buildroot? At least having support for one of the
> little endian cores seems useful to increase the testing coverage.

Maybe dc233c then, it's been the standard xtensa core for linux so far.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-07-23 13:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-22  8:09 [Buildroot] uclibc-ng build failures on Xtensa Thomas Petazzoni via buildroot
2022-07-22 11:24 ` Max Filippov
2022-07-22 12:17   ` Thomas Petazzoni via buildroot
2022-07-23 13:15     ` Max Filippov

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.