Re: Fine tuning gcc build to machine specific properties

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

 



Ted Byers wrote:

> I tried passing something like -msse2 and
> -march=athlon64 to configure, but configure rejected
> these, claiming that there are no floags like these
> for the configure script.  I found these flags in the
> gcc documentation, so I am confused.  How do I tell
> configure to build executables optimized for my
> processor?  Or does that not work well for cygwin on
> WXP on an AMD Athlon 64 X 2?

Those are gcc options, they aren't configure options.  Specify them to
gcc when building software and it will do what you want.  Normally you
do this by setting the variables CFLAGS for C and CXXFLAGS for C++. 
Autoconf based packages automatically set these to "-g -O2" if they are
not set by the user (and it detects you're using gcc), which means if
you want to set them yourself you probably want to include "-g -O2" in
your own settings, otherwise the default means no optimization and no
debug information.

The only time you'd specify anything to configure is if you want to
change the default value of -march and -mtune that is "baked in" to gcc,
which you do with --with-arch and --with-tune.  But that is not the
usual way of doing things, and it's certainly not necessary to rebuild
gcc every time you want to change this.  It's a lot easier just to leave
gcc generic by default and set your desired *FLAGS.

Brian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux