This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to tune gcc for different x86 host and target cpus?


Ian Lance Taylor wrote:

Michael Roth <mroth@nessie.de> writes:

But how can I tell the configure script that the compiler itself
should be optimized for a different cpu architecture?


One way is to set CFLAGS when you compile.  The default value for
CFLAGS is "-g -O2" (when compiling with gcc).


Example #1: Host and build are athlon-xp, target should be pentium.


make CFLAGS="-g -O2 -march=athlon"

Thank you. This did the job.



I think that if you set the environment variable CFLAGS when you run
configure, it will be picked up and stored in the Makefile.  Try it by
looking at the definition of CFLAGS in the top level Makefile after
you run configure.

I'm not sure, I tried this before I posted to this list, and I think it didn't worked well. But I could be wrong.



Michael



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]