public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* ABI compatibility of libstdc++ template classes
@ 2021-07-29 14:08 Janosch Machowinski
  2021-07-29 16:42 ` Jonathan Wakely
  0 siblings, 1 reply; 2+ messages in thread
From: Janosch Machowinski @ 2021-07-29 14:08 UTC (permalink / raw)
  To: gcc-help

Hi,

I'm confused about ABI compatibility for libstdc++ and hope
that that someone on this list can enlighten me :-).
According to
https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html
ABI forward compatibility is guaranteed from GCC 4.2.2 up to GCC 11.
Although, under 'Outstanding Issues' it is not recommended.
So is it now okay, or not and does it apply to template code ?

But up to our concrete problem. We use Ubuntu 20.04 (GCC 9.3)
and got a vendor driver .so build under Ubuntu 16.04 (GCC V5.4)
(and can't get a newer build version). This library uses stl types in
its interface classes, so it defines some Weck symbols for example for
std::vector<SomeClass>.
If I now build my own application against the driver I can manage
to generate a wild mix of symbols for std::vector<SomeClass>
coming from a way newer and the older versions.
E.g. push_back from the GCC 5.4 build and constructor destructor
initializer_list stuff from GCC 9.3.
Is this mixing of template generated code allowed, or are we in
for trouble ?
Greetings
     Janosch



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: ABI compatibility of libstdc++ template classes
  2021-07-29 14:08 ABI compatibility of libstdc++ template classes Janosch Machowinski
@ 2021-07-29 16:42 ` Jonathan Wakely
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2021-07-29 16:42 UTC (permalink / raw)
  To: Janosch Machowinski; +Cc: gcc-help

On Thu, 29 Jul 2021, 15:14 Janosch Machowinski, <
j.machowinski@cellumation.com> wrote:

> Hi,
>
> I'm confused about ABI compatibility for libstdc++ and hope
> that that someone on this list can enlighten me :-).
> According to
> https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html
> ABI forward compatibility is guaranteed from GCC 4.2.2 up to GCC 11.
> Although, under 'Outstanding Issues' it is not recommended.
>


That's talking about mixing multiple ABIs in a single executable, e.g. from
GCC 4.1 and from GCC 11. If you only use versions from 4.2.2 onwards,
you're not doing that.

So is it now okay, or not and does it apply to template code ?
>
> But up to our concrete problem. We use Ubuntu 20.04 (GCC 9.3)
> and got a vendor driver .so build under Ubuntu 16.04 (GCC V5.4)
> (and can't get a newer build version). This library uses stl types in
> its interface classes, so it defines some Weck symbols for example for
> std::vector<SomeClass>.
> If I now build my own application against the driver I can manage
> to generate a wild mix of symbols for std::vector<SomeClass>
> coming from a way newer and the older versions.
> E.g. push_back from the GCC 5.4 build and constructor destructor
> initializer_list stuff from GCC 9.3.
> Is this mixing of template generated code allowed, or are we in
> for trouble ?
>

It's fine.


Greetings
>      Janosch
>
>
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-29 16:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-29 14:08 ABI compatibility of libstdc++ template classes Janosch Machowinski
2021-07-29 16:42 ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).