commit | b4905919f245a860fa423d13a5c8eaafa075f6f8 | [log] [tgz] |
---|---|---|
author | Tim Lee <timlee660101@gmail.com> | Sat Jun 18 02:51:13 2022 +0800 |
committer | Tim Lee <timlee660101@gmail.com> | Tue Jul 12 06:09:23 2022 +0000 |
tree | ca164070f85a46985df37065f424b76ba26240dc | |
parent | 8d90f975806284afa1cd3421b952798796493840 [diff] |
ipmid: message: fix pack/unpack compile error at aarch64 platform After debugging with boost/multiprecision owner jzmaddock. We have found the root cause why boost v1.79.0 got this compile error in ipmid. More detail you can refer from https://github.com/boostorg/multiprecision/issues/472 Root cause: Boost changed all bit counts from unsigned to std::size_t, specifically for platforms like arm64 (and windows!) where unsigned is narrower than size_t so that the maximum representable number isn't unnecessarily constrained. This then changes the interface for cpp_int_backend to use size_t rather than unsigned for the bit counts. On most platforms and most use cases, this makes no perceptible difference, but unfortunately this appears to be one situation where it really does make a difference. Apparently this is true even though: template <unsigned N> using fixed_uint_t = boost::multiprecision::number<boost::multiprecision::cpp_int_backend< N, N, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void>>; Is declared with an unsigned parameter, when partially specializing for fixed_uint_t you need to use the actual type of the template parameter in the underlying template, not the type used in the template alias! Solution: Change all usage of unsigned for bitcounts to a new typedef bitcount_t which is size_t for Boost-1.79 and later, and unsigned for Boost-1.78 and earlier. Verified: No compile error at aarch64 platform and test ipmitool sdr command is pass. Signed-off-by: jzmaddock <john@johnmaddock.co.uk> Signed-off-by: Tim Lee <timlee660101@gmail.com> Change-Id: Id7a7c86ef854f4b9c06fc4da054c8021f76812b8
To build this package, do the following steps:
1. ./bootstrap.sh 2. ./configure ${CONFIGURE_FLAGS} 3. make
To clean the repository run ./bootstrap.sh clean
.