(I'm assuming this is for C++...)

The protobuf libraries (including the code generated by the protobuf 
compiler) should internally contain the necessary #ifdef/etc. guards to 
handle endian issues. For example:
https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/wire_format_lite.cc#L319-L369

In other words, it should Just Work (TM) with your cross-build toolchain.

If you use the Debian packages, make sure you grab the backports (otherwise 
you'll likely get a very old version).

If you want to build completely from source, both the autoconf and CMake 
builds should work as usual for cross-buliding. (If you also build and 
install natively, you can pass `--with-protoc` to configure.)

If you use a different build system, the changes are a tiny bit out of 
scope for our instructions. Again, the major host tool consideration is the 
`protoc` binary, which generates .pb.cc, etc. files.



On Thursday, April 23, 2020 at 10:36:40 AM UTC-7, kerry crouse wrote:
>
> I have been through the online documentation, readmes, and protoc help and 
> I'm missing how to do this: generate big endian protobuf code on little 
> endian machine. Can someone point me to a howto? My build machine is a 
> Linux Debian x86 machine. My target machine is a 32 bit PowerPC device. 
> Thanks!
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/18efce8c-9bb6-4c11-b9b3-4b556bc4ad6f%40googlegroups.com.

Reply via email to