Currently, when building the expat package in depends, using -flto
(LTO=1
), the configure check can fail, because it cannot determine the system endianess:
0configure:18718: result: unknown
1configure:18733: error: unknown endianness
2 presetting ac_cv_c_bigendian=no (or yes) will help
Fix that by defining _DEFAULT_SOURCE
, which in turn defines __USE_MISC
(features.h
):
0#if defined _DEFAULT_SOURCE
1# define __USE_MISC 1
2#endif
which exposes additional definitions in endian.h
:
0#include <features.h>
1
2/* Get the definitions of __*_ENDIAN, __BYTE_ORDER, and __FLOAT_WORD_ORDER. */
3#include <bits/endian.h>
4
5#ifdef __USE_MISC
6# define LITTLE_ENDIAN __LITTLE_ENDIAN
7# define BIG_ENDIAN __BIG_ENDIAN
8# define PDP_ENDIAN __PDP_ENDIAN
9# define BYTE_ORDER __BYTE_ORDER
10#endif
and gives us a working configure.
You could test building this change with Guix + LTO with this branch. Note that that build may fail for other reasons (on x86_64), unrelated to this change.
Some related upstream discussion: https://bugs.gentoo.org/757681 https://forums.gentoo.org/viewtopic-t-1013786.html