Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Which gcc is for me? [Solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
Gustav IV
n00b
n00b


Joined: 10 Jan 2007
Posts: 69
Location: Copenhagen

PostPosted: Tue May 19, 2009 7:08 pm    Post subject: Which gcc is for me? [Solved] Reply with quote

Hi everyone

I've emerged, per chance by accident, gcc 4.3.3, and I also have kgcc64 4.2.4. But I don't know which of the two I need for my 64bit kernel and 32bit userland configuration. I would like to recompile my kernel and I also get stumped by what to write in the new kernels Makefile
Code:
CROSS_COMPILE   ?= powerpc64-unknown-linux-gnu-

this is my /usr directory:
Code:
puccini ~ # ls /usr           
X11R6  bin  include  lib  libexec  local  portage  powerpc-unknown-linux-gnu  qt  sbin  share  src  tmp
puccini ~ # ls /usr/powerpc-unknown-linux-gnu/
bin  binutils-bin  gcc-bin  lib  powerpc64-unknown-linux-gnu
puccini ~ # ls /usr/powerpc-unknown-linux-gnu/powerpc64-unknown-linux-gnu/
gcc-bin
puccini ~ #

Which gcc should I set my profil to and what should CROSS_COMPILE be set to, in order to properly make a kernel?
Code:
puccini ~ # gcc-config -l
 [1] powerpc-unknown-linux-gnu-4.1.2
 [2] powerpc-unknown-linux-gnu-4.3.3 *
 [3] powerpc64-unknown-linux-gnu-4.2.4 *
puccini ~ #

Just for clarity, the 4.3.3 has a green asterix and the 4.2.4 has a blue one.

I would be grateful for any help

cheers

Gustav IV
_________________
"Hey, hey, hey — don't be mean. No need to be mean. 'Cause, remember: no matter where you go... there you are." - Buckaroo Banzai


Last edited by Gustav IV on Mon Jun 01, 2009 5:25 am; edited 1 time in total
Back to top
View user's profile Send private message
alex.blackbit
Advocate
Advocate


Joined: 26 Jul 2005
Posts: 2397

PostPosted: Wed May 20, 2009 7:45 pm    Post subject: Reply with quote

first i have to say that i do not have any experience with kernels having a different bit-ness than the userland, nor with powerpc machines.
but if you want to compile a 64bit kernel, you will want to set the CROSS_COMPILE variable to the 64bit compiler, powerpc64-unknown-linux-gnu-4.2.4.
i think the blue asterisk marks the compilers that are from alien architectures, in your case powerpc64, but i did not find any docs proving that.
imo your system compiler should be the latest 32bit one, already the case with your configuration.

just give it a try that way.
make sure that you keep the current kernel available in your boot loader (whatever that might be on powerpc) so that you can go back if something goes wrong.
Back to top
View user's profile Send private message
JoseJX
Retired Dev
Retired Dev


Joined: 28 Apr 2002
Posts: 2774

PostPosted: Thu May 21, 2009 5:56 pm    Post subject: Reply with quote

First, the asterisk denotes which version of the compiler is default. It is possible to have more than one as the default is on a per architecture basis.

First, type:
Code:

$ powerpc64-unknown-linux-gnu-gcc -v


This should return with a bunch of text and at the bottom, tell you which version of gcc it is. It should be 4.2.4, which is your 64 bit compiler.

Next, type:
Code:

$ powerpc-unknown-linux-gnu-gcc -v


This should again print some text and tell you which version of gcc is set. According to your previous post, it should be 4.3.3. Gentoo keeps older compiler versions around, as some users may want to switch between compilers for different features or stability.

Now that you have determined that your compilers are working and that things are properly configured, you can run your kernel config. In a 32 bit userland, the kernel still needs to be compiled as a 64 bit kernel on PowerPC. This is accomplished by setting the "CROSS_COMPILE" variable to the base name of your toolchain. In this case, we look above and see that we used "powerpc64-unknown-linux-gnu-gcc" to run the 64 bit compiler. As such, the base name you will set "CROSS_COMPILE" to is: "powerpc64-unknown-linux-gnu-". You didn't specify what kind of PowerPC machine you have, but I would recommend first setting the default configuration for that platform before configuring and compiling the kernel.

Hope that helps.
_________________
Gentoo PPC FAQ: http://www.gentoo.org/doc/en/gentoo-ppc-faq.xml
Back to top
View user's profile Send private message
Gustav IV
n00b
n00b


Joined: 10 Jan 2007
Posts: 69
Location: Copenhagen

PostPosted: Mon Jun 01, 2009 5:24 am    Post subject: Reply with quote

Metric Tonnes of thanks! I reshaped my kernel and recompiled it without a hitch. Apparently the initial trouble I hit was setting the Cross Compile flag in the Makefile after a session of kernel configuring. Once I had done this prior to using make menuconfig all went well.

But it's good to know that about the compile set-up when using the two diffent bit set-up.

best regards,

Gustav IV
_________________
"Hey, hey, hey — don't be mean. No need to be mean. 'Cause, remember: no matter where you go... there you are." - Buckaroo Banzai
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC 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