> > > 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: pgp00000.pgp
Description: PGP signature

Reply via email to