public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Paul de Vrieze <pauldv@gentoo.org>
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	[thread overview]
Message-ID: <200504192142.17877.pauldv@gentoo.org> (raw)
In-Reply-To: <426269B4.6080503@gmx.net>

[-- Attachment #1: Type: text/plain, Size: 1611 bytes --]

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= with -mcpu if not supported by gcc
> # and vice versa.
> echo "" | gcc -mtune=i386 -E - > /dev/null 2> /dev/null
> if [ $? == 0 ]; then
> export CFLAGS=`echo $CFLAGS | /bin/sed 's/-mcpu=/-mtune=/'`
> export CXXFLAGS=`echo $CXXFLAGS | /bin/sed 's/-mcpu=/-mtune=/'`
> else
> export CFLAGS=`echo $CFLAGS | /bin/sed 's/-mtune=/-mcpu=/'`
> export CXXFLAGS=`echo $CXXFLAGS | /bin/sed 's/-mtune=/-mcpu=/'`
> 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´= option in make.conf and gcc doesn't support it it replaces it
> with -mcpu=?!

It actually does (or did) the -mcpu to -mtune for newer gcc versions. This 
creates all kinds of havoc if you want to compile a 3.3 gcc by a 3.4 gcc 
(this works when not specifying -mcpu). It is so agressive that if you do try 
to reverse this in your bashrc, it gets reversed again to -mtune. As it's 
only necessary for compiling \<gcc-3.3 I just let it strip out -mtune 
completely.

Paul

-- 
Paul de Vrieze
Gentoo Developer
Mail: pauldv@gentoo.org
Homepage: http://www.devrieze.net

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

      parent reply	other threads:[~2005-04-19 19:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-17 13:50 [gentoo-dev] Automatically replace -mtune= with -mcpu= if not supported by gcc?! Philipp Hasse
2005-04-17 22:05 ` Mike Frysinger
2005-04-17 22:24   ` Alec Warner
2005-04-19 19:42 ` Paul de Vrieze [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200504192142.17877.pauldv@gentoo.org \
    --to=pauldv@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox