You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, this change broke msgpack (half the test suite) on big endian systems (in our case Solaris SPARC). Now, __LITTLE_ENDIAN is always chosen as default. Is that expected?
I managed to fix it by passing -D__BIG_ENDIAN__=1 to /usr/bin/python3 ./setup.py build but it's not exactly elegant :(.
Well, the previous solution of defining it in setup.py based on sys.byteorder seemed pretty nice before the borg issue.
If I understand the original borg issue, was the problem in the cross-compilation (which is why both LITTLE and BIG endians were defined at the same time)? If so, I can see why this is an issue (because msgpack doesn't detect cross compilation).
Maybe setup.py can check whether __BIG_ENDIAN__ or __LITTLE_ENDIAN__ is defined and only set it itself if neither of them is?
Well, I think __BYTE_ORDER__, which should be defined by most compilers, can be used for compile time detection. I am not sure that it's available everywhere, but I just checked clang 11.0, gcc 7, 10 and 11, and Solaris Studio 12.4, and all of those define it.
The sysdep.h header currently uses #if __BYTE_ORDER == __LITTLE_ENDIAN from arpa/inet.h but those are not standard and not defined on Solaris (or FreeBSD I tested as well), but it can be changed to #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__/#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__, and let compiler to make it right (rather than header file with non-standard defines).
Or, to make it even more compatible, __BYTE_ORDER, __LITTLE_ENDIAN and __BIG_ENDIAN can be defined if they don't exist to __BYTE_ORDER__, __ORDER_LITTLE_ENDIAN__ and __ORDER_BIG_ENDIAN__ respectively.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ref: borgbackup/borg#6105