|
|
Subscribe / Log in / New account

GCC 5 in Fedora (Red Hat developer blog)

Last week the Red Hat developer blog looked at some changes coming with GCC5. This week's article covers how those changes will be handled in Fedora. "One consequence of this decision will be that Fedora 22 and Fedora 23 will both have GCC 5, but they’ll be fundamentally different. The C++ library (libstdc++.so) will be compatible between F22 and F23 (in fact, it will be almost exactly the same, modulo some extra patches from upstream that might be pulled into the later F23 build). The difference will be all the other DSOs that link to it. That’s important for Fedora developers to note. Specifically, FESCo’s decision means the C++ standard library headers installed by the libstdc++-devel RPM will have a different default value for the _GLIBCXX_USE_CXX11_ABI macro (0 in F22 and 1 in F23) but the libstdc++.so library will be largely the same in F22 and F23, because that library contains all the symbol definitions for both the old ABI and the new ABI, so that the same library works for both cases."

to post comments

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 10, 2015 19:16 UTC (Tue) by juliank (guest, #45896) [Link] (37 responses)

Not changing the soname was a massive mistake.

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 10, 2015 20:12 UTC (Tue) by JoeBuck (subscriber, #2330) [Link] (35 responses)

Why, since the solution chosen provides one .so that supports both the old and the new ABIs? Your alternative would mean that a new Fedora system could not run an old binary without installing a second .so and messing with LD_LIBRARY_PATH. The alternative that the GCC and Fedora developers chose means that older binaries just work.

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 10, 2015 21:02 UTC (Tue) by gb (subscriber, #58328) [Link] (34 responses)

Why not install both libstdc++.so.6 and libstdc++.so.7 - always?

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 10, 2015 21:12 UTC (Tue) by juliank (guest, #45896) [Link] (12 responses)

Exactly. This way you could easily detect a clash of versions.

Imagine a third-party program P linked to the old libstdc++ using a system library C that is linked against the new libstdc++.

As far as I can tell, that will crash randomly. With two different libstdc++ sonames, such a case could be easily identified.

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 10, 2015 21:13 UTC (Tue) by juliank (guest, #45896) [Link]

And you could even build the old soname and the new one from the same source code, so there's no real overhead.

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 10, 2015 23:25 UTC (Tue) by tetromino (guest, #33846) [Link]

> Imagine a third-party program P linked to the old libstdc++ using a system library C that is linked against the new libstdc++.
>
> As far as I can tell, that will crash randomly. With two different libstdc++ sonames, such a case could be easily identified.

The symbol versioning approach makes random crashes rather unlikely. (AFAICS, they can occur only if something in C's public API takes a pointer/reference to one of the stl structures whose ABI changed, and P uses that feature of C's API.)

The soname versioning approach makes random crashes virtually guaranteed, because ld.so will happily pull in both sonames at runtime, and then everything in P's internals, everyting in C's internals, and worst of all, libstdc++ own internals will all be exposed to incompatible ABIs. However, in this case, the crash's cause will be easier to diagnose for a moderately sophisticated user (as long as P doesn't have a binary plugin infrastructure).

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 11, 2015 1:32 UTC (Wed) by ncm (guest, #165) [Link]

The most likely event will be link failure, unless library C uses no libstdc++ functions. In that case, it probably also doesn't use any libstc++ structs, and then it probably doesn't matter which version it was linked against.

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 11, 2015 8:48 UTC (Wed) by zenor (guest, #100805) [Link] (4 responses)

Exactly. Also rolling distros like Gentoo could never switch
to the new ABI, or they must force their users to build everything
from scratch again.

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 11, 2015 9:54 UTC (Wed) by KSteffensen (guest, #68295) [Link] (3 responses)

Isn't recompiling everything from scratch the whole point of Gentoo?

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 11, 2015 10:38 UTC (Wed) by zenor (guest, #100805) [Link]

Well, normally if you upgrade your compiler on Gentoo there is no need
to recompile anything...

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 11, 2015 12:50 UTC (Wed) by yoshi314 (guest, #36190) [Link]

it's a necessary evil if some low level library breaks compatibility.

Biggest one i recall was introduction of expat-2, but gcc3-to-4 migration also was fairly major.

If a library updates via soname bump, there are mechanisms in place to keep things working and slowly migrate things over. But in this case, there might be a necessity for either a big rebuild or just reinstallation from a new profile.

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 18, 2015 20:17 UTC (Wed) by Wol (subscriber, #4433) [Link]

:-)

Not if you can avoid it ...

I've just run an "emerge -e mysql" because my email server is busted :-( And it doesn't seem to have fixed the problem :-(

16Gb ram, Athlon X3, and things like gcc, firefox, thunderbird et al all take - literally - hours to recompile. I dread to think how long an "emerge -e world" will take ...

I'm really not looking forward to being forced to bite the bullet and go ahead with that ...

Cheers,
Wol

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 11, 2015 15:49 UTC (Wed) by jwakely (subscriber, #60262) [Link] (3 responses)

Why would it crash?

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 11, 2015 16:01 UTC (Wed) by juliank (guest, #45896) [Link]

Well, if it passes around objects where the size is different between the two ABIs, things will go wrong. It might not always crash, but it could.

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 11, 2015 21:33 UTC (Wed) by zenor (guest, #100805) [Link] (1 responses)

Well, try it yourself: build a Gentoo system with gcc-4.9
and then switch to gcc-5 (that uses the new ABI) and start
building the updates as they come.
I did that and came across many crashes in the first days.
The gdb backtraces contain the hints to what additional packages
need updates (always std::string related in my case).

Crash early, crash often

Posted Feb 12, 2015 16:50 UTC (Thu) by ncm (guest, #165) [Link]

By my lights, you are fortunate if it crashes -- the earlier, the more fortunate. Feel for the poor sysadmin whose services should have crashed, but instead corrupted some persistent data store.

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 10, 2015 21:14 UTC (Tue) by rleigh (guest, #14622) [Link] (20 responses)

One reason is for the same reason you don't bump the libc soname. Things go horribly wrong when you want to link (even indirectly) with something which pulls in the other copy of the library and all the shared symbols collide.

Not that it's unique to these libraries, but since it has so many users, it causes much more trouble when it comes to doing a wholesale migration to the new ABI. Not that it's impossible; I rememeber doing rebuilds for the "c102" migration in Debian for the previous C++ ABI break. Doing it this way avoids the need for an immediate "flag day", but I think in practice you'll end up needing to do this anyway due to all the dependent libraries needing to switch over to the new std::string etc.

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 10, 2015 21:50 UTC (Tue) by nix (subscriber, #2304) [Link]

Quite.

It's tough on people trying to ship binary-only stuff that links against C++ stuff already on the platform -- but there's not much of that bar Qt and boost, and boost is so ABI-unstable that everyone already has to have their own copy anyway. The symbol versions should handle the trivial case of a binary that is just written in C++... but who knows how much pain this will cause :(

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 11, 2015 1:41 UTC (Wed) by ncm (guest, #165) [Link] (18 responses)

There really wasn't any choice about some people having some pain. The best to hope for is not many having much pain, and vanishingly few having pain delayed until after it's too late to fix it easily.

Congratulations to the transition team for doing such a good job easing the transition. It can't have been easy.

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 11, 2015 12:14 UTC (Wed) by gowen (guest, #23914) [Link] (17 responses)

Call me a traditionalist, but shouldn't we wait until the transition has happened before congratulating people for who smoothly it went?

Fedora 22 only branched from Rawhide a day or two ago, and Fedora 23 will not be released until winter 2015 at the earliest.

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 11, 2015 13:30 UTC (Wed) by mattdm (subscriber, #18) [Link] (14 responses)

> ...and Fedora 23 will not be released until winter 2015 at the earliest.

Fall 2015, going by calendar seasons. Even F21 didn't slip all the way into winter.

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 11, 2015 13:57 UTC (Wed) by nye (subscriber, #51576) [Link] (13 responses)

>Fall 2015, going by calendar seasons. Even F21 didn't slip all the way into winter.

Um, it was released in December - less than two weeks before midwinter.

(According to Wikipedia anyway)

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 11, 2015 14:12 UTC (Wed) by mattdm (subscriber, #18) [Link] (12 responses)

> Um, it was released in December - less than two weeks before midwinter.

Huh; today I learned that this is not standardized internationally. In the US, we consider the winter solstice the official _start_ of Winter.

In any case, and back to the point, F23 is planned for October, and for the same reasons that we decided to not delay F21 for the new GCC ABI, we _don't_ expect to slip until close to winter, however you define it.

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 11, 2015 15:11 UTC (Wed) by riccieri (guest, #94794) [Link] (11 responses)

> Huh; today I learned that this is not standardized internationally.

That, plus the fact that when you write "winter" I (and half of the planet) need to read "summer", is why people should stop using seasons to communicate scheduling.

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 11, 2015 15:42 UTC (Wed) by mattdm (subscriber, #18) [Link] (3 responses)

Is it better if we write "Halloween" and "Mother's Day"? :)

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 11, 2015 16:12 UTC (Wed) by etienne (guest, #25256) [Link] (1 responses)

> Is it better if we write "Halloween" and "Mother's Day"? :)

No, not "Mother's Day", you should not phone your Mum on the wrong "Mother's Day" - I know that.

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 13, 2015 16:04 UTC (Fri) by Wol (subscriber, #4433) [Link]

"Mother's Day" isn't that ambiguous - that is - if if you call the days by their traditional names. I don't know when Mother's Day is because it's an American abhomination :-) - is it the first Sunday in May?

But for us over here it's Mothering Sunday, the fourth Sunday in Lent.

Cheers,
Wol

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 11, 2015 18:35 UTC (Wed) by riccieri (guest, #94794) [Link]

Only if this means you will be doing different release dates per country, Hollywood style :) I'm sure my mom would love Fedora 22 as a gift this year.

Less than half the planet has winter in December.

Posted Feb 12, 2015 3:15 UTC (Thu) by gmatht (guest, #58961) [Link]

`when you write "winter" I (and half of the planet) need to read "summer"' ... actually it is worse than that. If you live in the Tropics, you don't even have summer or winter.

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 12, 2015 10:33 UTC (Thu) by jwakely (subscriber, #60262) [Link] (3 responses)

And in British English we write "summre" and "wintre" ... ;-)

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 12, 2015 11:18 UTC (Thu) by jonquark (guest, #45554) [Link] (2 responses)

I thought we wrote winter and "those 3 weeks that are supposed to be sunny but it still seems to be raining" ;)

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 13, 2015 16:09 UTC (Fri) by Wol (subscriber, #4433) [Link] (1 responses)

No. It's "those six weeks when the kids are off school and can't go out because it's raining" and "those three weeks when the kids are off school and can't go out because it's cold and wet".

Off-topic - our grand-kids were delighted because we had half an inch of snow on boxing day - which lasted about 24 hours.

Cheers,
Wol

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 17, 2015 7:47 UTC (Tue) by tao (subscriber, #17563) [Link]

Doesn't boxing day *always* last 24h? :P

SCNR.

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 23, 2015 23:54 UTC (Mon) by Trammael (guest, #101173) [Link] (1 responses)

Surely on half by geography and not population?

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 24, 2015 1:32 UTC (Tue) by mathstuf (subscriber, #69389) [Link]

Not even half. Not all regions have four seasons. Around the equator it is closer to wet and dry than hot and cold determining the seasons.

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 11, 2015 13:37 UTC (Wed) by ncm (guest, #165) [Link] (1 responses)

No, we shouldn't wait. Whatever difficulties arise, we know that they did everything that could be done, well ahead of any troubles. You can't reasonably ask for better than that.

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 11, 2015 16:03 UTC (Wed) by gowen (guest, #23914) [Link]

We know they made a good honest effort, which is definitely is worth applauding in itself. By all means thank them for trying, but we have literally no idea how successful that effort proved to be.

Personally, I hope to be able to applaud them in November when their efforts have proved successful, but until then, probably best to reserve judgement.

We know that they did everything that could be done
We know no such thing. They acted on everything they could foresee. Did they foresee everything that could go wrong? We do not yet know.

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 11, 2015 15:15 UTC (Wed) by malor (guest, #2973) [Link]

An ABI update was always going to suck. They did the soname update last time, and it ended up being a kind of a fustercluck, so they're doing something different this go-around.

Maybe it'll hurt less, maybe it'll hurt more, but it was always going to hurt.

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 13, 2015 9:31 UTC (Fri) by gb (subscriber, #58328) [Link] (1 responses)

Shouldn't be linker updated to explicitly disable pulling to versions of same .so?

GCC 5 in Fedora (Red Hat developer blog)

Posted Feb 13, 2015 14:29 UTC (Fri) by mathstuf (subscriber, #69389) [Link]

You can only link against version less .so files normally, so you can only link against one. The problem comes with transitive libraries via dlopen.


Copyright © 2015, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds