What version of protobuf and what language are you using?
Version: v3.15 and later
Language: C++
What operating system (Linux, Windows, ...) and version?
QNX SDP 7.0 for aarch64 (little endian)
What runtime / compiler are you using (e.g., python version or gcc version)
gcc 5.4 (supplied with QNX SDP 7.0)
What did you do?
Compile protobuf for a little endian aarch64 QNX SDP 7.0 target.
What did you expect to see
PROTOBUF_LITTLE_ENDIAN should be defined.
What did you see instead?
PROTOBUF_LITTLE_ENDIAN is not defined. We have root-caused this to be why we have observed byte-swapped fixed64 fields (!!).
The method to determine the endianess of the target changed in v3.15. Prior to this, the header sys/param.h was used. It was replaced by a method that includes endian.h for several different platforms. A later change (bd9d47db41) skipped over the inclusion of endian.h for QNX targets, since the file does not exist on the QNX platform. However, this leaves neither sys/param.h nor endian.h included for QNX targets, resulting in PROTOBUF_LITTLE_ENDIANnot being defined on little endian QNX targets.
We suggest small change like this could be applied to src/google/protobuf/stubs/port.h and src/google/protobuf/io/coded_stream.h
What version of protobuf and what language are you using?
Version: v3.15 and later Language: C++
What operating system (Linux, Windows, ...) and version?
QNX SDP 7.0 for aarch64 (little endian)
What runtime / compiler are you using (e.g., python version or gcc version)
gcc 5.4 (supplied with QNX SDP 7.0)
What did you do?
Compile protobuf for a little endian aarch64 QNX SDP 7.0 target.
What did you expect to see
PROTOBUF_LITTLE_ENDIAN
should be defined.What did you see instead?
PROTOBUF_LITTLE_ENDIAN
is not defined. We have root-caused this to be why we have observed byte-swappedfixed64
fields (!!).The method to determine the endianess of the target changed in v3.15. Prior to this, the header
sys/param.h
was used. It was replaced by a method that includesendian.h
for several different platforms. A later change (bd9d47db41) skipped over the inclusion ofendian.h
for QNX targets, since the file does not exist on the QNX platform. However, this leaves neithersys/param.h
norendian.h
included for QNX targets, resulting inPROTOBUF_LITTLE_ENDIAN
not being defined on little endian QNX targets.We suggest small change like this could be applied to
src/google/protobuf/stubs/port.h
andsrc/google/protobuf/io/coded_stream.h