Subject: Compiling kernel with GCC 3.0.4
To: None <port-macppc@NetBSD.ORG>
From: Jeff Laughlin <>
List: port-macppc
Date: 03/09/2002 02:44:37

Well after playing some games I was able to get the newest version of GCC, 
3.0.4, compiled and installed on my NetBSD 1.5.2 box. I wanted to recompile 
the kernel with it, because from what I've read the PPC optimization in GCC 
2.91 (the newest version that officially works with NetBSD PPC) is pretty 
piss poor.

So I started compiling. As could be expected, I ran into many minor 
problems compiling, most of which were easily fixed by a quick visit to the 
CVS pages and changing a couple of lines here and there in the kernel 
source. But then I hit a dead end...

/usr/local/gcc3/bin/gcc  -O2 -pipe -fno-builtin -Wno-uninitialized 
-msoft-float -I. -I../../../../arch -I../../../.. -nostdinc -DDIAGNOSTIC 
-fno-builtin  -c ../../../../kern/kern_kthread.c
./../../../kern/kern_kthread.c: In function `kthread_create1':
./../../../kern/kern_kthread.c:88: __builtin_saveregs not supported by 
this target
*** Error code 1


Now I can't find any official information on this, but from browsing the 
GCC developer's list I think I've gleaned an understanding of the problem. 
I THINK that the __builtin_saveregs function has been broken on GCC PPC 
since 2.95 or something. It sounded like they were working on it, but I 
didn't see any messages related to it that were newer than 1999.

So, can anyone offer any advice? Should I give up? Does anyone know if GCC 
will have this fixed at some point? If not, can we find a workaround or our 
own fix?