Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libstdc++ solution? #20

Open
AndrewBelt opened this issue May 23, 2019 · 4 comments
Open

libstdc++ solution? #20

AndrewBelt opened this issue May 23, 2019 · 4 comments

Comments

@AndrewBelt
Copy link

In the README, you mention

If you want C++, you'll need to build libstdc++ with this enabled. That can be a little involved, but I'm working on a solution, to be available "soon".

I'm interested in what your ideas are for libstdc++. Is it as simple as generating a header of symvers for libstdc++ versions?

@jwakely
Copy link

jwakely commented Sep 12, 2019

Is it as simple as generating a header of symvers for libstdc++ versions?

No, that won't work. In libstdc++ there is only one version of a given symbol, so it's not possible to force it to bind to an older version.

The typical problems with libstdc++ library versions are due to entirely new symbols added to libstdc++.so.6 not with new versions of symbols. And if you compile using a new GCC and its new libstdc++, such that you depend on new symbols in that release of libstdc++, then no amount of messing with symbol versions is going to make the new symbols present in an older libstdc++.so.6. They just aren't present.

There are two correct solutions: either build with an old GCC so you only depend on an old libstdc++.so, or use something like Red Hat's devtoolset, which provides a new GCC with (most) new C++ features supported, but doesn't introduce dependencies on a new libstdc++.so (so it runs on older systems).

@probonopd
Copy link

probonopd commented Sep 12, 2019

use something like Red Hat's devtoolset, which provides a new GCC with (most) new C++ features supported, but doesn't introduce dependencies on a new libstdc++.so (so it runs on older systems).

Why doesn't every distribution do it this way by default?

@jwakely
Copy link

jwakely commented Sep 12, 2019

It creates bigger executables, and not all features of the new GCC are available when using that linkage model, and not everybody needs to be compatible with old, frozen ABIs.

@quocnhat
Copy link

Hello, Have you successfully built and compiled ".so" libs cross different systems ( .,i,e: different gcc version) ? I investigated hard on this but failed at all. Which a lot of errors like:
undefined reference to `VTT for std::__cxx11::basic_ostringstream<char, std::char_traits, std::allocator >@GLIBCXX_3.4.21'
This error comes from the incompatible gcc version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants