I've found what I believe is a bug in the bits/byteswap.h file, and the defines that control whether masks/shifts or gcc inline assembly are used to implement the byte swap. The 16 and 32 bits swaps are compatible with non-gcc compilers, but the 64 bit swap can never be defined for a non-gcc compiler. See attached patch for what I think the defines should look like (untested patch.)
Created attachment 6305 [details]
Proposed patch for bits/byteswap.h
Just checked git head:
This patch is needed for i386, x86-64, and the generic version.
s390 seems to do it right.
The inline asm for byte swapping is obsolete and useless anyway. Since at least early gcc 4, gcc already generates the optimal machine code if you just write the byte swap in the most naive possible way with bitshifts and masking. The asm should be thrown out and just replaced with static inline functions.
git commit b1aa60f32d34030b28bca04aeee084cd3bedecfa contains a fix.