[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: tune gcc



On Mon, Mar 17, 2003 at 09:47:48AM -0500, ronin2@bellatlantic.net wrote:
> On Mon, 17 Mar 2003 22:10:06 +1100
> Rob Weir <rweir@ertius.org> wrote:
> 
> > Sure.  You can either set the 'CFLAGS' environment variable (which all
> > sane build systems will respect), or you can install the
> > 'pentium-builder' package and use that.
> 
> Is that really necessary? Doesn't gcc by default build for the same
> processor it's running on?

Well, kinda.  On any x86 machine, it effectively runs with '-march=386'
or whatever, generating code that'll run on anything from the 386 up.
I'm presuming the OP wanted to force GCC to use processor-specific
optimisations, which requires passing it the '-march=pentiumpro'
option, along with '-O2 -fomit-frame-pointer' or whatever else you want.

> If setting CFLAGS is the answer, do you need to set all of them, or only
> the one you want to change?

GCC doesn't (AFAIK) interpret the CFLAGS variable, but most build
systems (including automake, which most stuff uses) pass them to GCC.
You can just stick it in your ~/.bash_profile or such, so that anything
you compile (well, mostly) will use it.

Of course, not *everything* takes CFLAGS into account, which is why I
suggested pentium-builder, which, as I understand it, wraps gcc and lets
you specify arbitrary options that ALL invocations of GCC will use.

Hm, I don't think I quite got what you meant there...You just set
whatever flags you'd set on the command line, anyway...

-- 
Rob Weir <rweir@ertius.org>				http://ertius.org/

Attachment: pgpROkkDsYkOO.pgp
Description: PGP signature


Reply to: