C++11 ABI stability

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

C++11 ABI stability

Boost - Users mailing list
Hi,
mongo-cxx-driver notices this:
"Important note about C++11/C++14: The boost libraries do not offer a
stable ABI across different versions of the C++ standard. As a result,
you must ensure that your application, the C++ driver, and boost are
all built with the same language standard. In particular, if you are
building the C++ driver with C++11 enabled, you must also build your
application with C++11 enabled, and link against a C++11 compiled
boost. " [1]

Is it true? What changes with new standard? (or is this only related to
ABI change in gcc introduced by c++11?)

I'm interested mainly in libraries: filesystem, chrono, thread, system
and regex

Thanks,
Marek

[1] http://mongodb.github.io/mongo-cxx-driver/legacy-v1/installation/#s
cons-options-when-compiling-the-c-driver
_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: C++11 ABI stability

Boost - Users mailing list
They are probably referring to the changes wrt std::string and std::list

Pre-C++11 a lot of standard libraries used copy-on-write strings, which was forbidden in C++11.

std::list now has to have O(1) size, which is another possibly ABI incompatible change.


On 21 June 2017 at 01:09, Marek Skalický via Boost-users <[hidden email]> wrote:
Hi,
mongo-cxx-driver notices this:
"Important note about C++11/C++14: The boost libraries do not offer a
stable ABI across different versions of the C++ standard. As a result,
you must ensure that your application, the C++ driver, and boost are
all built with the same language standard. In particular, if you are
building the C++ driver with C++11 enabled, you must also build your
application with C++11 enabled, and link against a C++11 compiled
boost. " [1]

Is it true? What changes with new standard? (or is this only related to
ABI change in gcc introduced by c++11?)

I'm interested mainly in libraries: filesystem, chrono, thread, system
and regex

Thanks,
Marek

[1] <a href="http://mongodb.github.io/mongo-cxx-driver/legacy-v1/installation/#s cons-options-when-compiling-the-c-driver" rel="noreferrer" target="_blank">http://mongodb.github.io/mongo-cxx-driver/legacy-v1/installation/#s
cons-options-when-compiling-the-c-driver
_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users


_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: C++11 ABI stability

Boost - Users mailing list
In reply to this post by Boost - Users mailing list
On 6/21/2017 2:09 AM, Marek Skalický via Boost-users wrote:

> Hi,
> mongo-cxx-driver notices this:
> "Important note about C++11/C++14: The boost libraries do not offer a
> stable ABI across different versions of the C++ standard. As a result,
> you must ensure that your application, the C++ driver, and boost are
> all built with the same language standard. In particular, if you are
> building the C++ driver with C++11 enabled, you must also build your
> application with C++11 enabled, and link against a C++11 compiled
> boost. " [1]
>
> Is it true? What changes with new standard? (or is this only related to
> ABI change in gcc introduced by c++11?)
>
> I'm interested mainly in libraries: filesystem, chrono, thread, system
> and regex

I can't speak for the libraries you mention above. But regarding Boost
libraries in general many Boost libraries are unaffected in their public
interface whether you compile with C++03, C++11, C++14, or C++17
support. If a library is affected in its public interface depending on
the level of C++ support it should document this and, needless to say if
it is a built library whether static or shared, it should have a
distinct library name depending on its differing public interfaces.

>
> Thanks,
> Marek
>
> [1] http://mongodb.github.io/mongo-cxx-driver/legacy-v1/installation/#s
> cons-options-when-compiling-the-c-driver
>


_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: C++11 ABI stability

Boost - Users mailing list
In reply to this post by Boost - Users mailing list
The problem is in ASIO library. S.

2017-06-21 15:44 GMT+02:00 Steve Lorimer via Boost-users <[hidden email]>:
They are probably referring to the changes wrt std::string and std::list

Pre-C++11 a lot of standard libraries used copy-on-write strings, which was forbidden in C++11.

std::list now has to have O(1) size, which is another possibly ABI incompatible change.


On 21 June 2017 at 01:09, Marek Skalický via Boost-users <[hidden email]> wrote:
Hi,
mongo-cxx-driver notices this:
"Important note about C++11/C++14: The boost libraries do not offer a
stable ABI across different versions of the C++ standard. As a result,
you must ensure that your application, the C++ driver, and boost are
all built with the same language standard. In particular, if you are
building the C++ driver with C++11 enabled, you must also build your
application with C++11 enabled, and link against a C++11 compiled
boost. " [1]

Is it true? What changes with new standard? (or is this only related to
ABI change in gcc introduced by c++11?)

I'm interested mainly in libraries: filesystem, chrono, thread, system
and regex

Thanks,
Marek

[1] http://mongodb.github.io/mongo-cxx-driver/legacy-v1/installation/#s
cons-options-when-compiling-the-c-driver

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users


_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users


_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: C++11 ABI stability

Boost - Users mailing list
In reply to this post by Boost - Users mailing list
Well, as soon as you have a string, you may have incompatibilities. And lots of Boost libraries do use them.

2017-06-21 16:16 GMT+01:00 Edward Diener via Boost-users <[hidden email]>:
On 6/21/2017 2:09 AM, Marek Skalický via Boost-users wrote:
Hi,
mongo-cxx-driver notices this:
"Important note about C++11/C++14: The boost libraries do not offer a
stable ABI across different versions of the C++ standard. As a result,
you must ensure that your application, the C++ driver, and boost are
all built with the same language standard. In particular, if you are
building the C++ driver with C++11 enabled, you must also build your
application with C++11 enabled, and link against a C++11 compiled
boost. " [1]

Is it true? What changes with new standard? (or is this only related to
ABI change in gcc introduced by c++11?)

I'm interested mainly in libraries: filesystem, chrono, thread, system
and regex

I can't speak for the libraries you mention above. But regarding Boost libraries in general many Boost libraries are unaffected in their public interface whether you compile with C++03, C++11, C++14, or C++17 support. If a library is affected in its public interface depending on the level of C++ support it should document this and, needless to say if it is a built library whether static or shared, it should have a distinct library name depending on its differing public interfaces.



Thanks,
Marek

[1] http://mongodb.github.io/mongo-cxx-driver/legacy-v1/installation/#s
cons-options-when-compiling-the-c-driver



_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users



--
Information System Engineer, Ph.D.
Blog: http://blog.audio-tk.com/
LinkedIn: http://www.linkedin.com/in/matthieubrucher

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: C++11 ABI stability

Boost - Users mailing list
In reply to this post by Boost - Users mailing list
On Wed, Jun 21, 2017 at 08:44:53AM -0500, Steve Lorimer via Boost-users wrote:

> They are probably referring to the changes wrt std::string and std::list
>
> Pre-C++11 a lot of standard libraries used copy-on-write strings, which was
> forbidden in C++11.
>
> std::list now has to have O(1) size, which is another possibly ABI
> incompatible change.
>
> More details here:
> https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html

That page explicitly points out that choosing a standard version with
-std does not affect the ABI:

"Although the changes were made for C++11 conformance, the choice of ABI
to use is independent of the -std option used to compile your code, i.e.
for a given GCC build the default value of the _GLIBCXX_USE_CXX11_ABI
macro is the same for all dialects. This ensures that the -std does not
change the ABI, so that it is straightforward to link C++03 and C++11
code together."


> On 21 June 2017 at 01:09, Marek Skalický via Boost-users <
> [hidden email]> wrote:
>
> > Hi,
> > mongo-cxx-driver notices this:
> > "Important note about C++11/C++14: The boost libraries do not offer a
> > stable ABI across different versions of the C++ standard. As a result,
> > you must ensure that your application, the C++ driver, and boost are
> > all built with the same language standard. In particular, if you are
> > building the C++ driver with C++11 enabled, you must also build your
> > application with C++11 enabled, and link against a C++11 compiled
> > boost. " [1]
> >
> > Is it true? What changes with new standard? (or is this only related to
> > ABI change in gcc introduced by c++11?)
> >
> > I'm interested mainly in libraries: filesystem, chrono, thread, system
> > and regex
> >
> > Thanks,
> > Marek
> >
> > [1] http://mongodb.github.io/mongo-cxx-driver/legacy-v1/installation/#s
> > cons-options-when-compiling-the-c-driver
_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: C++11 ABI stability

Boost - Users mailing list
Hi, 

As far as I can remember, the problem with ABI compatibility was with boost/asio/detail/atomic_count.hpp. You can force ABI compatibility using BOOST_ASIO_DISABLE_STD_ATOMIC definition. I have not detect any other ABI compatibility problem between C++03 and C++11.

Best Regards, 
Slavek 

