All of lore.kernel.org
 help / color / mirror / Atom feed
* Compiler flags, kernel-complie
@ 2003-05-31 19:30 Flemming Greve Skovengaard
  2003-05-31 19:53 ` Steven Smith
  2003-05-31 20:22 ` pa3gcu
  0 siblings, 2 replies; 5+ messages in thread
From: Flemming Greve Skovengaard @ 2003-05-31 19:30 UTC (permalink / raw)
  To: linux-newbie

I have set the enviroment variables $CFLAGS and $CXXFLAGS to:

-O2 -march=athlon-xp

Now my question is will this effect my kernel-compile?

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Compiler flags, kernel-complie
  2003-05-31 19:30 Compiler flags, kernel-complie Flemming Greve Skovengaard
@ 2003-05-31 19:53 ` Steven Smith
  2003-05-31 20:16   ` Flemming Greve Skovengaard
  2003-05-31 20:22 ` pa3gcu
  1 sibling, 1 reply; 5+ messages in thread
From: Steven Smith @ 2003-05-31 19:53 UTC (permalink / raw)
  To: Flemming Greve Skovengaard; +Cc: linux-newbie

[-- Attachment #1: Type: text/plain, Size: 340 bytes --]

> I have set the enviroment variables $CFLAGS and $CXXFLAGS to:
> 
> -O2 -march=athlon-xp
> 
> Now my question is will this effect my kernel-compile?
Shouldn't do; the kernel doesn't normally inherit CFLAGS and friends
from the environment.  The correct way to do this is through the
``Processor type'' part of make {x,menu}config.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Compiler flags, kernel-complie
  2003-05-31 19:53 ` Steven Smith
@ 2003-05-31 20:16   ` Flemming Greve Skovengaard
  2003-05-31 21:22     ` Steven Smith
  0 siblings, 1 reply; 5+ messages in thread
From: Flemming Greve Skovengaard @ 2003-05-31 20:16 UTC (permalink / raw)
  To: Steven Smith; +Cc: linux-newbie

Steven Smith wrote:
>>I have set the enviroment variables $CFLAGS and $CXXFLAGS to:
>>
>>-O2 -march=athlon-xp
>>
>>Now my question is will this effect my kernel-compile?
> 
> Shouldn't do; the kernel doesn't normally inherit CFLAGS and friends
> from the environment.  The correct way to do this is through the
> ``Processor type'' part of make {x,menu}config.
Well it seems like that $CFLAGS is overwriten in 
'/usr/src/linux/Makefiles' og exported.
But when I compile kernel it compiles with '-march=athlon', how do I 
change this?

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Compiler flags, kernel-complie
  2003-05-31 19:30 Compiler flags, kernel-complie Flemming Greve Skovengaard
  2003-05-31 19:53 ` Steven Smith
@ 2003-05-31 20:22 ` pa3gcu
  1 sibling, 0 replies; 5+ messages in thread
From: pa3gcu @ 2003-05-31 20:22 UTC (permalink / raw)
  To: Flemming Greve Skovengaard, linux-newbie

On Saturday 31 May 2003 21:30, Flemming Greve Skovengaard wrote:
> I have set the enviroment variables $CFLAGS and $CXXFLAGS to:

Why bother, if one chooses the correct processor type during configuration of 
the kernel with make config / xconfig / menuconfig then changing the Topdir 
Makefile would NOT be nessasary, (afaik) that is.

> -O2 -march=athlon-xp
>
> Now my question is will this effect my kernel-compile?

When you define a processor type during configuration then the variable's get 
changes accordingly.

-- 
Regards Richard
pa3gcu@zeelandnet.nl
http://people.zeelandnet.nl/pa3gcu/



-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Compiler flags, kernel-complie
  2003-05-31 20:16   ` Flemming Greve Skovengaard
@ 2003-05-31 21:22     ` Steven Smith
  0 siblings, 0 replies; 5+ messages in thread
From: Steven Smith @ 2003-05-31 21:22 UTC (permalink / raw)
  To: Flemming Greve Skovengaard; +Cc: linux-newbie

[-- Attachment #1: Type: text/plain, Size: 1442 bytes --]

> > > I have set the enviroment variables $CFLAGS and $CXXFLAGS to:
> > > -O2 -march=athlon-xp
> > > Now my question is will this effect my kernel-compile?
> > Shouldn't do; the kernel doesn't normally inherit CFLAGS and friends
> > from the environment.  The correct way to do this is through the
> > ``Processor type'' part of make {x,menu}config.
> Well it seems like that $CFLAGS is overwriten in 
> '/usr/src/linux/Makefiles' og exported.
> But when I compile kernel it compiles with '-march=athlon', how do I 
> change this?
The first thing to point is that you probably don't want to: some
compiler flags (e.g. -O3) are known to create broken and buggy
kernels, which is why there's no nice way of setting it.

Having said that, if you want to live dangerously, the trick would be
to turn the fragment

ifdef CONFIG_K7
CFLAGS += $(shell if $(CC) ... fi)
endif

into

ifdef CONFIG_K7
CFLAGS += -march=athlon-xp
endif

in arch/i386/Makefile.  Of course, that'll change it to
-march=athlon-xp even if you select plain Athlon in the kernel config,
but adding a new menu item is a relative pain.  If it really bothers
you, have a look in arch/i386/config.in.

Changing the CFLAGS like this will result in a completely unsupported
kernel, though, and one which could well be a little unstable.  Do it
at your own risk.  I haven't even tested that the resulting thing
compiles, let alone works.

Steven.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-05-31 21:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-31 19:30 Compiler flags, kernel-complie Flemming Greve Skovengaard
2003-05-31 19:53 ` Steven Smith
2003-05-31 20:16   ` Flemming Greve Skovengaard
2003-05-31 21:22     ` Steven Smith
2003-05-31 20:22 ` pa3gcu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.