adamthiede 841899c314 community/coreboot-tools: enable builds for other architectures
some packages (nvramtool, ectool) are still intended for x86-based
systems and some packages only work on 64-bit systems

adding a patch for cbmem
2025-10-31 14:21:41 +09:00

20 lines
473 B
Diff

diff --git a/util/cbmem/cbmem.c b/util/cbmem/cbmem.c
index 018ea871f9..369b7c5a31 100644
--- a/util/cbmem/cbmem.c
+++ b/util/cbmem/cbmem.c
@@ -28,6 +28,14 @@
#include <x86intrin.h>
#endif
+#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+#define le32toh(x) (x)
+#define le16toh(x) (x)
+#else
+#define le32toh(x) (__builtin_bswap32(x))
+#define le16toh(x) (__builtin_bswap16(x))
+#endif
+
#include "cbmem_util.h"
#define CBMEM_VERSION "1.2"