Re: odd endianness toolchains for crosstool

From: Jason A. Donenfeld
Date: Mon Apr 25 2022 - 13:42:56 EST


Hi Arnd,

On Mon, Apr 25, 2022 at 7:40 PM Arnd Bergmann <arnd@xxxxxxxx> wrote:
> > For ppc64, I see the same. I'll try to look into it more though.
> >
> > > Regarding the the ELF ABI, I'm not sure how to check, but I think it
> > > only does ELFv1, which is the default for big-endian glibc.
> >
> > Yes, it only is doing ELFv1 right now. musl checks this in
> > <https://git.musl-libc.org/cgit/musl/tree/configure#n689> with this:
> >
> > trycppif "_CALL_ELF == 2" "$t" || fail "$0: error: unsupported powerpc64 ABI"
>
> Does it work if you pass -mabi=elfv2? This seems to be ignored here as well:
>
> $ powerpc-linux-gcc -mlittle-endian -mabi=elfv2 -xc -c /dev/null -o /tmp/a.o
> $ file /tmp/a.o
> /tmp/a.o: ELF 32-bit LSB relocatable, PowerPC or cisco 4500, version 1
> (SYSV), not stripped

You're mixing things up I think. -mabi=elfv2 is what powerpc64 needs,
but I don't think powerpc32 has it.

If you try to add -mabi=elfv2 to your existing powerpc64 compiler, it
gets upset when linking to libgcc.

Jason