This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC version bikeshedding
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: Jonathan Wakely <jwakely dot gcc at gmail dot com>, Eric Botcazou <ebotcazou at libertysurf dot fr>, Ian Lance Taylor <iant at google dot com>, GCC Development <gcc at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>
- Date: Wed, 6 Aug 2014 12:30:04 +0200
- Subject: Re: GCC version bikeshedding
- Authentication-results: sourceware.org; auth=none
- References: <201407291845 dot 14107 dot ebotcazou at libertysurf dot fr> <CAKOQZ8whj_m9yjYVdX_p24ocV25VRZwwmTf=VvGjEoxNeHbxSg at mail dot gmail dot com> <201408060925 dot 48414 dot ebotcazou at libertysurf dot fr> <20140806074223 dot GY7393 at tucnak dot redhat dot com> <CAFiYyc1+LTfbPF=nT3O4pA4ST6Z2X5FJ0ywMxL9bk3UsqwnV2w at mail dot gmail dot com> <20140806084803 dot GB7393 at tucnak dot redhat dot com> <CAFiYyc0+YgrRA-CheSFx5not6XadTWOa-mr_LWpX4sZ_gQMgdg at mail dot gmail dot com> <20140806090635 dot GD7393 at tucnak dot redhat dot com> <CAH6eHdSkX-kvXTN8ysKh38dWy1nUeQMnX6nGSm+sOdbSm7z1cw at mail dot gmail dot com> <CAFiYyc3fxDDX9TZeySaF8vMZqwb3ipwQs-vCmiOHK3Vdwe7uUg at mail dot gmail dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Aug 06, 2014 at 12:20:04PM +0200, Richard Biener wrote:
> >> No, AFAIK it is also -std=c++98. At least my understanding was that
> >> std::list and std::string are going to change ABI (and get new abi_tag)
> >> in all C++ modes. Jonathan/Jason/Paolo, is that right?
> >
> > Correct. We want C++03 code to continue to be able to interoperate
> > with C++11 code.
> >
> > It's an ABI change for all modes (but not a SONAME change because the
> > old and new definitions will both be present in the .so).
>
> Ugh. That's going to be a nightmare to support. Is there a configure
> switch to change the default ABI used? That is, on a legacy system
> can I upgrate to 5.0 and get code that interoperates fine with code
> built with 4.8? (including ABI boundaries using the affected classes?
> I suspect APIs with std::string passing are _very_ common, not
> sure about std::list)
Generally, if you just pass std::string or std::list or & or && or *
to it around, things will be just mangled differently, so worst case you'll
get linker errors or dynamic linker errors.
The problematic case is if you embed std::string or std::list
in your classes and pass that around in between projects compiled with
one compiler and another compiler, in that case it doesn't affect
the mangling, yet is an ABI change nevertheless.
In such cases, one needs to add abi_tag to your structures, and there is
some g++ warning that can suggest you where to add it.
Of course, if you are not using such structures/classes in between packages,
it is just fine not to do anything about that.
Jakub