[PATCH] Set cpu explicitly in kernel compiles

Segher Boessenkool segher at kernel.crashing.org
Sat May 7 00:44:33 EST 2005


> Well, say you are compiling for 405.  You either need to have a gcc
> that was configured with --with-cpu=405, or you need to have hacked
> arch/ppc/Makefile to add -mcpu=405.  In both cases the problem doesn't
> arise.  It only arises if you have a biarch gcc4 that was configured
> without any --with-cpu=xxx option and is run without any -mcpu=xxx
> option.

It happens for any installation where the default chosen by the GCC
used is not the -mcpu=XXX flag you need used for your kernel.  Which
is a much more general statement than the biarch one.  Most people just
get lucky, because they compile code with a compiler that is defaulted
for their target, and userland and kernel use (about) the same options
on most targets.  Not so in biarch land (bleeech).

> If you think we should have -mcpu=xxx on the command line for 4xx,
> 44x, 8xx, etc., then that's fine, but that is a separate problem from
> what my patch was addressing (one which my patch might make it easier
> to fix, though).

Please always use -mcpu=XXX (and perhaps -mtune=XXX), that's the only
"correct" way to fix this.  Or _never_ do any -mcpu=, and let users
override it in the CC setting in the Makefile.  But I like the first
option better.


Segher




More information about the Linuxppc-dev mailing list