Hi,
We are building MariaDB on AIX.
The test: main.mysql_client_test fails (after time-out).
This is due to little endian code being used though HAVE_BIGENDIAN is correctly set.
This is due to:
libmariadb/libmariadb/ma_dtoa.c :
#if defined(WORDS_BIGENDIAN) || (defined(__FLOAT_WORD_ORDER) && \
(__FLOAT_WORD_ORDER == __BIG_ENDIAN))
#define word0(x) (x)->L[0]
#define word1(x) (x)->L[1]
#else
#define word0(x) (x)->L[1]
#define word1(x) (x)->L[0]
#endif
which results in the #else part (Little Endian) since none of the tested macros are defined.
but nothing defined about WORDS_BIGENDIAN .
However, probably that some changes were made in the past in ma_global.h, since I see:
#ifdef HAVE_BIGENDIAN
#endif /* WORDS_BIGENDIAN */
2 times in this file.
I do not master MariaDB, so I do not have a clear idea about how to fix this.
I see 3 solutions:
a) libmariadb/CMakeLists.txt :
Add: SET(HAVE_WORDS_BIGENDIAN TRUE ...) after : TEST_BIG_ENDIAN(HAVE_BIGENDIAN) if it is BigEndian.
b) libmariadb/include/ma_global.h :
Add:
#ifdef HAVE_BIGENDIAN
#define WORDS_BIGENDIAN 1
#endif
c) libmariadb/libmariadb/ma_dtoa.c :
Change:
#if defined(WORDS_BIGENDIAN) || (defined(__FLOAT_WORD_ORDER) && \
(__FLOAT_WORD_ORDER == __BIG_ENDIAN))
by:
#if defined(HAVE_BIGENDIAN) || defined(WORDS_BIGENDIAN) || (defined(__FLOAT_WORD_ORDER) && \
(__FLOAT_WORD_ORDER == __BIG_ENDIAN))
Please let me know which seems appropriate.
Regards,
Tony