Here is a kernel patch, which adds gcc3 optimizations to the kernel build. It is similar to the gcc31-compile-optimizations patch used in gentoo-sources. It adds these options to the Processor type selection: 6xx(GCC>3.1) 7xx(GCC>3.1) 74xx(GCC>3.1) 7450(GCC>3.1) When one of these are selected, -O3 is added to CFLAGS and the appropriate -mcpu setting. This is a start, with testing more optimization flags could be added if you're daring :). Obviously this needs some testing more testing, but as of this writing, its working fine on my G3 so far.
Created attachment 8268 [details, diff] gcc31-compile-optimizations-ppc kernel patch
I forgot to mention that it applies cleanly to 2.4.20: vanilla and ppc-sources-r3
Created attachment 8335 [details, diff] gcc31-compile-optimizations-ppc kernel patch There was an error in the previous patch, causing the option MPC8260 CPM Support to not show up, this should fix it.
I'll bang around with this and see if it works on my G4, but I kind of doubt that it will.
Patch seems ok to me, my only comment is that -O3 on a G4 is known to be flaky. Apart from that it is a non-exclusive patch (meaning, you can still compile the kernel the old way if you prefer). If we switch to -O3 only for G3, this patch is ok for inclusion if kain wants to.
I would strongly discourage -O3 for any kernel compiles. I know firsthand it can cause issues in some inline assembler and some other code. AC has voiced his concern on this a couple of times as well as a few others in LKML. I already removed the -O3 opts from Gentoo Sources ~ 6 months ago. Closed a good number of bugs. Jay
This should probably be closed out, and the patch not used. I made it 8 months ago. I dont think it will apply to recent benh kernels. It probably doesnt do much for ppc anyway, esp. since it should be -O2 (as Jay pointed out) instead of the -O3 I did back then.
Closed as requested.