Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gentoo on Sparc32 Status
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on Sparc
View previous topic :: View next topic  
Author Message
Weeve
Retired Dev
Retired Dev


Joined: 30 Oct 2002
Posts: 641

PostPosted: Mon Dec 02, 2002 1:46 pm    Post subject: Gentoo on Sparc32 Status Reply with quote

Hi Everybody,

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.

image = /vmlinux
root = /dev/sda4
label = Gentoo
append = "gentoo=notmpfs,nodevfs"
read-only

I'll post an update with more information as it becomes available.
Back to top
View user's profile Send private message
Aiken
Apprentice
Apprentice


Joined: 22 Jan 2003
Posts: 239
Location: Toowoomba/Australia

PostPosted: Thu Jan 23, 2003 12:06 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Aiken
Apprentice
Apprentice


Joined: 22 Jan 2003
Posts: 239
Location: Toowoomba/Australia

PostPosted: Mon Jan 27, 2003 11:06 pm    Post subject: Reply with quote

What combinations of gcc and kernel are you having success with? These are the combinations I have tried so far.

gcc 3.2.1 + kernel 2.4.20 fail to boot
gcc 3.2.1 + kernel 2.2.20 won't compile

gcc 2.95.3 + kernel 2.4.20 boots mostly, can get stuck setting up eth0. When running this init script bash core dumps. But only with this kernel.

I setup up a i686-linux to sparc-linux cross compiler on my athlon. Using this to compile a kernel for the sparc on the athlon gives me a working 2.2.20 kernel using gcc 2.95.3.

Just about to try doing a 2.2.20 kernel with gcc 2.95.3 on the sparc. I'll know the results in about 3 hours. Compared to about 5 minutes when I used the cross compiler for the previous kernel.
Back to top
View user's profile Send private message
Weeve
Retired Dev
Retired Dev


Joined: 30 Oct 2002
Posts: 641

PostPosted: Wed Jan 29, 2003 6:14 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Aiken
Apprentice
Apprentice


Joined: 22 Jan 2003
Posts: 239
Location: Toowoomba/Australia

PostPosted: Thu Jan 30, 2003 1:41 pm    Post subject: Reply with quote

Weeve wrote:

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.
Back to top
View user's profile Send private message
Weeve
Retired Dev
Retired Dev


Joined: 30 Oct 2002
Posts: 641

PostPosted: Thu Jan 30, 2003 2:06 pm    Post subject: Reply with quote

Yeah, you need to change it to kgcc, otherwise it will end up using gcc 3.x, which doesn't compile code correctly for sparc32 machines, which is why the kernels built with it don't currently boot.
Back to top
View user's profile Send private message
Aiken
Apprentice
Apprentice


Joined: 22 Jan 2003
Posts: 239
Location: Toowoomba/Australia

PostPosted: Thu Jan 30, 2003 2:17 pm    Post subject: Reply with quote

Found I have not stuffed my sparc linux install yet as much as I thought so I can try a local compile.

I am doing a kernel compile at the moment. 2.4.21-pre4.

HOSTCC=gcc (3.2.1)
CC=/usr/local/bin/gcc (2.95.3)

It used 3.2.1 for make menuconfig, make dep but it is using 2.95.3 for the actual kernel.

Do you know the best 2.4.x kernel for a sun4c?
Back to top
View user's profile Send private message
Weeve
Retired Dev
Retired Dev


Joined: 30 Oct 2002
Posts: 641

PostPosted: Thu Jan 30, 2003 2:25 pm    Post subject: Reply with quote

Haven't heard if anyone is using them or not on Gentoo. Debian seems to be using 2.4.19, so you might try that. Interested to hear how you make out.
Back to top
View user's profile Send private message
Aiken
Apprentice
Apprentice


Joined: 22 Jan 2003
Posts: 239
Location: Toowoomba/Australia

PostPosted: Thu Jan 30, 2003 3:02 pm    Post subject: Reply with quote

I have already done a cross compile athlon -> sparc with a 2.4.21-pre4 tonight using 2.95.3.

Doing a native compile I get this.

make[2]: Entering directory `/mnt/barney/linux-2.4.20/drivers/cdrom'
make all_targets
make[2]: *** [first_rule] Illegal instruction (core dumped)
make[2]: Leaving directory `/mnt/barney/linux-2.4.20/drivers/cdrom'

I give up for the night. It is 1am so I should be in bed anyway.
Back to top
View user's profile Send private message
Aiken
Apprentice
Apprentice


Joined: 22 Jan 2003
Posts: 239
Location: Toowoomba/Australia

PostPosted: Sat Feb 01, 2003 5:48 am    Post subject: 2.2.x might be better for me Reply with quote

I have tried 4 different compiler/kernel combinations. This is where I am at

gcc 3.2.1 for everything
Kernel fails to boot. You said this in your first message so no surprise.


HOSTCC=2.95.3
CC=2.95.3
Machine boots.

HOSTCC=3.2.1
CC=2.95.3
Machine boots

Cross compile from an athlon box
HOSTCC=3.2.1
CC=2.95.3
Machine boots.

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on Sparc All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum