[lsb-discuss] LSB, GCC versions C++11 and libstdc++

Jeff Licquia licquia at linuxfoundation.org
Sat Dec 15 16:14:40 UTC 2012

On 12/14/2012 10:53 AM, Dallman, John wrote:
> Will C++ code built on GCC 4.7 work correctly on a GCC 4.3 system? A
> trivial program built with "g++ -std=c++11" does work, but I don't
> have comprehensive test cases, and it seem quite unlikely given that
> there's a bunch more stuff in C++11, which presumably requires run-
> time support.

It won't be 100% (as you've discovered), but most likely any non-trivial
program will not work.

This isn't just related to C++ 11; things change all the time between
different versions of libstdc++.  Generally, these are written in a
backward-compatible manner, so code built with gcc 4.3 continues to work
with libstdc++6 from 4.7, but building the other way around will pull in
these new features which won't be available on libstdc++6 from 4.3.

> How does LSB deal with this?

In the SDK, we ship our own stub libraries for linking.  This ensures
that you only get compatible symbols even when building with newer gcc,
up to 4.6.

When a new version of gcc comes out, we test it with our SDK and make
adjustments as needed.  We haven't done that for 4.7 yet.  OTOH, we
don't fail for that reason, so you're welcome to try 4.7 with lsbcc.  If
you run into problems, please let us know.

Most likely, any new symbols that come with C++ 11 support will show up
in a newer version of the LSB some time in the future.
Jeff Licquia
The Linux Foundation
+1 (317) 915-7441
licquia at linuxfoundation.org

Linux Foundation Events Schedule:  events.linuxfoundation.org
Linux Foundation Training Schedule: training.linuxfoundation.org

More information about the lsb-discuss mailing list