From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp50.wxs.nl (smtp50.wxs.nl [195.121.6.34]) by robin.gentoo.org (8.13.4/8.13.4) with ESMTP id j3JJg8GP030022 for ; Tue, 19 Apr 2005 19:42:08 GMT Received: from pavlvs2.devrieze.net (ip51cfc8c3.direct-adsl.nl [81.207.200.195]) by smtp50.wxs.nl (8.12.10/8.12.10) with ESMTP id j3JJgHKT014201 for ; Tue, 19 Apr 2005 21:42:17 +0200 Received: from hex.local.devrieze.net (hex.local.devrieze.net [192.168.1.7]) by pavlvs2.devrieze.net (Postfix) with ESMTP id 2E58A10030 for ; Tue, 19 Apr 2005 21:42:18 +0200 (CEST) From: Paul de Vrieze To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] Automatically replace -mtune= with -mcpu= if not supported by gcc?! Date: Tue, 19 Apr 2005 21:42:17 +0200 User-Agent: KMail/1.8 References: <426269B4.6080503@gmx.net> In-Reply-To: <426269B4.6080503@gmx.net> X-Face: #Lb+'V@sGJ;ptgo5}V"W+5OCoo{LZv;bh,s,`WKLi/J)ed1_$0;6X<=?utf-8?q?700LVV/=3BLqPhiDP=5E=0A=09=27f=5Dfnv?=@%6M8\'HR1t=aFx;ePfp{ZQoBe+e)JOQ8T5*(_;mHY+cltLGq<;@$Y,=?utf-8?q?O=5C=24=0A=09Tm=23G6M?=,g![Q62J{na*S9d;R[^8pc%u\aiLqU@`kJtYl"^6pxdW Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart6065473.bO2u6mrTUp"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200504192142.17877.pauldv@gentoo.org> X-Archives-Salt: ee7347bd-3cb9-4e30-9568-b2d80360136b X-Archives-Hash: 45160ae0c34056aeb10ba53cf41f4216 --nextPart6065473.bO2u6mrTUp Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Sunday 17 April 2005 15:50, Philipp Hasse wrote: > Hi, > > I recently noticed that portage executes the file bashrc located in > /etc/portage before every ebuild. > This way it can be used to set the -mcpu and -mtune flags correctly. > If you add the following to this file everything goes automatically: > > <--- SNIP ---> > # Automatically replace -mtune=3D with -mcpu if not supported by gcc > # and vice versa. > echo "" | gcc -mtune=3Di386 -E - > /dev/null 2> /dev/null > if [ $? =3D=3D 0 ]; then > export CFLAGS=3D`echo $CFLAGS | /bin/sed 's/-mcpu=3D/-mtune=3D/'` > export CXXFLAGS=3D`echo $CXXFLAGS | /bin/sed 's/-mcpu=3D/-mtune=3D/'` > else > export CFLAGS=3D`echo $CFLAGS | /bin/sed 's/-mtune=3D/-mcpu=3D/'` > export CXXFLAGS=3D`echo $CXXFLAGS | /bin/sed 's/-mtune=3D/-mcpu=3D/'` > fi > <--- SNIP ---> > > Maybe someone can give me a feedback if this is good idea or if I missed > something for some exotic situation this will fail. > > Why doesn't portage do this automatically by itself? If it encounters an > -mtune=C2=B4=3D option in make.conf and gcc doesn't support it it replace= s it > with -mcpu=3D?! It actually does (or did) the -mcpu to -mtune for newer gcc versions. This= =20 creates all kinds of havoc if you want to compile a 3.3 gcc by a 3.4 gcc=20 (this works when not specifying -mcpu). It is so agressive that if you do t= ry=20 to reverse this in your bashrc, it gets reversed again to -mtune. As it's=20 only necessary for compiling \