Subject: Re: [PATCH] powerpc/boot: Build wrapper for an appropriate CPU

From: Segher Boessenkool <[email-masked]>
Date: Thu, 31 Mar 2022 18:09:58 -0500

On Wed, Mar 30, 2022 at 11:05:19PM -0300, Murilo Opsfelder Araújo wrote:
> I think it was a fortunate coincidence that the default cpu type of your 
> gcc is
> compatible with your system.  If the distro gcc moves its default to a 
> newer cpu
> type than your system, this bug would happen again.

Indeed.  But why would you use a GCC from a distro that requires p10
when you target something older?

> The command "gcc -v |& grep with-cpu" will show you the default cpu type 
> for 32
> and 64-bit that gcc was configured.

Only if it was configured with --with-cpu*.  Most people do not.  If
someone builds compilers with non-default defaults like this, they had
better communicate that clearly to all their users, to avoid confusion
and disappointments.

There should be some easy way to show this default with GCC, but there
currently is none.  I'll see what I can do (just to make my own life
easier, we frequently get bug reports from people who use a different
-mcpu= than what they think they do :-) )

Segher