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
Linking fails on armv6l due to missing libatomic #5219
Comments
@lopsided98 Do you want to send us a pull request with the fix? |
I actually don't know exactly where in the build system to fix this. Protobuf seems to use both bazel and autotools, so would I have to add it to both? I used autotools to build it, so I just added the |
Updating just the autotools build sounds fine to me, though we are thinking about deprecating it in favor of CMake some time soon so you might want to keep that in mind. By the way, do you have any more details on why we have to explicitly link against |
I think protobuf uses atomic intrinsics (maybe indirectly though I think this became a problem when protobuf stopped using its own implementations of atomic operations ( |
Ok, that makes sense. I wonder if it's harmless to always link explicitly against libatomic or if we need a way to do that only for certain platforms. |
See #5227. |
Looks like there's been a regression on this issue somewhere between v3.11.4 and v3.12.2. I'm getting the same link error compiling "@com_google_protobuf//:protoc" v3.12.2 on a Raspberry Pi. v3.11.4 compiles just fine. |
I know this is an old issue, but does anyone know why armv6l specifically requires |
ARMv6 lacks byte and half-word and double word atomic instructions ( These instructions were actually added to the ARMv6K architecture, which appears to be supported by the ARM1176JZF-S CPU used in the BCM2835, but the compiler is not configured to target this architecture version. See: https://developer.arm.com/documentation/ddi0301/h/summary-of-arm1136jf-s-and-arm1176jzf-s-processor-differences/summary-of-differences/armv6k-extensions-support |
What version of protobuf and what language are you using?
Version: v3.6.1
What operating system (Linux, Windows, ...) and version?
Linux (NixOS)
What runtime / compiler are you using (e.g., python version or gcc version)
gcc 7.3.0
What did you do?
When I attempted to build protobuf for armv6l, I ran into the following linker error:
On armv6l, protobuf needs to be linked to
libatomic
to provide this symbol. Manually adding-latomic
toLDFLAGS
fixes the issue.The text was updated successfully, but these errors were encountered: