From: Steven Smith <sos22@cam.ac.uk>
To: Flemming Greve Skovengaard <dsl58893@vip.cybercity.dk>
Cc: linux-newbie@vger.kernel.org
Subject: Re: Compiler flags, kernel-complie
Date: Sat, 31 May 2003 22:22:57 +0100 [thread overview]
Message-ID: <20030531212257.GA9369@cam.ac.uk> (raw)
In-Reply-To: <3ED90D87.7050507@vip.cybercity.dk>
[-- 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 --]
next prev parent reply other threads:[~2003-05-31 21:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2003-05-31 20:22 ` pa3gcu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030531212257.GA9369@cam.ac.uk \
--to=sos22@cam.ac.uk \
--cc=dsl58893@vip.cybercity.dk \
--cc=linux-newbie@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.