-
Notifications
You must be signed in to change notification settings - Fork 15.6k
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
3.15.x doesn't build on FreeBSD cause of missing endian.h #8373
Comments
This can be hacked by:
So it's just wrong include path on FreeBSD. After that hack project builds w/o issues. |
Strange FreeBSD seems already supported... protobuf/src/google/protobuf/stubs/port.h Lines 60 to 66 in 87dd07b
FYI in google/or-tools we are using (and we test using github macos runner (ed provide virtualbox support), and a Vagrant FreeBSD box) #if (defined(__APPLE__) || defined(__FreeBSD__)) && defined(__GNUC__)
#include <machine/endian.h>
#elif !defined(_MSC_VER)
#include <endian.h>
#endif |
Well, it looks like protobuf/stubs/port.h should have: #ifdef __APPLE__ || defined(__FreeBSD__)
#include <machine/endian.h> // __BYTE_ORDER
#else
#include <endian.h> // __BYTE_ORDER
#endif |
Same behavior also on AIX and SunOS:
|
@scdded do you have |
@Mizux endian.h does not exist on AIX (sys/machine.h) and SunOS (sys/isa_defs.h) |
I can confirm the same error on AIX 7.1. |
@gdharley yes, this could be fixed by using sys/machine.h instead of endian.h. You will end up with adding the following snippet to
|
I have created a PR #9065 to fix AIX and SunOS, but seems the corporate CLA is not in effect yet. |
Closing since it looks like the fix has been merged. If I'm missing anything feel free to reopen! |
What version of protobuf and what language are you using?
Version: 3.15.4
Language: C++
What operating system (Linux, Windows, ...) and version?
FreeBSD x86_64, v12.2
What runtime / compiler are you using (e.g., python version or gcc version)
clang 10.0.1
What did you do?
Either autotools build with ./configure && make or cd cmake && cmake ../ … && make
What did you expect to see
Properly built library
What did you see instead?
A lot of errors like this in multiple files, example:
Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
Anything else we should know about your project / environment
No. It's a pretty standard environment.
The text was updated successfully, but these errors were encountered: