2005-12-30 05:52:55

by Mukund JB.

[permalink] [raw]
Subject: Howto set kernel makefile to use particular gcc


Dear Kernel mailers,

I have specific requirement of building kernel 2.6.11.12 with gcc- 3.3 over the FC4 dist.
I have downloaded the gcc-3.3.
As FC4 comes with a default gcc-4.0, how do I set the kernel Makefile to use the gcc-3.3 instead of gcc-4.0.

How do I achieve it? I know it is a very small issue and searched google and I am unable to find it.
Please help.

Regards,
Mukund Jampala



2005-12-30 06:58:49

by Alessandro Suardi

[permalink] [raw]
Subject: Re: Howto set kernel makefile to use particular gcc

On 12/30/05, Mukund JB. <[email protected]> wrote:
>
> Dear Kernel mailers,
>
> I have specific requirement of building kernel 2.6.11.12 with gcc- 3.3 over the FC4 dist.
> I have downloaded the gcc-3.3.
> As FC4 comes with a default gcc-4.0, how do I set the kernel Makefile to use the gcc-3.3 instead of gcc-4.0.
>
> How do I achieve it? I know it is a very small issue and searched google and I am unable to find it.

Leave the kernel Makefile alone, and say

cd /usr/src/linux
make CC=<path_to_your_gcc_3.3>

--alessandro

"Somehow all you ever need is, never really quite enough, you know"

(Bruce Springsteen - "Reno")

2005-12-30 07:09:49

by Mukund JB.

[permalink] [raw]
Subject: RE: Howto set kernel makefile to use particular gcc


Dear Alessandro,

Thanks for the reply.
What does that the make CC=<path_to_your_gcc_3.3> do?
Will it set my gcc default build configuration to gcc 3.3?

I mean the general procedure is make bzImage; make modules....
How do I do these:

Will I have to do it like:
make bzImage cc=<gcc path>

Best Regards,
Mukund Jampala


> -----Original Message-----
> From: Alessandro Suardi [mailto:[email protected]]
> Sent: Friday, December 30, 2005 12:29 PM
> To: Mukund JB.
> Cc: [email protected]
> Subject: Re: Howto set kernel makefile to use particular gcc
>
>
> On 12/30/05, Mukund JB. <[email protected]> wrote:
> >
> > Dear Kernel mailers,
> >
> > I have specific requirement of building kernel 2.6.11.12
> with gcc- 3.3 over the FC4 dist.
> > I have downloaded the gcc-3.3.
> > As FC4 comes with a default gcc-4.0, how do I set the
> kernel Makefile to use the gcc-3.3 instead of gcc-4.0.
> >
> > How do I achieve it? I know it is a very small issue and
> searched google and I am unable to find it.
>
> Leave the kernel Makefile alone, and say
>
> cd /usr/src/linux
> make CC=<path_to_your_gcc_3.3>
>
> --alessandro
>
> "Somehow all you ever need is, never really quite enough, you know"
>
> (Bruce Springsteen - "Reno")
>

2005-12-30 07:23:15

by Chris White

[permalink] [raw]
Subject: Re: Howto set kernel makefile to use particular gcc

On Friday 30 December 2005 16:04, Mukund JB. wrote:
> Dear Alessandro,
>
> Thanks for the reply.
> What does that the make CC=<path_to_your_gcc_3.3> do?
> Will it set my gcc default build configuration to gcc 3.3?

Not Alessandro but,

CC sets the CC makefile variable. When the kernel build system goes to
compile something, it doesn't call on gcc directly, but rather what the
variable CC is set to. By setting it to your gcc 3.3 compiler, it will use
that instead.

> I mean the general procedure is make bzImage; make modules....
> How do I do these:
>
> Will I have to do it like:
> make bzImage cc=<gcc path>

make CC=<gcc path> bzImage

note the case sensitivity, which tends to be somewhat of a pain for new *nix
users.

> Best Regards,
> Mukund Jampala

Chris White


Attachments:
(No filename) (782.00 B)
(No filename) (189.00 B)
Download all attachments

2005-12-30 07:30:53

by Mukund JB.

[permalink] [raw]
Subject: RE: Howto set kernel makefile to use particular gcc


Thanks for that.
I will test it

thanks,
Mukund Jampala

> -----Original Message-----
> From: Chris White [mailto:[email protected]]
> Sent: Friday, December 30, 2005 12:54 PM
> To: Mukund JB.
> Cc: Alessandro Suardi; [email protected]
> Subject: Re: Howto set kernel makefile to use particular gcc
>
>
> On Friday 30 December 2005 16:04, Mukund JB. wrote:
> > Dear Alessandro,
> >
> > Thanks for the reply.
> > What does that the make CC=<path_to_your_gcc_3.3> do?
> > Will it set my gcc default build configuration to gcc 3.3?
>
> Not Alessandro but,
>
> CC sets the CC makefile variable. When the kernel build
> system goes to
> compile something, it doesn't call on gcc directly, but
> rather what the
> variable CC is set to. By setting it to your gcc 3.3
> compiler, it will use
> that instead.
>
> > I mean the general procedure is make bzImage; make modules....
> > How do I do these:
> >
> > Will I have to do it like:
> > make bzImage cc=<gcc path>
>
> make CC=<gcc path> bzImage
>
> note the case sensitivity, which tends to be somewhat of a
> pain for new *nix
> users.
>
> > Best Regards,
> > Mukund Jampala
>
> Chris White
>

2005-12-30 08:25:08

by Jesper Juhl

[permalink] [raw]
Subject: Re: Howto set kernel makefile to use particular gcc

On 12/30/05, Mukund JB. <[email protected]> wrote:
>
> Dear Alessandro,
>
> Thanks for the reply.
> What does that the make CC=<path_to_your_gcc_3.3> do?
> Will it set my gcc default build configuration to gcc 3.3?
>
> I mean the general procedure is make bzImage; make modules....

That was the common way with 2.4.x kernels. Sure, you can still do
that, but with 2.6.x the recommended thing is to just do "make" (or in
your case "make CC=</path/to/gcc-3.3>") which will both build the
kernel and the modules.


--
Jesper Juhl <[email protected]>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html

2005-12-31 00:42:28

by Jiri Slaby

[permalink] [raw]
Subject: Re: Howto set kernel makefile to use particular gcc

