-
Notifications
You must be signed in to change notification settings - Fork 69
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
Design a system to provide binaries of C++ libraries built for different ABIs #111
Comments
Specific to Android only: (I use |
Example of this in another setting: In some ways, it's no different to having MacOS binaries that can't operate on Linux. Any ABI incompatibility should probably just become part of the When we publish any binaries, we should include any ABI-sensitive parts in the platform component. i.e. |
Sounds great @danpat! Will this be as simple as
|
Been digging and can't find a simple way to print the C++ stdlib version a package was compiled with on OS X. From reading http://www.trilithium.com/johan/2005/06/static-libstdc/, could building C++ packages with
|
For OS/X, use
On my system, I seem to have both
Static linking would only fix things if the symbols can be hidden, otherwise they'll possibly conflict when your library is linked upstream and another lib(std)c++ is linked in with similar symbol names. I'm not sure if you can hide the symbols for other libraries that you statically link in, it might only apply to stuff you compile yourself (see https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/CppRuntimeEnv/Articles/SymbolVisibility.html) |
That would likely work, but cause larger binaries since parts of the stdlib need to be included in the executable rather than loading the shared lib. |
I'm not seeing how linking C++ stdlib statically would help. The issue is in the following scenario:
Whether foo links A dynamically or statically doesn't matter -- in either case C++ stdlib A's ABI is part of the interface, and will conflict with downstream projects that use B. |
Partly for my own education, and partly to help this discussion, I ran a little experiment to show what ABI compatibility really means:
Compiling this on Linux against both libc++ and libstdc++ gives:
So, what this means is that when someone has https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html
Now, what is important to understand is that C types have a pretty well defined symbol generation rules that all compilers seem to agree on:
Here, because the class function only uses So, next steps:
|
@danpat |
@mikemorris Ah, right, static. Best you can do is extract the symbol table from that (i.e. what functions exist in the module) using
On Linux, use
This looks like it corresponds to:
These symbol names are generated by the compiler/api combination they're built with (see my previous comment), and when you want to link against AFAIK, there will be no other info in the |
I'm a bit stuck here, I found
Is there another way to check what compiler/stdlib is available for a consumer trying to fetch a binary? |
The path I'm trying to implement is to add |
Are there any special compiler |
That may be possible with builtin macros for clang and gcc (or |
Tried setting |
I think we should pause on trying to support multiple standard library versions in Mason. And therefore put on ice #115. In the future this may be useful and therefore #115 will be great, but at this point I'm not seeing any concrete need to support both Instead I think we should continue for now with the assumption that Mason packages (and only works with):
And therefore the next action is not versioning on stdlib but rather narrowing down what the actual cause of linking errors are when using |
Putting this on ice per above. |
@jfirebaugh explained the fundamental issue:
This ticket is for brainstorming and designing solutions to this problem. Should Mason to provide a set of binaries for C++ libraries built different stdlib versions? How should we go about building such a system?
cc @jfirebaugh @mikemorris @springmeyer @ljbade
ref mapbox/mapbox-gl-native#2348
The text was updated successfully, but these errors were encountered: