[TWEAK] - gcc defaults
gschafer at zip.com.au
Tue Jul 15 03:04:00 PDT 2003
Sorry for being a little OT but this is so nifty I just have to share it :-)
I backported this patch from the gcc CVS HEAD (aka 3.4). With it, you can
set defaults for gcc for -march and -mcpu and so forth. Unlike previous
incarnations of default arch hacks, this implementation is clean and
Want your gcc to emit pentium4 code by default (same as if -march=pentium4
was passed on the gcc command line) without futzing around with CFLAGS?
Easy, just add this to your gcc configure arguments when building gcc:-
A more conservative use could be something like... if for instance you
have an athlon-xp but your platform gets reported as i686-pc-linux-gnu:-
then gcc will emit code by default as if -march=i386 and -mcpu=athlon-xp
instead of the current -march=i386 and -mcpu=i686
You can check gcc's output by using "-fverbose-asm" in combo with "-S" or
"-save-temps" as per usual. Or you can inspect the generated assembly by
hand if that's what floats your boat.
Just so it's clear, this changes only the DEFAULTS. i.e. specifying -march
and -mcpu on the gcc commandline still works exactly like before.
This is against gcc-3.3.1-cvs but should apply against 3.3. More details in
the patch itself. Note especially the comment about testsuite regressions.
Usual disclaimers apply, blah..
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 6119 bytes
Desc: not available
More information about the lfs-dev