qitab / cl-protobufs

Common Lisp protocol buffer implementation.
MIT License
83 stars 17 forks source link

Support for non-x86-64 SBCL #427

Open Partmedia opened 10 months ago

Partmedia commented 10 months ago

Because I happen to want to run a grpc server written in Common Lisp on GNU/Linux aarch64 (arm64), I'm interested in what it would take to upstream support for this. Most notably, aarch64 is (by default) big endian.

Based on some cursory looking, it looks like only define-fixed-width-encoder needs to be implemented?

For implementing this, would it be acceptable to bring in a whole or parts of a library like swap-bytes? This particular library is available under the MIT license. The strategy could be then to:

On little-endian machines the conversion functions would become no-ops, and on big-endian machines it would call the internal swap-bytes implementation.

This library currently does not implement a native byte-swap routine for arm64 and would resort to a portable fallback, but a faster implementation using arm64 intrinsics could be upstreamed.

mdbergmann commented 10 months ago

Not sure. But it works here on aarch64 on Mac. Is this different from aarch64 Linux?