<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:PMingLiU;
        panose-1:2 2 5 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:PMingLiU;
        panose-1:2 1 6 1 0 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="ZH-TW" link="#0563C1" vlink="#954F72" style="text-justify-trim:punctuation">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Hi All,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Share the root cause about this kind of compile error in ipmid at aarch64 platform.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">After debugging with boost/multiprecision owner, we have found the root cause why boost v1.79.0 got this compile error in ipmid.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">More detail you can refer from
<a href="https://github.com/boostorg/multiprecision/issues/472">https://github.com/boostorg/multiprecision/issues/472</a><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="color:#1F497D">Summary root cause from boost community:<o:p></o:p></span></b></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">We changed all bit counts from unsigned to std::size_t,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">specifically for platforms like arm64 (and windows!) where unsigned is narrower than size_t<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">so that the maximum representable number isn't unnecessarily constrained.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">This then changes the interface for cpp_int_backend to use size_t rather than unsigned for the bit counts.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">On most platforms and most use cases, this makes no perceptible difference,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">but unfortunately this appears to be one situation where it really does make a difference. Apparently this is true even though:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">template <unsigned N><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">using fixed_uint_t =<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">    boost::multiprecision::number<boost::multiprecision::cpp_int_backend<<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">        N, N, boost::multiprecision::unsigned_magnitude,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">        boost::multiprecision::unchecked, void>>;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Is declared with an unsigned parameter, when partially specializing for fixed_uint_t<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">you need to use the actual type of the template parameter in the underlying template, not the type used in the template alias! :(<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="color:#1F497D">Solution:<o:p></o:p></span></b></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">In boost v1.78.0 that use unsigned type for all bit counts, and v1.79.0 use std::size_t type instead it.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Thus, ipmid need to change all usage of unsigned for bitcounts to a new typedef bitcount_t which is size_t for Boost-1.79 and later,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">and unsigned for Boost-1.78 and earlier.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="color:#1F497D">Verified:<o:p></o:p></span></b></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">With this patch then ipmid compile error at aarch64 platform was resolved and ipmitool sdr command also pass.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Best regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Tim<o:p></o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt">From:</span></b><span lang="EN-US" style="font-size:11.0pt"> CS20 CHLi30 <CHLI30@nuvoton.com>
<br>
<b>Sent:</b> Wednesday, June 8, 2022 4:41 PM<br>
<b>To:</b> openbmc@lists.ozlabs.org; Tim Lee <timlee660101@gmail.com>; CS20 CHLi30 <CHLI30@nuvoton.com><br>
<b>Subject:</b> RE: [phosphor-ipmi-host] static assertion be raised in aarch64 build<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Dear All,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">We have fixed this compile error of ipmid after we change boost version from v1.79.0 to v1.78.0.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">(Using openbmc/poky/meta/recipes-support/boost/boost_1.78.0.bb instead of boost_1.79.0.bb)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Previous boost v1.78.0 without this compile error in ipmid no matter arm or aarch64 platform.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">But, the latest boost v1.79.0 meet this compile error in ipmid only aarch64 platform when we upgrade newer openbmc.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Currently, we try to diff between v1.78.0 and v1.79.0 of boost. If there is any finding, we will update it.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">If you have some suggestions or opinions, welcome provide it. Thanks in advance.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Best regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Tim<o:p></o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt">From:</span></b><span lang="EN-US" style="font-size:11.0pt"> CS20 CHLi30 <<a href="mailto:CHLI30@nuvoton.com">CHLI30@nuvoton.com</a>>
<br>
<b>Sent:</b> Thursday, June 2, 2022 6:11 PM<br>
<b>To:</b> <a href="mailto:openbmc@lists.ozlabs.org">openbmc@lists.ozlabs.org</a>; CS20 CHLi30 <<a href="mailto:CHLI30@nuvoton.com">CHLI30@nuvoton.com</a>>; Tim Lee <<a href="mailto:timlee660101@gmail.com">timlee660101@gmail.com</a>><br>
<b>Subject:</b> [phosphor-ipmi-host] static assertion be raised in aarch64 build<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Hi All,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Is anyone meet this kind of static_assert() be raised in "pack.hpp" and "unpack.hpp"?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">We meet one compile error in "aarch64" platform with the newer commit (5d38067).<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">However, the same commit without this compile error in "arm" platform.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I try to diff "arm" and "aarch64" compile options,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Unfortunately, didn't find any clues to fix this build error in aarch64 platform.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US">Error message of log.do_compile:<o:p></o:p></span></b></p>
<p class="MsoNormal"><span lang="EN-US">error: static assertion failed: Attempt to pack a type that has no IPMI unpack operation<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">error: static assertion failed: Attempt to unpack a type that has no IPMI unpack operation<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">....<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">cc1plus: all warnings being treated as errors<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Makefile:1344: recipe for target 'libipmi20_la-sensorhandler.lo' failed<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">make[2]: Leaving directory '/home/tim/npcm-master/openbmc/build/evb-npcm845/tmp/work/cortexa35-openbmc-linux/phosphor-ipmi-host/1.0+gitAUTOINC+5d38067181-r1/build'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Makefile:1599: recipe for target 'all-recursive' failed<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">make[2]: *** [libipmi20_la-sensorhandler.lo] Error 1<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">make[1]: *** [all-recursive] Error 1<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">make[1]: Leaving directory '/home/tim/npcm-master/openbmc/build/evb-npcm845/tmp/work/cortexa35-openbmc-linux/phosphor-ipmi-host/1.0+gitAUTOINC+5d38067181-r1/build'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">ERROR: oe_runmake failed<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">More messages in log.do_compile:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">/home/tim/npcm-master/openbmc/build/evb-npcm845/tmp/work/cortexa35-openbmc-linux/phosphor-ipmi-host/1.0+gitAUTOINC+5d38067181-r1/build/../git/include/ipmid/message/unpack.hpp: In instantiation of 'static int ipmi::message::details::UnpackSingle<A>::op(ipmi::message::Payload&,
 T&) [with T = boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<24, 24, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void>, boost::multiprecision::et_off>]':<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">/home/tim/npcm-master/openbmc/build/evb-npcm845/tmp/work/cortexa35-openbmc-linux/phosphor-ipmi-host/1.0+gitAUTOINC+5d38067181-r1/build/../git/include/ipmid/message.hpp:440:45:   required from 'int ipmi::message::Payload::unpack(Arg&&,
 Args&& ...) [with Arg = boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<24, 24, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void>, boost::multiprecision::et_off>&; Args = {}]'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">../git/ipmid-new.cpp:300:37:   required from here<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">/home/tim/npcm-master/openbmc/build/evb-npcm845/tmp/work/cortexa35-openbmc-linux/phosphor-ipmi-host/1.0+gitAUTOINC+5d38067181-r1/build/..<b>/git/include/ipmid/message/unpack.hpp:123:46: error: static assertion failed:
 Attempt to unpack a type that has no IPMI unpack operation</b><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">  123 |                 utility::dependent_false<T>::value,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">      |                                              ^~~~~<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">/home/tim/npcm-master/openbmc/build/evb-npcm845/tmp/work/cortexa35-openbmc-linux/phosphor-ipmi-host/1.0+gitAUTOINC+5d38067181-r1/build/../git/include/ipmid/message/unpack.hpp:123:46: note: 'std::integral_constant<bool,
 false>::value' evaluates to false<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">/home/tim/npcm-master/openbmc/build/evb-npcm845/tmp/work/cortexa35-openbmc-linux/phosphor-ipmi-host/1.0+gitAUTOINC+5d38067181-r1/build/../git/include/ipmid/message/unpack.hpp:126:5: error: no return statement in function
 returning non-void [-Werror=return-type]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">  126 |     }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">      |     ^<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">......<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">/home/tim/npcm-master/openbmc/build/evb-npcm845/tmp/work/cortexa35-openbmc-linux/phosphor-ipmi-host/1.0+gitAUTOINC+5d38067181-r1/build/../git/include/ipmid/message/pack.hpp: In instantiation of 'static int ipmi::message::details::PackSingle<A>::op(ipmi::message::Payload&,
 const T&) [with T = boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<24, 24, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void>, boost::multiprecision::et_off>]':<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">/home/tim/npcm-master/openbmc/build/evb-npcm845/tmp/work/cortexa35-openbmc-linux/phosphor-ipmi-host/1.0+gitAUTOINC+5d38067181-r1/build/../git/include/ipmid/message.hpp:262:43:   required from 'int ipmi::message::Payload::pack(Arg&&,
 Args&& ...) [with Arg = boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<24, 24, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void>, boost::multiprecision::et_off>&; Args = {}]'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">../git/ipmid-new.cpp:308:16:   required from here<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">/home/tim/npcm-master/openbmc/build/evb-npcm845/tmp/work/cortexa35-openbmc-linux/phosphor-ipmi-host/1.0+gitAUTOINC+5d38067181-r1/build/..<b>/git/include/ipmid/message/pack.hpp:80:28: error: static assertion failed: Attempt
 to pack a type that has no IPMI pack operation</b><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">   80 |         static_assert(std::is_integral_v<T>,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">      |                       ~~~~~^~~~~~~~~~~~~~~~<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US">static_assert() in unpack.hpp:<o:p></o:p></span></b></p>
<p class="MsoNormal"><span lang="EN-US">template <typename T><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">struct UnpackSingle<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">{<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">    static int op(Payload& p, T& t)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">    {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">            static_assert(<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">                utility::dependent_false<T>::value,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">                "Attempt to unpack a type that has no IPMI unpack operation");<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US">static_assert() in pack.hpp:<o:p></o:p></span></b></p>
<p class="MsoNormal"><span lang="EN-US">template <typename T><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">struct PackSingle<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">{<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">    static int op(Payload& p, const T& t)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">    {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">        static_assert(std::is_integral_v<T>,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">                      "Attempt to pack a type that has no IPMI pack operation");<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Best regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Tim<o:p></o:p></span></p>
</div>
<hr align="center" width="100%">
<span style="font-size:12pt;line-height:0.7;font-family: 'Arial'; color:#808080">The privileged confidential information contained in this email is intended for use only by the addressees as indicated by the original sender of this email. If you are not the
 addressee indicated in this email or are not responsible for delivery of the email to such a person, please kindly reply to the sender indicating this fact and delete all copies of it from your computer and network server immediately. Your cooperation is highly
 appreciated. It is advised that any unauthorized use of confidential information of Nuvoton is strictly prohibited; and any information in this email irrelevant to the official business of Nuvoton shall be deemed as neither given nor endorsed by Nuvoton.
</span>
</body>
</html>