Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 187209 - confusing definitions of -march and friends in gcc guide
Summary: confusing definitions of -march and friends in gcc guide
Status: RESOLVED FIXED
Alias: None
Product: [OLD] Docs on www.gentoo.org
Classification: Unclassified
Component: Other documents (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: nm (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-31 06:24 UTC by SpanKY
Modified: 2007-08-07 06:13 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description SpanKY gentoo-dev 2007-07-31 06:24:01 UTC
the current description of -march and friends is confusing and somewhat incorrect

the gcc world is muddy in that the behavior of -mcpu is different based on architecture ... sometimes it is like -march, sometimes it is like -mtune.  on powerpc for example, -mcpu is like -march, while on i386/amd64, -mcpu (now deprecated) is/was like -mtune.

also, only a handful of architectures actually support all three (ARM and CRIS), so trying to describe the three flags relatively is inappropriate:
-mtune < -mcpu < -march

it should be stated that -march will cause generated code to use all available instructions for the specified architecture, while -mtune will only tune the generated code while restricting the available instructions/ABI to the set of -march (or whatever the default is for that port).  so if you dont care about running on older processors (aka you only care about executing code on the system you're running Gentoo on), then you should use -march.  you should only consider -mtune when you need to generate code on older crap like i386/i486 (in which case you should set -march to the min architecture you need as our default gcc ebuilds will set default -march based on CHOST).

finally, -mcpu should be mentioned only as a note for people who are not on i386/amd64 and the issue of its dual meaning in the larger gcc world.  they should check with the gcc manual to see whether -mcpu == -mtune or -mcpu == -march.

also, please do not mention USE=debug.  it does not have the meaning "add debugging CFLAGS".
Comment 1 nm (RETIRED) gentoo-dev 2007-08-07 06:13:16 UTC
Thanks for reporting (and some clarifying comments on IRC.) Fixed in CVS.