2017-06-26 12:34 GMT+02:00 Jonathan Wakely via Boost-users <[hidden email]>:
On Wed, Jun 21, 2017 at 08:44:53AM -0500, Steve Lorimer via Boost-users wrote:
> They are probably referring to the changes wrt std::string and std::list
>
> Pre-C++11 a lot of standard libraries used copy-on-write strings, which was
> forbidden in C++11.
>
> std::list now has to have O(1) size, which is another possibly ABI
> incompatible change.
>
> More details here:
> https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html

That page explicitly points out that choosing a standard version with
-std does not affect the ABI:

"Although the changes were made for C++11 conformance, the choice of ABI
to use is independent of the -std option used to compile your code, i.e.
for a given GCC build the default value of the _GLIBCXX_USE_CXX11_ABI
macro is the same for all dialects. This ensures that the -std does not
change the ABI, so that it is straightforward to link C++03 and C++11
code together."


> On 21 June 2017 at 01:09, Marek Skalický via Boost-users <
> [hidden email]> wrote:
>
> > Hi,
> > mongo-cxx-driver notices this:
> > "Important note about C++11/C++14: The boost libraries do not offer a
> > stable ABI across different versions of the C++ standard. As a result,
> > you must ensure that your application, the C++ driver, and boost are
> > all built with the same language standard. In particular, if you are
> > building the C++ driver with C++11 enabled, you must also build your
> > application with C++11 enabled, and link against a C++11 compiled
> > boost. " [1]
> >
> > Is it true? What changes with new standard? (or is this only related to
> > ABI change in gcc introduced by c++11?)
> >
> > I'm interested mainly in libraries: filesystem, chrono, thread, system
> > and regex
> >
> > Thanks,
> > Marek
> >
> > [1] http://mongodb.github.io/mongo-cxx-driver/legacy-v1/installation/#s
> > cons-options-when-compiling-the-c-driver
_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users


_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: C++11 ABI stability

Boost - Users mailing list
In reply to this post by Boost - Users mailing list
Thank you all for your answers.

So generally boost is not affected by -std=c++XY. Asio library is
exception. I hope I get it right.

Probably mongo-cxx-driver upstream was referring to gcc dual ABI
problem and that it can affect Boost too.

Thanks again,
Marek

Miloslav Marik via Boost-users píše v St 21. 06. 2017 v 17:23 +0200:

> The problem is in ASIO library. S.
>
> 2017-06-21 15:44 GMT+02:00 Steve Lorimer via Boost-users <boost-users
> @lists.boost.org>:
> > They are probably referring to the changes wrt std::string and
> > std::list
> >
> > Pre-C++11 a lot of standard libraries used copy-on-write strings,
> > which was forbidden in C++11.
> >
> > std::list now has to have O(1) size, which is another possibly ABI
> > incompatible change.
> >
> > More details here: https://gcc.gnu.org/onlinedocs/libstdc++/manual/
> > using_dual_abi.html
> >
> > On 21 June 2017 at 01:09, Marek Skalický via Boost-users <boost-use
> > [hidden email]> wrote:
> > > Hi,
> > > mongo-cxx-driver notices this:
> > > "Important note about C++11/C++14: The boost libraries do not
> > > offer a
> > > stable ABI across different versions of the C++ standard. As a
> > > result,
> > > you must ensure that your application, the C++ driver, and boost
> > > are
> > > all built with the same language standard. In particular, if you
> > > are
> > > building the C++ driver with C++11 enabled, you must also build
> > > your
> > > application with C++11 enabled, and link against a C++11 compiled
> > > boost. " [1]
> > >
> > > Is it true? What changes with new standard? (or is this only
> > > related to
> > > ABI change in gcc introduced by c++11?)
> > >
> > > I'm interested mainly in libraries: filesystem, chrono, thread,
> > > system
> > > and regex
> > >
> > > Thanks,
> > > Marek
> > >
> > > [1] http://mongodb.github.io/mongo-cxx-driver/legacy-v1/installat
> > > ion/#s
> > > cons-options-when-compiling-the-c-driver
> > > _______________________________________________
> > > Boost-users mailing list
> > > [hidden email]
> > > https://lists.boost.org/mailman/listinfo.cgi/boost-users
> > >
> >
> >
> > _______________________________________________
> > Boost-users mailing list
> > [hidden email]
> > https://lists.boost.org/mailman/listinfo.cgi/boost-users
>
> _______________________________________________
> Boost-users mailing list
> [hidden email]
> https://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Loading...