[PLUG] gcc games

Felix Lee flee at aracnet.com
Thu Jun 6 00:55:48 UTC 2002


Rich Shepard <rshepard at appl-ecosys.com>:
>   To follow up on Carla's question of yesterday, here's an observation. I'm
> rebuilding the src.rpm for lyx-1.2.0 (released last Wednesday) and I see the
> following two compiler directives scroll by: "-march=i386 -mcpu=i686". So,
> there's apparently a difference betwixt the two.

-mcpu=i686 tells gcc to do instruction scheduling and
similar optimizations based on the assumption that the
target is an i686 chip.  If you run the resulting executable
on an i386, it may be a little slower than if you compiled
with -mcpu=i386, but it will still run.

-march=i686 tells gcc it can use machine instructions that
are only available on i686 chips, so the resulting
executable may not run on an i386 at all.

specifying -march also implies the corresponding -mcpu flag,
so "-march=i386 -mcpu=i686" means to use only i386
instructions, probably for maximum compatibility, but
optimize it for i686 chips, on the assumption that most
people out there have an i686.
--
[ sometimes there's a black car in the sun ]




More information about the PLUG mailing list