Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 189566

Summary: GCC Upgrade Guide: ABI Change 3.4->4.1?
Product: [OLD] Docs on www.gentoo.org Reporter: Jason Bucata <tech31842>
Component: Other documentsAssignee: Docs Team <docs-team>
Status: VERIFIED WONTFIX    
Severity: major CC: amne, philantrop, vapier
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Jason Bucata 2007-08-20 08:30:36 UTC
The GCC Upgrade Guide says that there was an incompatible ABI change from gcc 3.4 to gcc 4.1, comparable to the one from 3.3 -> 3.4.

I haven't been able to find any independent verification of that.  When I looked at the gcc changelogs some time ago, there was no mention of a major ABI change in 4.1 that required recompiling the world.  I also looked at other distros and none of them were making any plans to accomodate a big ABI change (though I did see plans wrt 3.3->3.4).

I talked with vapier in #gentoo and he said it's bunk.

He pointed me to CVS to look at the revision history of that document, and that text in the first warning section came from revision 1.13, "Updated gcc upgrading guide as per Halcy0n's request".  The old text is what I expected to see, that there wasn't any such significant change from 4.0 to 4.1.

Either Halcy0n was simply mistaken, or there was a communication breakdown between Halcy0n and whoever wrote the actual change to that fragment of text.

Or else it's actually correct, in which case I'd really like to see the explanation of what exactly changed.

This all came about when I decided I didn't want to have to recompile the world yet again unless it was really necessary, and from my own research (corroborated by vapier) it doesn't appear to be necessary.
Comment 1 Jason Bucata 2007-08-20 08:32:11 UTC
Adding amne@gentoo.org to CC list per vapier's suggestion
Comment 2 nm (RETIRED) gentoo-dev 2007-08-20 09:04:22 UTC
Mike, what's the word on this?
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2007-08-20 09:39:17 UTC
(In reply to comment #0)
> This all came about when I decided I didn't want to have to recompile the world
> yet again unless it was really necessary, and from my own research
> (corroborated by vapier) it doesn't appear to be necessary.

Except for all the tons of duplicates with KDE and any other C++ stuff in the tree which you can find in bugzilla. So yeah, the thing is not compatible and emerge -e world is needed.
 

Comment 4 Wernfried Haas (RETIRED) gentoo-dev 2007-08-20 09:48:35 UTC
Welcome the reoccuring debate about recompiling everything after gcc upgrades. ;-)

In short: Some people prefer rebuilding only what's necessary, some would rather like to see users rebuild everything to make sure everything works absolutely 100%.
As for the ABI changes in 3.4->4.1, for all i know (which is mostly based on what Mike told me), there shouldn't be any major change.

Also see https://bugs.gentoo.org/show_bug.cgi?id=145014#c5 (last 2 paragraphs) and the following comment for some related debate about it.

Personally i think the best solution would be changing 
"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." to "...you should rebuild the toolchain and then world..." (s/must/should) and let users figure out themselves if they rather want to be completely safe or a bit less safe and avoide -e world.
Comment 5 Carsten Lohrke (RETIRED) gentoo-dev 2007-08-20 12:38:08 UTC
GCC 3.4.x has C++ ABI 1.3 and 4.x 1.3.1. I'm not aware to what degree the documentation is correct or merely reflects which GCC versions went stable on Gentoo, but no GCC 3.4.x and 4.x don't have the same C++ ABI and it's necessary to rebuild all C++ applications, when switching.
Comment 6 SpanKY gentoo-dev 2007-08-20 13:36:52 UTC
irrelevant in the discussion of upgrading ... ABI is backwards compatible so anything that works with 1.3 will work with 1.3.1
Comment 7 Jakub Moc (RETIRED) gentoo-dev 2007-08-20 14:02:05 UTC
(In reply to comment #6)
> irrelevant in the discussion of upgrading ... ABI is backwards compatible so
> anything that works with 1.3 will work with 1.3.1

Except that if you mix those, things will bomb out horribly, as proved by hundreds of duplicates of Bug 64615 and Bug 123065. You really intend to drop the only piece of documentation that was added specifically because of this C++ borkage, so that we get flooded by even more duplicates, or what exactly are you suggesting here?
Comment 8 Samuli Suominen (RETIRED) gentoo-dev 2007-08-20 14:32:59 UTC
Packages depending on boost, sigc++.. like bmpx, and deluge also breaks if you
mix libraries built with 3.4.x and 4.x, so they are definately not compatible. Upstream is to blame for not bumping libstdc++ .so version number.
Comment 9 Wulf Krueger (RETIRED) gentoo-dev 2007-08-20 14:48:18 UTC
(In reply to comment #6)
> irrelevant in the discussion of upgrading ... ABI is backwards compatible so
> anything that works with 1.3 will work with 1.3.1

Spanky, in the real world (in contrast to the rather academic view of backwards-compatibility) this causes major issues till now, so please follow Wernfried's advice from comment #4 if "must" really hurts anyone. (I greatly prefer the "must" considering the bugs jakub referenced.)

Better spend your time adding ChangeLog entries during your next stabilisation orgy. :-)
Comment 10 Jason Bucata 2007-08-20 15:06:01 UTC
(In reply to comment #5)
> GCC 3.4.x has C++ ABI 1.3 and 4.x 1.3.1

Is there any documentation on those?  I evidently missed it.
Comment 11 nm (RETIRED) gentoo-dev 2007-08-20 19:23:02 UTC
Look. People. Chill. Out.

No, the text on what to do during the upgrade will not be altered in any way -- users really must (not should) fix their toolchains first and then recompile world with the fixed toolchain. That isn't the issue here.

The issue here is that little bit of text that says "as GCC-3.4 and GCC-4.1 use slightly different ABIs" -- this is actually quite correct, as Carlo has already mentioned.

Here's the thing. If I just delete that one sentence fragment, without leaving an explanation on why users have to recompile for those versions, guess what will happen?

Users will file spurious bug reports or send in emails wanting to know why. And then they'll start the whole argument process that I've seen innumerable times on e.g. the forums and old bugs on whether or not they think they can get away without fixing their system between gcc's major version number changes.

And then what happens? The same bit of text goes back in.

So, here's how it's going to go down: nothing will be changed in the text, because nothing should be. Those hundreds of dups are proof that the guide's upgrading instructions *are* mandatory and that they *must* be followed to avoid those kinds of breakages.

The ABI *did* change. 4.1 *cannot* replace 3.4 without some kind of recompiling. Nothing to alter in the doc.