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

Incompatible ABI when building shared libs with cmake vs autotools #10209

Closed
antonio-rojas opened this issue Jul 5, 2022 · 1 comment
Closed
Labels

Comments

@antonio-rojas
Copy link

What version of protobuf and what language are you using?
Version: 21.2
Language: C++

What operating system (Linux, Windows, ...) and version?
Linux

What runtime / compiler are you using (e.g., python version or gcc version)
GCC 12

What did you do?
Compiling shared libraries with autotools doesn't define PROTOBUF_USE_DLLS. Therefore, in
https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/arena.cc#L223
the compiled shared library exports the ThreadSafeArena::thread_cache_ symbol.

On the other hand, compiling then with cmake defines PROTOBUF_USE_DLLS so the symbol ThreadSafeArena::thread_cache() is exported instead in
https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/arena.cc#L217,
which makes the ABI different depending on the build system used.

@fowles fowles added the c++ label Jul 6, 2022
@fowles
Copy link
Contributor

fowles commented Jul 6, 2022

Protobuf does not support heterogenous build modes like this. Medium term we plan on removing autotools support entirely

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

No branches or pull requests

2 participants