Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
GCC3.2 doesn't work for kernels
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
bent
Tux's lil' helper
Tux's lil' helper


Joined: 26 Mar 2003
Posts: 75
Location: New Zealand

PostPosted: Wed Apr 09, 2003 10:53 am    Post subject: GCC3.2 doesn't work for kernels Reply with quote

I understand, after a bit of scraping around the web, that GCC3.2 can't be used to compile kernels. Or rather it does compile them, but they won't boot.
Since I've got (as well as Gentoo 1.4) Gentoo 1.1 and Mandrake 7.1 I can boot into another OS and compile the kernel there, and this has worked. But I'd rather not keep it this way, so I can delete the other OS's when I'm totally comfortable with Gentoo (which I think rocks, thanks all).
So I ask: What are you guys doing to compile your kernels? It's not like you need to do it every day, but since I'm messing around at the moment, I'm doing it at least every week. Will do it again when my second processor arrives.
GCC3.2 has worked fine for everything else so far, except xfce. Can't remember the error at the moment, anyone else have success / woes compiling this?
Back to top
View user's profile Send private message
Weeve
Retired Dev
Retired Dev


Joined: 30 Oct 2002
Posts: 641

PostPosted: Wed Apr 09, 2003 11:09 am    Post subject: Reply with quote

Hiya bent,

I'm going to assume you're using a 32 bit sparc computer here (if not then just set me straight). You should have kgcc installed on your sparc, which is a stripped down gcc-2.95.3 and the last known good gcc at building 32 bit sparc kernels.

Now if you choose sparc-sources as your kernel, this should automatically use kgcc to build itself with and present you with a bootable kernel. If you decide to use vanilla-sources or download the kernel, you will have to manually adjust the Makefile in /path/to/kernel-source/arch/sparc to use kgcc.

Lemme know what happens.
Back to top
View user's profile Send private message
xming
Guru
Guru


Joined: 02 Jul 2002
Posts: 441

PostPosted: Wed Apr 09, 2003 12:22 pm    Post subject: Reply with quote

bent: what kind of sun are you using?

xming
Back to top
View user's profile Send private message
bent
Tux's lil' helper
Tux's lil' helper


Joined: 26 Mar 2003
Posts: 75
Location: New Zealand

PostPosted: Wed Apr 09, 2003 1:01 pm    Post subject: ah! didn't know about kgcc Reply with quote

Yep, it's a Sparc20, or should we say: "sun4m"

I am using sparc-sources, though I got vanilla-sources as well just to see.
a "grep kgcc /usr/src/linux/Makefile" turns up nothing(sparc src), should
HOSTGCC be set to kgcc here?

In any case, I'll try changing it to kgcc here, and see how it went in the
morning. (compiling gimp at the moment, 2nd try, toddler unplugged
sparc straight after I left for work...)

BTW: with gcc3.2 the kernel compiled fine, but the sparc did a "Watchdog
reset" straight after uncompressing the kernel.

Thanks for enlightening me of kgcc, presumably k stands for kernel. Thanks
also to all the Gentoo-Sparc devs, this is the best port I've used yet, even
iif it is on my clunkly old Sparc20.

Cheers
Ben
Back to top
View user's profile Send private message
Weeve
Retired Dev
Retired Dev


Joined: 30 Oct 2002
Posts: 641

PostPosted: Wed Apr 09, 2003 1:09 pm    Post subject: Reply with quote

Hello again bent,

Glad you like the port :)

sparc-sources-2.4.20-r8 should do the trick for compiling with kgcc. The mainlevel make file is not touched in the kernel source, but rather the arch specific one. If you were in /usr/src/linux, the path to that Makefile should be arch/sparc/Makefile.

If you've been having problems with sparc-sources-2.4.20-r8 then post a follow up and we will look into it.

Thanks
Back to top
View user's profile Send private message
bent
Tux's lil' helper
Tux's lil' helper


Joined: 26 Mar 2003
Posts: 75
Location: New Zealand

PostPosted: Wed Apr 09, 2003 1:12 pm    Post subject: Reply with quote

Sorry Weeve, I didn't quite read you properly before replying.
Weeve wrote:

Now if you choose sparc-sources as your kernel, this should automatically use kgcc to build itself with and present you with a bootable kernel. If you decide to use vanilla-sources or download the kernel, you will have to manually adjust the Makefile in /path/to/kernel-source/arch/sparc to use kgcc.


Ah, not ./Makefile but ./arch/sparc/Makefile..
I checked .../linux/arch/sparc/Makefile and found what looks to be right,
basically "if gcc -dumpversion is 2.95 CC=gcc otherwise CC=kgcc"
so it would seem it has actually been using kgcc all along (for arch specific
stuff anyway).

I checked that kgcc is actually on my machine, you're right, it's there and it's
2.95.3. So I'm stumped on this one. Is it alright to change HOSTCC=gcc
to kgcc in the top level Makefile?

Cheers
Ben
Back to top
View user's profile Send private message
Weeve
Retired Dev
Retired Dev


Joined: 30 Oct 2002
Posts: 641

PostPosted: Wed Apr 09, 2003 1:21 pm    Post subject: Reply with quote

Yeah, you can do that too. We put that hack in so that people transitioning from the default-sparc-1.0 profile to the default-sparc-1.4 profile wouldn't have to go in and change any settings to have to rebuild their kernels.
Back to top
View user's profile Send private message
bent
Tux's lil' helper
Tux's lil' helper


Joined: 26 Mar 2003
Posts: 75
Location: New Zealand

PostPosted: Wed Apr 09, 2003 1:22 pm    Post subject: Reply with quote

Weeve wrote:

