-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
-fvisibility-inlines-hidden
breaks libprotobuf (and potentially other software)
#73
Comments
Also cc @xhochy @h-vetinari @jakirkham as libprotobuf maintainers (since that package is affected). |
cc @conda-forge/libprotobuf |
I also reported the issue to the protobuf issue tracker: protocolbuffers/protobuf#9947 |
@pitrou Can you post the compiler error you get? I fail to build a minimal reproducible example and I also struggle to understand what could go wrong here. |
There is no compiler error. The error happens at runtime:
|
This should have been caught by the linker earlier. Also this would mean that you could not link against any destructor in a lib. The above code changes behaviour depending on the definitions but it doesn't change inline-vs-not-inline. |
The code does change inline-vs-not-inline (a member function which is defined inside the class body is implicitly inline). |
Ah, I implicitly read |
Keeping the discussion for now in the upstream Arrow issue until we fully understand what is going wrong here. |
Ok, here is a reproducer: https://gist.github.com/pitrou/1c892d1c42bd6ece9b68a9eb015b76c8 |
protocolbuffers/protobuf#9947 was closed as won't fix so this will have to be fixed on the conda-forge side. |
Some packages need to tweak the compiler flags (for example). Would suggest just making this change in the feedstock for now |
Builds are failing with protobuf 3.20.1 at runtime with ImportError: libimp_npctransport.so.0: undefined symbol: _ZN6google8protobuf8internal16InternalMetadataD1Ev This appears to be because protobuf was built in release mode (with NDEBUG defined) but we are (perhaps) building in debug mode (without NDEBUG). Relates conda-forge/ctng-compiler-activation-feedstock#73.
Not wanting to put any pressure, but it would be nice to get this fixed at some point :-) |
Finally, a fix was accepted for protocolbuffers/protobuf#9947 and should be in the upcoming protobuf 21.3. |
Solution to issue cannot be found in the documentation.
Issue
The
-fvisibility-inlines-hidden
compiler option is described thusly in the GCC wiki:This looks theoretically harmless, except that whether class member are defined inline may depend on exact compilation options.
One typical example is when a function declaration depends on whether
NDEBUG
is enabled. This is exactly what libprotobuf 3.20.1 does (but not 3.19.4):What happens is then:
NDEBUG
defined (release mode), so~InternalMetadata
, being inlined, isn't exported bylibprotobuf.so
NDEBUG
not defined), expects to find the~InternalMetadata
inlibprotobuf.so
, and failsInstalled packages
Environment info
The text was updated successfully, but these errors were encountered: