[PATCH 4/4] powerpc/Makefile: Auto detect cross compiler

Michael Ellerman mpe at ellerman.id.au
Thu Dec 7 15:48:30 AEDT 2023

Segher Boessenkool <segher at kernel.crashing.org> writes:
> On Wed, Dec 06, 2023 at 10:55:48PM +1100, Michael Ellerman wrote:
>> Look for various combinations, matching:
>>   powerpc(64(le)?)?(-unknown)?-linux(-gnu)?-
>> There are more possibilities, but the above is known to find a compiler
>> on Fedora and Ubuntu (which use linux-gnu-), and also detects the
>> kernel.org cross compilers (which use linux-).
> $ sh ../config.sub powerpc64-linux
> powerpc64-unknown-linux-gnu
> I am very very lazy, so buildall uses short names everywhere :-)

I used to use just ppc64-gcc :)

I can add more variants but didn't want to add too many unless someone
is actually using them.

> Btw, can you build the kernel for a config that differs in 32/64 or
> BE/LE with the default your compiler uses?  There is no reason this
> shouldn't work (you don't use any system libraries), but you need to
> use the correct compiler command-line flags for that always.

Yes it should work. I've tested at least ppc64le/ppc64/ppc defconfigs.

There have been bugs in the past but AFAIK we have fixed all of them,
though there's probably some still lurking for more obscure configs.

> Acked-by: Segher Boessenkool <segher at kernel.crashing.org>



More information about the Linuxppc-dev mailing list