LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   What are the effects of using the march and mcpu CFLAGS? (https://www.linuxquestions.org/questions/linux-software-2/what-are-the-effects-of-using-the-march-and-mcpu-cflags-225007/)

enigma Z 08-31-2004 07:17 PM

What are the effects of using the march and mcpu CFLAGS?
 
What does g++, gcc, etc do if I supply both an march and an mcpu flag when I compile?

example:

CFLAGS="-march=athlon-tbird -02 -mcpu=i686 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

foo_bar_foo 08-31-2004 11:30 PM

specifying -march=cpu-type implies -mcpu=cpu-type.
so just use -march is the thing to do
however if you use both like your example
-march=athlon-tbird -mcpu=i686
then gcc will use the machine instruction for a i686 that don't destroy compatibility to the architecture (cpu) specified with -march in this case athlon-tbird
i think but can't swear to it and i don't know where this is implemented in the gcc code
the documentation for gcc is non existent so i'm just repeating what some else told me once
(yet another gcc rumor)
seems like quite a nightmare when you think about it though implementing that ?

crashmeister 09-01-2004 04:54 AM

Quote:

Originally posted by foo_bar_foo

i think but can't swear to it and i don't know where this is implemented in the gcc code
the documentation for gcc is non existent so i'm just repeating what some else told me once
(yet another gcc rumor)
seems like quite a nightmare when you think about it though implementing that ?

Say what???? - http://gcc.gnu.org/onlinedocs/

Anything you never wanted to know and more is documented there. :D


All times are GMT -5. The time now is 04:08 PM.