On Thu, Nov 27, 2008 at 1:34 AM, Duncan <[EMAIL PROTECTED]> wrote:

> It's also worth noting that due to Gentoo's gcc slotting, one can use
> gcc-config to switch between gcc versions.  Thus using a new and still
> masked gcc isn't as much of a problem as it might be, since you can use
> the new version for most things and switch to the old version for
> anything that's still broken with the new version.  When an
> emerge --emptytree @system @world works just using the new version, you
> can then unmerge the old version.
>
> I've done this over several gcc upgrades, now.
>
> It works well for C programs, but there can be issues with C++
> occasionally, since gcc provides libstdc++ which must remain compatible.
> Over the versions I've done this with, it has been mostly compatible, but
> not always 100%.  At one point some stuff in KDE would break if I was
> switched to the older gcc, since I had compiled it with the newer gcc,
> with a mostly compatible libstdc++, but one that added a few new
> functions.  So anything that used the new functions would break when
> switched to the old gcc and thus the old libstdc++.  But most of KDE
> would work, so I'd switch to the old version just long enough to compile
> whatever package wouldn't yet compile with the new gcc, and wouldn't use
> the KDE stuff that was broken (basically anything having to do with the
> web, IDR whether it was just the web, or all Internet functionality)
> while I did so.  Then I'd switch back to the newer gcc, and everything
> would work again.

Thanks for sharing this option. I gave it a try, so far so good.

martindesktop ~ # cat /etc/portage/package.keywords
(..)
=sys-devel/gcc-4.3.2
=sys-libs/glibc-2.7-r2

Next emerge gcc, output:

 * If you have issues with packages unable to locate libstdc++.la,
 * then try running 'fix_libtool_files.sh' on the old gcc versions.

martindesktop ~ # cat /etc/make.conf
(..)
# gcc < 4.2.0
#CFLAGS="-march=nocona -O2 -pipe"

# gcc >= 4.2.0
CFLAGS="-march=native -O2 -pipe"
(..)

Martin

Reply via email to