Just as a heads up for all those of you trying to build Gentoo on a sparc32 machine, you cannot build bootable kernels with GCC 3.2. This is due do a bug in the GCC code. We are working on building a new profile to use GCC 2.95.x which will hopefully be available soon.

In the meantime, you can always build or use kernels from another distrobution. For instance I am currently booting my SparcStation 10 using the 2.2.20pre2 bootable kernel from Splack. Below is my entry in my silo.conf that takes into account there is no devfs and no tmpfs support in that kernel.

Which version of the kernel? How much of it is gcc and much of it is a kernel problem?

I am currently running redhat 6.2 on my sparc (sun4c IPX). After upgrading enough packages so that I could compile a 2.4 kernel I still could not get a kernel that would boot. This was using gcc 2.95.3. I think it was around the 2.4.14 - 2.4.17 era. There were problems with those kernels and the sun4c machines.

Here's what is happening with sparc32 and kernels (install guide will be updated to reflect this soon).

We are using a stripped down version of gcc 2.95.3 just to build kernels. It is available in portage and is called kgcc. To use this, use the following steps

1) emerge sys-devel/kgcc
2) emerge sys-kernel/sparc-sources (if you have not already done so, you can also use vanilla-sources here).
3) cd /usr/src/linux (if you already have a kernel emerged, make sure the softlink /usr/src/linux points to the right directory of the kernel you want to compile).
4) Edit Makefile.
a) change the line that reads "HOSTCC = gcc" to "HOSTCC = kgcc" (for me, using sparc-sources-2.4.20-r2, it is line 19).
b) change the line that reads "CC = $(CROSS_COMPILE)gcc" to "CC = $(CROSS_COMPILE)kgcc" (for me, using sparc-sources-2.4.20-r2, it is line 30).
5) Now compile your kernel like normal (make menuconfig ; make dep clean vmlinux modules ; make modules_install).

Step 4 is a temporary workaround as we work at getting this ready for Gento Linux 1.4

Feel free to post more questions/followups to this here or join us in the #gentoo-sparc channel on the irc.freenode.net irc server.

4) Edit Makefile.
a) change the line that reads "HOSTCC = gcc" to "HOSTCC = kgcc" (for me, using sparc-sources-2.4.20-r2, it is line 19).
b) change the line that reads "CC = $(CROSS_COMPILE)gcc" to "CC = $(CROSS_COMPILE)kgcc" (for me, using sparc-sources-2.4.20-r2, it is line 30).

Does HOSTCC have to be changed? It just seems to be the compiler needed to for the support programs needed for compiling the kernel.

When cross compiling a kernel I leave HOSTCC=gcc so that the system compiler is used for the support program. Then set CROSS_COMPILE such that sparc-linux-gcc gets used for the actual kernel. In my case gcc is 3.2.1 and sparc-linux-gcc is 2.95.3.

Wouldn't the same apply in your senario using kgcc? I have stuffed my system up enough I can not do a local compile and verify this myself. At least not until the weekend.

Finding a 2.4.x kernel that boots and runs on a sun4c is not fun. At least I now know my earlier problems with 2.4.20 is that it does not work on my sparc.

So I can get a booting kernel doing either what you say or my way. What I can not get is a stable system with a 2.4 kernel. With the sun4c I can only get a stable kernel from the 2.2 series. My best effort with a 2.4 kernel is 2.4.21-pre4.