Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 181615 - Proposal : Use "mtune=" instead of "mcpu=" for CFLAGS
Summary: Proposal : Use "mtune=" instead of "mcpu=" for CFLAGS
Status: RESOLVED INVALID
Alias: None
Product: [OLD] Docs on www.gentoo.org
Classification: Unclassified
Component: Installation Handbook (show other bugs)
Hardware: x86 Linux
: High trivial (vote)
Assignee: Docs Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-11 01:14 UTC by CHARPENTIER Johan
Modified: 2007-06-11 20:12 UTC (History)
1 user (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 CHARPENTIER Johan 2007-06-11 01:14:26 UTC
In the documentation (Gentoo Linux Handbook 2007.0 x86 -  5.d. Configuring the Compile Options - CFLAGS and CXXFLAGS), i can see the use of "mcpu=" CFLAG, but when i emerge any ebuild, i see lot of warnings.
Warnings are about the deprecated use of "mcpu=" and recommand to use "mtune=" instead.
It isn't a blocking problem
So please use "mtune=" CFLAG instead of "mcpu=" CFLAG in the Gentoo Linux Handbook

Reproducible: Always

Steps to Reproduce:
1.Use the "mcpu" CFLAG instead of "mtune" in your /etc/make.conf
2.Try to emerge any compilation-needed ebuild

Actual Results:  
Gcc tells me :
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.

Expected Results:  
He dont tell me about that :-)

CFLAGS write with the doc for my system
CFLAGS="-O2 -march=i686 -mcpu=athlon-xp -pipe"

"Normals" CFLAGS for my system
CFLAGS="-O2 -march=i686 -mtune=athlon-xp -pipe"

Tested with an "mc" emerge and lot of "compilation-needed" ebuilds

Portage 2.1.2.9 (default-linux/x86/2007.0, gcc-4.1.2, glibc-2.5-r3, 2.6.21-gentoo-r2 i686)
=================================================================
System uname: 2.6.21-gentoo-r2 i686 AMD Athlon(tm) XP 2200+
Gentoo Base System release 1.12.10
Timestamp of tree: Fri, 08 Jun 2007 15:30:01 +0000
ccache version 2.4 [enabled]
dev-lang/python:     2.4.4-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.4-r7
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.6.3, 1.7.9-r1, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.23b
virtual/os-headers:  2.6.21
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -mcpu=athlon-xp -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -march=i686 -mcpu=athlon-xp -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="buildpkg buildsyspkg candy ccache distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="ftp://ftp.free.fr/mirrors/ftp.gentoo.org/"
LANG="fr_FR@euro"
LC_ALL="fr_FR@euro"
LINGUAS="fr"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acl alsa berkdb bitmap-fonts cli cracklib crypt cups dbus dri fortran gdbm gpm hal iconv ipv6 isdnlog libg++ midi mudflap ncurses nls nptl nptlonly openmp pam pcre perl pppd python qt3 qt4 readline reflection sdl session slang spl ssl tcpd truetype-fonts type1-fonts unicode vorbis x86 xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="fr" USERLAND="GNU" VIDEO_CARDS="nvidia"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 1 nm (RETIRED) gentoo-dev 2007-06-11 01:42:06 UTC
-march is correct for most systems, but there are some arches such as sparc and alpha that actually require -mcpu. This is from a shared handbook page (hb-install-stage), and since we never tell the user to use -mcpu on any arch but the proper non-x86 arches, no need to change anything. The existing x86 handbook specifies -march anyway.

We even provide links to the gnu documentation to verify the proper -march/-mtune/-mcpu settings for your architecture.

I don't know where you found something saying to use -mtune and -march, but it's not in any of the handbooks or other gentoo docs.

RESOLVED INVALID.
Comment 2 Harald van Dijk (RETIRED) gentoo-dev 2007-06-11 19:24:16 UTC
(In reply to comment #1)
> I don't know where you found something saying to use -mtune and -march, but
> it's not in any of the handbooks or other gentoo docs.

Right, it's the exact opposite. As this bug mentions, the handbook says to use -march / -mcpu, when it /should/ (for x86) say to use -march / -mtune at <http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=5>.

"A first setting is the -march= or -mcpu= flag, which specifies the name of the target architecture. Possible options are described in the make.conf.example file (as comments)."

You mention that this page is shared between the various arches, but the code example that almost immediately follows is different: at <http://www.gentoo.org/doc/en/handbook/handbook-sparc.xml?part=1&chap=5>, the example uses -mcpu=ultrasparc instead of -march=i686.
Comment 3 CHARPENTIER Johan 2007-06-11 20:12:56 UTC
So my apologies.

(In reply to comment #2)
I havent seen this section like a shared section of all arches, and in my mind the  march/mcpu couple doesn't work for x86.
(In reply to comment #1)
And, its right too, the doc doesn't tell me to use mcpu /with/ march CFLAG.

Ok,nevermind, thanks a lot, and good luck.
(Good job for the doc, and sorry for my english :-))