Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
What to recompile when moving to a new version of gcc?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
juanbobo
n00b
n00b


Joined: 22 Sep 2007
Posts: 39

PostPosted: Tue Dec 15, 2009 7:39 pm    Post subject: What to recompile when moving to a new version of gcc? Reply with quote

When changing your default version of gcc are there any general guidelines for what you should recompile to ensure you don't have any linking or runtime incompatibilities? I've run into issues before, sometimes needing to recompile kdelibs, but as I have not tested all software on my system I can't know what is potentially broken. What does fix_libtool_files.sh actually solve?
Back to top
View user's profile Send private message
Sade
Guru
Guru


Joined: 22 Mar 2005
Posts: 406
Location: Netherlands - Eindhoven

PostPosted: Tue Dec 15, 2009 8:03 pm    Post subject: Reply with quote

short story, run emerge -DuNav world and you are probably fine.

intermediate story: Gentoo GCC upgrade guide

long story
But please note that hielvc himself posts on page nine that his tool is not really needed.
_________________
| 1.6Ghz atom N270 | adopt an unanswerd post | a nice way to post a config file |
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2961
Location: Edge of marsh USA

PostPosted: Sun Jan 17, 2010 8:19 pm    Post subject: Reply with quote

The answer "emerge -DuNav" seems to be seriously in conflict with the gcc upgrade guide which says:

Quote:
To be completely safe that your system is in a sane state, you must rebuild the toolchain and then world to make use of the new compiler.

Code Listing 2.2: Rebuilding system

# emerge -eav system
# emerge -eav world


Not doing emerge -e will leave almost everything as originally compiled with the older gcc version.

Now, it seems to me that the author of the gcc upgrade guide has no concern for redundancy and time it takes to follow the instructions at 2.2, but what else is an ordinary user who needs a stable system to do?

If not as in 2.2, why not?
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


Joined: 25 Apr 2005
Posts: 13047
Location: Ste-Foy,Canada

PostPosted: Sun Jan 17, 2010 8:23 pm    Post subject: Reply with quote

For my concern, each time that there is a new gcc version, I always run this :

Code:

# emerge -eav system
# emerge -eav world


It's the best way to be 100% sure that your box was compiled with the new GCC.
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2961
Location: Edge of marsh USA

PostPosted: Sun Jan 17, 2010 8:33 pm    Post subject: Reply with quote

Thank you.

Rats! I was afraid that was the real answer. :-)
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5909

PostPosted: Sun Jan 17, 2010 10:24 pm    Post subject: Reply with quote

figueroa wrote:
Thank you.

Rats! I was afraid that was the real answer. :-)

I reemerge world only when there is a major version change (like from 3.3.6 to 4) I've done numerous gcc changes, in all I haven't reemerged world and all was ok.
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Sun Jan 17, 2010 11:36 pm    Post subject: Reply with quote

the good way for a clean toolochain is
- emerge gcc && emerge glibc && emerge gcc and you'll end up with a gcc link to latest glibc build by itself.

this is why people may argue "emerge sysstem && emerge world" (as gcc is in system and glibc too) would be the best, but i don't think it is:

1/ building system to get a new gcc won't build the new gcc with the new glibc, only one or the other
2/ rebuilding twice others tools (because world include system) is just a lost of time. As you don't even change your gcc version, you're just recompiling the thing you already have link to your new glibc but still with the old gcc (emerge gcc won't switch your gcc profile to the new gcc)

in fact it could be even worst if you build "system then world" because in case a new glibc is out, you can even bork your own toolchain by
- building system might build new gcc (notice building the new gcc won't change the compiler to use that newly create gcc), build a new glibc, in that case you'll end up with new gcc build for an old glibc. For minor version emerge will even remove the old glibc version (that should be safe, but "should" isn't always safe)
To try to be clearer, let's say you have gcc1 and glibc1 and there's a new gcc2 and glibc2: emerge system will produce a gcc2 build by gcc1 that is build against gblic1 AND a glibc2 that is build with the gcc1.

So: emerge system && emerge world won't produce what you wish as you will just build a new gcc and rebuild all your programs twice with the old one AND you may bork your toolchain and rebuild these programs in a random state.

If you're really lazy, i think emerge gcc && emerge glibc && switching to new gcc && emerge world would do what you wish in a easier way.
Back to top
View user's profile Send private message
Mike Hunt
Watchman
Watchman


Joined: 19 Jul 2009
Posts: 5287

PostPosted: Mon Jan 18, 2010 12:34 am    Post subject: Reply with quote

New bookmark: Best explanation ever for building new gcc version. :)
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Mon Jan 18, 2010 12:48 am    Post subject: Reply with quote

:) if you follow the explain closely you'll see i'm wrong

it should be emerge gcc && switch to it && emerge glibc && emerge gcc (or world for lazy version)

It wasn't a wanted mistake, i'm just tired.
Back to top
View user's profile Send private message
pianosaurus
l33t
l33t


Joined: 19 Apr 2004
Posts: 944
Location: Bash$

PostPosted: Mon Jan 18, 2010 12:54 am    Post subject: Reply with quote

krinn wrote:
:) if you follow the explain closely you'll see i'm wrong

it should be emerge gcc && switch to it && emerge glibc && emerge gcc (or world for lazy version)

It wasn't a wanted mistake, i'm just tired.


You should edit the post then.

Also: ++
This is what I have always done.

krinn wrote:
If you're really lazy, i think emerge gcc && emerge glibc && switching to new gcc && emerge world would do what you wish in a easier way.

Wouldn't emerge gcc && switching to new gcc && emerge glibc && emerge world be better?
_________________
PKA Cuber
Please add [SOLVED] to the subject of your original post when you feel that your problem is resolved.
Adopt an unanswered post
Back to top
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


Joined: 25 Apr 2005
Posts: 13047
Location: Ste-Foy,Canada

PostPosted: Mon Jan 18, 2010 1:07 am    Post subject: Reply with quote

I wrote that a while ago and it was the resume of the big thread at the time :

http://gentoo-quebec.org/wiki/index.php/Recompilation_Toolchain

It seems that we can run this :

Code:

# emerge -auDNv world
# gcc-config -l
# gcc-config set_newest_version
# emerge -av sys-kernel/linux-headers sys-libs/glibc sys-devel/binutils-config sys-devel/binutils sys-devel/gcc-config sys-devel/gcc
# emerge sys-libs/glibc sys-devel/binutils sys-devel/gcc
# emerge -e system
# emerge -e world
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum