Re: odd endianness toolchains for crosstool

From: Jason A. Donenfeld
Date: Mon Apr 25 2022 - 11:20:39 EST

Hey Arnd,

On Mon, Apr 25, 2022 at 04:55:20PM +0200, Arnd Bergmann wrote:
> I suppose the only thing you are missing is libgcc (or libcompiler-rt)
> for those platforms. I had a closer look into what is or can be included
> here, and I see that my builds include multiple versions on some of
> the architectures, but not on others:
> aarch64-linux/lib/gcc/aarch64-linux/11.1.0/libgcc.a
> alpha-linux/lib/gcc/alpha-linux/11.1.0/libgcc.a
> arc-linux/lib/gcc/arc-linux/11.1.0/libgcc.a
> arc-linux/lib/gcc/arc-linux/11.1.0/hs/libgcc.a
> arc-linux/lib/gcc/arc-linux/11.1.0/archs/libgcc.a
> arc-linux/lib/gcc/arc-linux/11.1.0/hs38/libgcc.a
> arc-linux/lib/gcc/arc-linux/11.1.0/hs38_linux/libgcc.a
> arc-linux/lib/gcc/arc-linux/11.1.0/arc700/libgcc.a
> arc-linux/lib/gcc/arc-linux/11.1.0/nps400/libgcc.a
> arm-linux-gnueabi/lib/gcc/arm-linux-gnueabi/11.1.0/libgcc.a
> ...
> powerpc-linux/lib/gcc/powerpc-linux/11.1.0/libgcc.a
> powerpc-linux/lib/gcc/powerpc-linux/11.1.0/64/libgcc.a
> powerpc-linux/lib/gcc/powerpc-linux/11.1.0/64/le/libgcc.a
> powerpc-linux/lib/gcc/powerpc-linux/11.1.0/le/libgcc.a
> powerpc-linux/lib/gcc/powerpc-linux/11.1.0/32/le/libgcc.a
> powerpc64-linux/lib/gcc/powerpc64-linux/11.1.0/libgcc.a
> powerpc64-linux/lib/gcc/powerpc64-linux/11.1.0/32/libgcc.a
> powerpc64-linux/lib/gcc/powerpc64-linux/11.1.0/32/le/libgcc.a
> powerpc64-linux/lib/gcc/powerpc64-linux/11.1.0/le/libgcc.a
> powerpc64-linux/lib/gcc/powerpc64-linux/11.1.0/64/le/libgcc.a
> mips-linux/lib/gcc/mips-linux/11.1.0/libgcc.a
> mips-linux/lib/gcc/mips-linux/11.1.0/n32/libgcc.a
> mips-linux/lib/gcc/mips-linux/11.1.0/64/libgcc.a
> mips64-linux/lib/gcc/mips64-linux/11.1.0/libgcc.a
> mips64-linux/lib/gcc/mips64-linux/11.1.0/32/libgcc.a
> mips64-linux/lib/gcc/mips64-linux/11.1.0/64/libgcc.a
> So on powerpc, there are already both big-endian and
> little-endian binaries, but arm and mips only have one of the
> two. I asked our local compiler experts, and they suggested
> that one can add further multiarch-configs like the one
> in gcc/config/arm/t-aprofile to allow building for a different
> subset of the hundreds of possible configurations.
> the t-aprofile builds libgcc for a couple of combinations of
> cpu architecture level and FPU ABIs, but they are all the
> same endianess. gcc/config/rs6000/t-linux64lebe is the
> corresponding file for powerpc that enables all combinations
> of 32/64 and be/le.

Right, exactly. So if you simply add little endian libgcc to ppc64, ppc,
mips, and mips64, and add big endian libgcc to arm and arm64, then we'd
be set. (And also, build ppc32 with --enable-secureplt