Mukund JB. wrote:
>Thanks for that.
>I will test it
I only add some information -- in FC4, there is compat-gcc-32 package, so you
may simply do `make CC=gcc32'.

regards,
--
Jiri Slaby http://www.fi.muni.cz/~xslaby
\_.-^-._ [email protected] _.-^-._/
B67499670407CE62ACC8 22A032CC55C339D47A7E

2006-01-01 10:03:29

by Kalin KOZHUHAROV

[permalink] [raw]
Subject: Re: Howto set kernel makefile to use particular gcc

Chris White wrote:
> On Friday 30 December 2005 16:04, Mukund JB. wrote:
>
>>Dear Alessandro,
>>
>>Thanks for the reply.
>>What does that the make CC=<path_to_your_gcc_3.3> do?
>>Will it set my gcc default build configuration to gcc 3.3?
>
>
> Not Alessandro but,
>
> CC sets the CC makefile variable. When the kernel build system goes to
> compile something, it doesn't call on gcc directly, but rather what the
> variable CC is set to. By setting it to your gcc 3.3 compiler, it will use
> that instead.
>
>
>>I mean the general procedure is make bzImage; make modules....
>>How do I do these:
>>
>>Will I have to do it like:
>> make bzImage cc=<gcc path>
>
>
> make CC=<gcc path> bzImage
>
> note the case sensitivity, which tends to be somewhat of a pain for new *nix
> users.

As I just stumbeled into a similar problem, I am going to ask here.

I know the "trick" of `make -j8 CC=distcc` and I always use it. But is there a way to hardwire
"CC=distcc" insie the Makefile? Just setting it there does not help it seems.

Kalin.

--
|[ ~~~~~~~~~~~~~~~~~~~~~~ ]|
+-> http://ThinRope.net/ <-+
|[ ______________________ ]|

2006-01-01 11:09:43

by Marc Giger

[permalink] [raw]
Subject: Re: Howto set kernel makefile to use particular gcc

On Sun, 01 Jan 2006 19:03:15 +0900
Kalin KOZHUHAROV <[email protected]> wrote:

> Chris White wrote:
> > On Friday 30 December 2005 16:04, Mukund JB. wrote:
> >
> >>Dear Alessandro,
> >>
> >>Thanks for the reply.
> >>What does that the make CC=<path_to_your_gcc_3.3> do?
> >>Will it set my gcc default build configuration to gcc 3.3?
> >
> >
> > Not Alessandro but,
> >
> > CC sets the CC makefile variable. When the kernel build system goes
> > to compile something, it doesn't call on gcc directly, but rather
> > what the variable CC is set to. By setting it to your gcc 3.3
> > compiler, it will use that instead.
> >
> >
> >>I mean the general procedure is make bzImage; make modules....
> >>How do I do these:
> >>
> >>Will I have to do it like:
> >> make bzImage cc=<gcc path>
> >
> >
> > make CC=<gcc path> bzImage
> >
> > note the case sensitivity, which tends to be somewhat of a pain for
> > new *nix users.
>
> As I just stumbeled into a similar problem, I am going to ask here.
>
> I know the "trick" of `make -j8 CC=distcc` and I always use it. But is
> there a way to hardwire "CC=distcc" insie the Makefile? Just setting
> it there does not help it seems.

Why would you "hardwire" it?
#export CC="distcc"
should do it.

It seems you forgot to specify the compiler:
#export CC="distcc <arch-blablabla->gcc" should be the correct way. What
I do is:

#export DISTCC_HOSTS="localhost <machine1 machine2 machineN>"
#make CC="distcc ccache gcc" -j5 bzImage modules

Marc

2006-01-01 11:18:30

by Keith Owens

[permalink] [raw]
Subject: Re: Howto set kernel makefile to use particular gcc

Marc Giger (on Sun, 1 Jan 2006 12:13:03 +0100) wrote:
>Why would you "hardwire" it?
>#export CC="distcc"
>should do it.

Doubt it. From 'info make', Node: Environment.

Variables in `make' can come from the environment in which `make' is
run. Every environment variable that `make' sees when it starts up
is transformed into a `make' variable with the same name and value.
But an explicit assignment in the makefile, or with a command
argument, overrides the environment. (If the `-e' flag is specified,
then values from the environment override assignments in the
makefile. *Note Summary of Options: Options Summary. But this is
not recommended practice.)

The kernel Makefile explicitly sets CC which overrides the environment
value, but does not override a command line definition of CC. IOW, do
not reply on environment variables always working with make.

2006-01-01 11:34:10

by Marc Giger

[permalink] [raw]
Subject: Re: Howto set kernel makefile to use particular gcc

Keith, your domain seems not to be resolvable...

On Sun, 01 Jan 2006 22:18:27 +1100
Keith Owens <[email protected]> wrote:

> Marc Giger (on Sun, 1 Jan 2006 12:13:03 +0100) wrote:
> >Why would you "hardwire" it?
> >#export CC="distcc"
> >should do it.
>
> Doubt it. From 'info make', Node: Environment.
>
> Variables in `make' can come from the environment in which `make'
> is
> run. Every environment variable that `make' sees when it starts up
> is transformed into a `make' variable with the same name and value.
> But an explicit assignment in the makefile, or with a command
> argument, overrides the environment. (If the `-e' flag is
> specified, then values from the environment override assignments in
> the makefile. *Note Summary of Options: Options Summary. But this
> is not recommended practice.)
>
> The kernel Makefile explicitly sets CC which overrides the environment
> value, but does not override a command line definition of CC. IOW, do
> not reply on environment variables always working with make.

You are absolutely right. Because I never used it in this way, I wrote
"should":-) I specify it always on the make command line.

So if Kalin would like to hardwire it, he has to change the CC variable
in the Makefile...

Thank you

Marc

2006-01-01 11:50:13

by Kalin KOZHUHAROV

[permalink] [raw]
Subject: Re: Howto set kernel makefile to use particular gcc

You never know where you'll get most response:-)

Marc Giger wrote:
> Keith, your domain seems not to be resolvable...
Yup... very strange. Not proper delegation to zoneedit.com?

kalin@kpc ~ $ whois ocs.com.au |grep ^Name
Name Server: ns2.zoneedit.com
Name Server: ns3.zoneedit.com
Name Server: ns1.ocs.com.au
Name Server IP: 202.147.117.210

kalin@kpc ~ $ dnsq any ocs.com.au ns2.zoneedit.com
255 ocs.com.au:
167 bytes, 1+4+2+0 records, response, authoritative, noerror
query: 255 ocs.com.au
answer: ocs.com.au 7200 A 0.0.0.0
# --> H E R E <--
answer: ocs.com.au 7200 NS ns2.zoneedit.com
answer: ocs.com.au 7200 NS ns3.zoneedit.com
answer: ocs.com.au 7200 SOA ns2.zoneedit.com soacontact.zoneedit.com 1135991510
14400 7200 950400 7200
authority: ocs.com.au 7200 NS ns2.zoneedit.com
authority: ocs.com.au 7200 NS ns3.zoneedit.com

kalin@kpc ~ $ dnsq any ocs.com.au 202.147.117.210
255 ocs.com.au:
221 bytes, 1+5+0+4 records, response, authoritative, noerror
query: 255 ocs.com.au
answer: ocs.com.au 172800 SOA mail.ocs.com.au admin.mail.ocs.com.au 2005123101 1
0800 3600 604800 86400
answer: ocs.com.au 172800 MX 0 mail.ocs.com.au
answer: ocs.com.au 172800 NS ns1.ocs.com.au
answer: ocs.com.au 172800 NS ns2.zoneedit.com
answer: ocs.com.au 172800 NS ns3.zoneedit.com
additional: mail.ocs.com.au 172800 A 202.147.117.210
additional: ns1.ocs.com.au 172800 A 202.147.117.210
additional: ns2.zoneedit.com 158763 A 69.72.158.226
additional: ns3.zoneedit.com 158763 A 66.180.174.61

kalin@kpc ~ $ dnsname 202.147.117.210
mail.ocs.com.au

> On Sun, 01 Jan 2006 22:18:27 +1100
> Keith Owens <[email protected]> wrote:
>
>
>>Marc Giger (on Sun, 1 Jan 2006 12:13:03 +0100) wrote:
>>
>>>Why would you "hardwire" it?
>>>#export CC="distcc"
>>>should do it.
>>
>>Doubt it. From 'info make', Node: Environment.
>>
>> Variables in `make' can come from the environment in which `make'
>> is
>> run. Every environment variable that `make' sees when it starts up
>> is transformed into a `make' variable with the same name and value.
>> But an explicit assignment in the makefile, or with a command
>> argument, overrides the environment. (If the `-e' flag is
>> specified, then values from the environment override assignments in
>> the makefile. *Note Summary of Options: Options Summary. But this
>> is not recommended practice.)
>>
>>The kernel Makefile explicitly sets CC which overrides the environment
>>value, but does not override a command line definition of CC. IOW, do
>>not reply on environment variables always working with make.
>
>
> You are absolutely right. Because I never used it in this way, I wrote
> "should":-) I specify it always on the make command line.
>
> So if Kalin would like to hardwire it, he has to change the CC variable
> in the Makefile...
My point was that changing it in the Makefile does not work.

kpc ~ # grep CC= /usr/src/linux/Makefile
CC=distcc
# echo $CC

kpc ~ # uname -a
Linux kpc 2.6.14.4-K01_P4_desktop #1 Sun Dec 18 22:46:08 JST 2005 i686 Intel(R) Pentium(R) 4 CPU
2.40GHz GenuineIntel GNU/Linux

What I want is making a bunch of kernels in NFS exported /var/kernels/out/`uname -r` and then be
able to `make modules` on other machines without having to recompile the whole thing. All (or
almost?) boxes use gcc-3.4.4 and distcc to share the load.

Kalin.
--
|[ ~~~~~~~~~~~~~~~~~~~~~~ ]|
+-> http://ThinRope.net/ <-+
|[ ______________________ ]|

2006-01-01 12:00:57

by Adrian Bunk

[permalink] [raw]
Subject: Re: Howto set kernel makefile to use particular gcc

On Sun, Jan 01, 2006 at 07:03:15PM +0900, Kalin KOZHUHAROV wrote:
>
> As I just stumbeled into a similar problem, I am going to ask here.
>
> I know the "trick" of `make -j8 CC=distcc` and I always use it. But is there a way to hardwire
> "CC=distcc" insie the Makefile? Just setting it there does not help it seems.

Setting it somewhere at the top of the Makefile doesn't help since the
Makefile sets it itself later overriding your setting.

The Makefile contains the line
CC = $(CROSS_COMPILE)gcc

Change this line to
CC = $(CROSS_COMPILE)distcc

> Kalin.

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

2006-01-01 13:09:38

by Keith Owens

[permalink] [raw]
Subject: Re: Howto set kernel makefile to use particular gcc

Marc Giger (on Sun, 1 Jan 2006 12:37:29 +0100) wrote:
>Keith, your domain seems not to be resolvable...

Thanks for that. For some reason my secondary zones at zonedit.com
were refusing to accept my recent DNS updates. So I dropped zonedit
and switched to twisted4life.com as a secondary. As a bonus,
twisted4life also provide a DNS checker which I could never find on
zoneedit. It should all be resolving now, or as soon as the refresh
interval expires.

2006-01-02 06:05:52

by Mukund JB.

[permalink] [raw]
Subject: RE: Howto set kernel makefile to use particular gcc

Jasper,

But I was doing it all that I was doing with 2.4 i.e. the follwoing steps to build the kernel.
I also found these steps are followed in the 2.6.x kernel build howto's too.

Do you mean, to rebuild the 2.6.x kernel,

make CC=<path of gcc> would be enough?

I am just thinking whether I am doing something redundent.

Regards,
Mukund Jampala


> -----Original Message-----
> From: Jesper Juhl [mailto:[email protected]]
> Sent: Friday, December 30, 2005 1:55 PM
> To: Mukund JB.
> Cc: Alessandro Suardi; [email protected]
> Subject: Re: Howto set kernel makefile to use particular gcc
>
>
> On 12/30/05, Mukund JB. <[email protected]> wrote:
> >
> > Dear Alessandro,
> >
> > Thanks for the reply.
> > What does that the make CC=<path_to_your_gcc_3.3> do?
> > Will it set my gcc default build configuration to gcc 3.3?
> >
> > I mean the general procedure is make bzImage; make modules....
>
> That was the common way with 2.4.x kernels. Sure, you can still do
> that, but with 2.6.x the recommended thing is to just do "make" (or in
> your case "make CC=</path/to/gcc-3.3>") which will both build the
> kernel and the modules.
>
>
> --
> Jesper Juhl <[email protected]>
> Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
> Plain text mails only, please http://www.expita.com/nomime.html
>

2006-01-02 07:19:24

by Kalin KOZHUHAROV

[permalink] [raw]
Subject: Re: Howto set kernel makefile to use particular gcc

Adrian Bunk wrote:
> On Sun, Jan 01, 2006 at 07:03:15PM +0900, Kalin KOZHUHAROV wrote:
>
>>As I just stumbeled into a similar problem, I am going to ask here.
>>
>>I know the "trick" of `make -j8 CC=distcc` and I always use it. But is there a way to hardwire
>>"CC=distcc" insie the Makefile? Just setting it there does not help it seems.
>
>
> Setting it somewhere at the top of the Makefile doesn't help since the
> Makefile sets it itself later overriding your setting.
>
> The Makefile contains the line
> CC = $(CROSS_COMPILE)gcc
>
> Change this line to
> CC = $(CROSS_COMPILE)distcc

Thanks! That works perfect, now rebuilding the 2.6.14.5 series :-)

Kalin.
--
|[ ~~~~~~~~~~~~~~~~~~~~~~ ]|
+-> http://ThinRope.net/ <-+
|[ ______________________ ]|

2006-01-02 07:30:39

by Kalin KOZHUHAROV

[permalink] [raw]
Subject: Re: Howto set kernel makefile to use particular gcc

Do not top-post!
http://en.wikipedia.org/wiki/Toppost

Mukund JB. wrote:
> Jasper,
>
> But I was doing it all that I was doing with 2.4 i.e. the follwoing steps to build the kernel.
> I also found these steps are followed in the 2.6.x kernel build howto's too.
>
> Do you mean, to rebuild the 2.6.x kernel,
>
> make CC=<path of gcc> would be enough?
>
Yes that will do to compile any 2.6.x kernel.

> I am just thinking whether I am doing something redundent.
Just a bit, usually not a problem (but may be wrong).

Kalin.
--
|[ ~~~~~~~~~~~~~~~~~~~~~~ ]|
+-> http://ThinRope.net/ <-+
|[ ______________________ ]|