If you've been having problems with sparc-sources-2.4.20-r8 then post a follow up and we will look into it.


Well, haven't had problems if I boot into mandrake7.1 and compile it there, but if I compile on the gentoo system it won't boot off the kernel I made there.
Another thing I noticed yesterday, include/asm-sparc/linux_logo.h is not the same as it
is in asm-sparc64 and asm-x86. All this meant was the boot logo stuck as the default, no
matter what I chose, no big deal.

But anyway, I copied asm-sparc64/linux-logo.h over top of asm-sparc/linux_logo.h (actually
I moved the original out the way first, be safe) and it seemed to fix it.

Dunno if this is how it should be or not, but you seem to be the right person to talk to
about it.

Thanks Weeve!
Back to top
View user's profile Send private message
bent
Tux's lil' helper
Tux's lil' helper


Joined: 26 Mar 2003
Posts: 75
Location: New Zealand

PostPosted: Thu Apr 10, 2003 2:19 am    Post subject: It worked! Reply with quote

I changed HOSTCC from gcc to kgcc in the top level makefile
and managed to compile a bootable kernel! So it seems not
enough to have it set in arch/sparc/Makefile at this point, though
I suspect if everyone with a 32bit sparc had to do this, I would
have heard about it before now.

Thanks again Weeve, I've named my current working kernel after
you, /boot/vmlinuz-weeve, /boot/System.map-weeve.

Cheers!
Back to top
View user's profile Send private message
bent
Tux's lil' helper
Tux's lil' helper


Joined: 26 Mar 2003
Posts: 75
Location: New Zealand

PostPosted: Tue Apr 15, 2003 10:53 am    Post subject: Reply with quote

Ugh. Now I've ran into another problem. kgcc did a good job of the kernel, but when I compile with SMP support, at bootup I get a "fixup ... doesn't refer to a SETHI at ..."
Seen a few others with similar problems, and it's obviously sparc specific, but I'm not getting any joy.
Back to top
View user's profile Send private message
garlik42
n00b
n00b


Joined: 17 Dec 2002
Posts: 57
Location: Connecticut USA by the water ...

PostPosted: Thu Apr 17, 2003 8:16 pm    Post subject: I am confused Reply with quote

I have my sparc ultra 10 running a kernel compiled with gcc 3.2.2 and I have no issues. Is this a 64 bit / 32 bit issue. The machine boots fine, and runs fine. I had a great deal of trouble getting xfree 4.2.0 working with kde, but 4.3.0 works fine.
One other question, is an ultra 20 a 32 bit or 64 bit machine.

thanks
Back to top
View user's profile Send private message
bent
Tux's lil' helper
Tux's lil' helper


Joined: 26 Mar 2003
Posts: 75
Location: New Zealand

PostPosted: Mon Apr 21, 2003 4:48 am    Post subject: Re: I am confused Reply with quote

garlik42 wrote:

One other question, is an ultra 20 a 32 bit or 64 bit machine.

thanks

Hi!

A Sun Ultra anything is a 64bit machine.
Ben
Back to top
View user's profile Send private message
Ferris
Retired Dev
Retired Dev


Joined: 13 Jan 2003
Posts: 426
Location: N. Virginia (USA)

PostPosted: Wed Jun 25, 2003 10:49 am    Post subject: Reply with quote

A couple comments/questions just to keep this going. Everything
refers to a sparc20 2xsun4m SMP (no problems with a U2 2xsun4u):

1. For bent-- I get the same thing with sparc sources 2.4.20-r8. I
am led to believe that '-r8' is known to be flakey on this (SS20SMP)
system, although the ISO distribution kernel pretty much works.

2. "emerge -puv system" wanted to install sparc-sources-2.4.21, so I
let it. This kernel wants to be built with gcc (not kgcc), or so it tries
to do. Result is "image too big" or the same "not SETHI"

Now, at some point I do need to build a new SMP kernel for this system,
so I'll start my question here: Just what kernel is recommended for this
system (SS20-SMP) :?:
Back to top
View user's profile Send private message
Weeve
Retired Dev
Retired Dev


Joined: 30 Oct 2002
Posts: 641

PostPosted: Wed Jun 25, 2003 11:46 am    Post subject: Reply with quote

Hi Ferris et al,

For sparc32, use the sparc-sources-2.4.21-r1 kernel (currently marked unstable (~sparc)) or vanilla-sources-2.4.21. The 2.4.21 kernels can now build with gcc 3.2.x on sparc32 and sparc-sources-2.4.21-r1 fixes the "not SETHI" error (grsec related bug) when building an SMP kernel.
Back to top
View user's profile Send private message
Ferris
Retired Dev
Retired Dev


Joined: 13 Jan 2003
Posts: 426
Location: N. Virginia (USA)

PostPosted: Wed Jun 25, 2003 12:00 pm    Post subject: Reply with quote

Thanks for the feedback. I'm starting the process of trying it now, and
I'll let people know what happens.
Back to top
View user's profile Send private message
Ferris
Retired Dev
Retired Dev


Joined: 13 Jan 2003
Posts: 426
Location: N. Virginia (USA)

PostPosted: Wed Jun 25, 2003 6:49 pm    Post subject: Reply with quote

Thanks Weeve,
2.4.21-r1 builds fine, boots (after "strip vmlinux"), and seems to be
running.
(Too bad it doesn't solve my original problem, which was to
find out why an aggressive MP application using MPI runs fine on the U2
but gets random results --- SegFault being the favorite --- on the SS20 if
it uses more than one processor. It's got to be a library/kernel
synchronization problem peculiar to sun4m?--- Because sparc-v9 has
compare-and-swap for atomic operations??? But that's a question for a
different thread.)

Thanks again,
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