From 4bc7cc02eda854e4c8ac73caecfee37717083a6b Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Sat, 3 Aug 2019 17:25:07 +0200 Subject: [PATCH] Add RISC-V endian detection (#100) boost/predef/other/endian.h has two ways of detecting the endianess: (1) It includes if BOOST_LIB_C_GNU is defined, and then use __BYTE_ORDER to decide the endianness. (2) Otherwise, if (1) was not possible for some reason, it uses architecture defines to decide the endianness. (1) works perfectly fine with glibc toolchains, because BOOST_LIB_C_GNU is defined, but it doesn't work with musl. Due to this, is not included, __BYTE_ORDER is not defined, and method (1) does not work, causing build failures on musl toolchains that don't have explicit handling by architecture name (method 2). So this commit fixes RISC-V musl build by adding support for the __riscv architecture define, to determine that the endianness is little endian. Signed-off-by: Thomas Petazzoni --- include/boost/predef/other/endian.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/boost/predef/other/endian.h b/include/boost/predef/other/endian.h index b42da53..b1e360b 100644 --- a/include/boost/predef/other/endian.h +++ b/include/boost/predef/other/endian.h @@ -127,7 +127,8 @@ information and acquired knowledge: defined(__AARCH64EL__) || \ defined(_MIPSEL) || \ defined(__MIPSEL) || \ - defined(__MIPSEL__) + defined(__MIPSEL__) || \ + defined(__riscv) # undef BOOST_ENDIAN_LITTLE_BYTE # define BOOST_ENDIAN_LITTLE_BYTE BOOST_VERSION_NUMBER_AVAILABLE # endif