Detecting machine endianness for s390x

I am trying to build Couchbase server on s390x architecture (RHEL7/SLES12). After successful build, when I ran the test cases, 142 test cases failed for s390x because Couchbase is not able to verify the ENDIANness of machine.

The test cases got passed after adding below macro in “./tlm/cmake/Modules/CouchbaseDefinitions.cmake” file:


Ref: Endianness Detection

All currently supported platforms for Couchbase are all little endian, so yes I’m not surprised it doesn’t work :wink:

I know the existing code has some (unused) support for WORKDS_BIGENDIAN, but given we have moved over to CMake for our build system it’s probably better to use CMake’s TestBigEndian support.

If you want to submit a patch, see the information on - you’ll need to submit to the tlm project.