All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: [phosphor-ipmi-host] static assertion be raised in aarch64 build
@ 2022-06-08  8:41 CHLI30
  2022-06-17  3:20 ` CHLI30
  0 siblings, 1 reply; 7+ messages in thread
From: CHLI30 @ 2022-06-08  8:41 UTC (permalink / raw)
  To: openbmc, Tim Lee, CHLI30

[-- Attachment #1: Type: text/plain, Size: 6823 bytes --]

Dear All,

We have fixed this compile error of ipmid after we change boost version from v1.79.0 to v1.78.0.
(Using openbmc/poky/meta/recipes-support/boost/boost_1.78.0.bb instead of boost_1.79.0.bb)

Previous boost v1.78.0 without this compile error in ipmid no matter arm or aarch64 platform.
But, the latest boost v1.79.0 meet this compile error in ipmid only aarch64 platform when we upgrade newer openbmc.
Currently, we try to diff between v1.78.0 and v1.79.0 of boost. If there is any finding, we will update it.

If you have some suggestions or opinions, welcome provide it. Thanks in advance.

Best regards,
Tim
From: CS20 CHLi30 <CHLI30@nuvoton.com>
Sent: Thursday, June 2, 2022 6:11 PM
To: openbmc@lists.ozlabs.org; CS20 CHLi30 <CHLI30@nuvoton.com>; Tim Lee <timlee660101@gmail.com>
Subject: [phosphor-ipmi-host] static assertion be raised in aarch64 build

Hi All,
Is anyone meet this kind of static_assert() be raised in "pack.hpp" and "unpack.hpp"?

We meet one compile error in "aarch64" platform with the newer commit (5d38067).
However, the same commit without this compile error in "arm" platform.
I try to diff "arm" and "aarch64" compile options,
Unfortunately, didn't find any clues to fix this build error in aarch64 platform.

Error message of log.do_compile:
error: static assertion failed: Attempt to pack a type that has no IPMI unpack operation
error: static assertion failed: Attempt to unpack a type that has no IPMI unpack operation
....
cc1plus: all warnings being treated as errors
Makefile:1344: recipe for target 'libipmi20_la-sensorhandler.lo' failed
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'
Makefile:1599: recipe for target 'all-recursive' failed
make[2]: *** [libipmi20_la-sensorhandler.lo] Error 1
make[1]: *** [all-recursive] Error 1
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'
ERROR: oe_runmake failed

More messages in log.do_compile:
/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>]':
/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 = {}]'
../git/ipmid-new.cpp:300:37:   required from here
/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: error: static assertion failed: Attempt to unpack a type that has no IPMI unpack operation
  123 |                 utility::dependent_false<T>::value,
      |                                              ^~~~~
/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
/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]
  126 |     }
      |     ^
......
/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>]':
/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 = {}]'
../git/ipmid-new.cpp:308:16:   required from here
/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:80:28: error: static assertion failed: Attempt to pack a type that has no IPMI pack operation
   80 |         static_assert(std::is_integral_v<T>,
      |                       ~~~~~^~~~~~~~~~~~~~~~

static_assert() in unpack.hpp:
template <typename T>
struct UnpackSingle
{
    static int op(Payload& p, T& t)
    {
            static_assert(
                utility::dependent_false<T>::value,
                "Attempt to unpack a type that has no IPMI unpack operation");

static_assert() in pack.hpp:
template <typename T>
struct PackSingle
{
    static int op(Payload& p, const T& t)
    {
        static_assert(std::is_integral_v<T>,
                      "Attempt to pack a type that has no IPMI pack operation");

Best regards,
Tim
________________________________
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.

[-- Attachment #2: Type: text/html, Size: 15782 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [phosphor-ipmi-host] static assertion be raised in aarch64 build
  2022-06-08  8:41 [phosphor-ipmi-host] static assertion be raised in aarch64 build CHLI30
@ 2022-06-17  3:20 ` CHLI30
  2022-06-17 16:36   ` Patrick Williams
  0 siblings, 1 reply; 7+ messages in thread
From: CHLI30 @ 2022-06-17  3:20 UTC (permalink / raw)
  To: openbmc, Tim Lee

[-- Attachment #1: Type: text/plain, Size: 8985 bytes --]

Hi All,
Share the root cause about this kind of compile error in ipmid at aarch64 platform.
After debugging with boost/multiprecision owner, 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

Summary root cause from boost community:
We 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:
In boost v1.78.0 that use unsigned type for all bit counts, and v1.79.0 use std::size_t type instead it.
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,
and unsigned for Boost-1.78 and earlier.

Verified:
With this patch then ipmid compile error at aarch64 platform was resolved and ipmitool sdr command also pass.

Best regards,
Tim
From: CS20 CHLi30 <CHLI30@nuvoton.com>
Sent: Wednesday, June 8, 2022 4:41 PM
To: openbmc@lists.ozlabs.org; Tim Lee <timlee660101@gmail.com>; CS20 CHLi30 <CHLI30@nuvoton.com>
Subject: RE: [phosphor-ipmi-host] static assertion be raised in aarch64 build

Dear All,

We have fixed this compile error of ipmid after we change boost version from v1.79.0 to v1.78.0.
(Using openbmc/poky/meta/recipes-support/boost/boost_1.78.0.bb instead of boost_1.79.0.bb)

Previous boost v1.78.0 without this compile error in ipmid no matter arm or aarch64 platform.
But, the latest boost v1.79.0 meet this compile error in ipmid only aarch64 platform when we upgrade newer openbmc.
Currently, we try to diff between v1.78.0 and v1.79.0 of boost. If there is any finding, we will update it.

If you have some suggestions or opinions, welcome provide it. Thanks in advance.

Best regards,
Tim
From: CS20 CHLi30 <CHLI30@nuvoton.com<mailto:CHLI30@nuvoton.com>>
Sent: Thursday, June 2, 2022 6:11 PM
To: openbmc@lists.ozlabs.org<mailto:openbmc@lists.ozlabs.org>; CS20 CHLi30 <CHLI30@nuvoton.com<mailto:CHLI30@nuvoton.com>>; Tim Lee <timlee660101@gmail.com<mailto:timlee660101@gmail.com>>
Subject: [phosphor-ipmi-host] static assertion be raised in aarch64 build

Hi All,
Is anyone meet this kind of static_assert() be raised in "pack.hpp" and "unpack.hpp"?

We meet one compile error in "aarch64" platform with the newer commit (5d38067).
However, the same commit without this compile error in "arm" platform.
I try to diff "arm" and "aarch64" compile options,
Unfortunately, didn't find any clues to fix this build error in aarch64 platform.

Error message of log.do_compile:
error: static assertion failed: Attempt to pack a type that has no IPMI unpack operation
error: static assertion failed: Attempt to unpack a type that has no IPMI unpack operation
....
cc1plus: all warnings being treated as errors
Makefile:1344: recipe for target 'libipmi20_la-sensorhandler.lo' failed
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'
Makefile:1599: recipe for target 'all-recursive' failed
make[2]: *** [libipmi20_la-sensorhandler.lo] Error 1
make[1]: *** [all-recursive] Error 1
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'
ERROR: oe_runmake failed

More messages in log.do_compile:
/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>]':
/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 = {}]'
../git/ipmid-new.cpp:300:37:   required from here
/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: error: static assertion failed: Attempt to unpack a type that has no IPMI unpack operation
  123 |                 utility::dependent_false<T>::value,
      |                                              ^~~~~
/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
/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]
  126 |     }
      |     ^
......
/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>]':
/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 = {}]'
../git/ipmid-new.cpp:308:16:   required from here
/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:80:28: error: static assertion failed: Attempt to pack a type that has no IPMI pack operation
   80 |         static_assert(std::is_integral_v<T>,
      |                       ~~~~~^~~~~~~~~~~~~~~~

static_assert() in unpack.hpp:
template <typename T>
struct UnpackSingle
{
    static int op(Payload& p, T& t)
    {
            static_assert(
                utility::dependent_false<T>::value,
                "Attempt to unpack a type that has no IPMI unpack operation");

static_assert() in pack.hpp:
template <typename T>
struct PackSingle
{
    static int op(Payload& p, const T& t)
    {
        static_assert(std::is_integral_v<T>,
                      "Attempt to pack a type that has no IPMI pack operation");

Best regards,
Tim
________________________________
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.

[-- Attachment #2: Type: text/html, Size: 21475 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [phosphor-ipmi-host] static assertion be raised in aarch64 build
  2022-06-17  3:20 ` CHLI30
@ 2022-06-17 16:36   ` Patrick Williams
  2022-06-17 19:27     ` CHLI30
  0 siblings, 1 reply; 7+ messages in thread
From: Patrick Williams @ 2022-06-17 16:36 UTC (permalink / raw)
  To: CHLI30; +Cc: Tim Lee, openbmc

[-- Attachment #1: Type: text/plain, Size: 682 bytes --]

On Fri, Jun 17, 2022 at 03:20:04AM +0000, CHLI30@nuvoton.com wrote:
> Hi All,
> Share the root cause about this kind of compile error in ipmid at aarch64 platform.
> After debugging with boost/multiprecision owner, 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

Hello Tim,

I saw a PR that someone submitted related to this problem:
    - https://github.com/openbmc/phosphor-host-ipmid/pull/183

Was that from your team?  Can you have someone resubmit it by Gerrit as
we do not accept Github pull requests for the project.

-- 
Patrick Williams

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [phosphor-ipmi-host] static assertion be raised in aarch64 build
  2022-06-17 16:36   ` Patrick Williams
@ 2022-06-17 19:27     ` CHLI30
  2022-06-29  1:55       ` CHLI30
  0 siblings, 1 reply; 7+ messages in thread
From: CHLI30 @ 2022-06-17 19:27 UTC (permalink / raw)
  To: Patrick Williams; +Cc: Tim Lee, openbmc, john

Hello Patrick,
No. This PR was submitted by boost/multiprecision maintainer @jzmaddock.
Due to he seems cannot submit via gerrit. Just, I help him to submit this PR via gerrit.
https://gerrit.openbmc.org/c/openbmc/phosphor-host-ipmid/+/54692
Please help to review and merge it for fixing this compile error in ipmid at arrach64 platform. Thanks.

Hi John,
Thanks your great help to resolve this compile error.
If there is any suggestion, welcome to discuss with us. Thanks.

Best regards,
Tim
-----Original Message-----
From: Patrick Williams <patrick@stwcx.xyz>
Sent: Saturday, June 18, 2022 12:36 AM
To: CS20 CHLi30 <CHLI30@nuvoton.com>
Cc: openbmc@lists.ozlabs.org; Tim Lee <timlee660101@gmail.com>
Subject: Re: [phosphor-ipmi-host] static assertion be raised in aarch64 build

On Fri, Jun 17, 2022 at 03:20:04AM +0000, CHLI30@nuvoton.com wrote:
> Hi All,
> Share the root cause about this kind of compile error in ipmid at aarch64 platform.
> After debugging with boost/multiprecision owner, 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

Hello Tim,

I saw a PR that someone submitted related to this problem:
    - https://github.com/openbmc/phosphor-host-ipmid/pull/183

Was that from your team?  Can you have someone resubmit it by Gerrit as we do not accept Github pull requests for the project.

--
Patrick Williams
________________________________
________________________________
 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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [phosphor-ipmi-host] static assertion be raised in aarch64 build
  2022-06-17 19:27     ` CHLI30
@ 2022-06-29  1:55       ` CHLI30
  0 siblings, 0 replies; 7+ messages in thread
From: CHLI30 @ 2022-06-29  1:55 UTC (permalink / raw)
  To: CHLI30, Patrick Williams; +Cc: Tim Lee, openbmc, john

Hi Patrick,

We have submitted this patch in ipmid gerrit. https://gerrit.openbmc.org/c/openbmc/phosphor-host-ipmid/+/54692
The PR already be closed. https://github.com/openbmc/phosphor-host-ipmid/pull/183

Could you help us to review it and see if can be merged for ipmid? Thank you very much.

Sincerely,
Tim
-----Original Message-----
From: openbmc <openbmc-bounces+chli30=nuvoton.com@lists.ozlabs.org> On Behalf Of CHLI30@nuvoton.com
Sent: Saturday, June 18, 2022 3:28 AM
To: Patrick Williams <patrick@stwcx.xyz>
Cc: Tim Lee <timlee660101@gmail.com>; openbmc@lists.ozlabs.org; john@johnmaddock.co.uk
Subject: RE: [phosphor-ipmi-host] static assertion be raised in aarch64 build

Hello Patrick,
No. This PR was submitted by boost/multiprecision maintainer @jzmaddock.
Due to he seems cannot submit via gerrit. Just, I help him to submit this PR via gerrit.
https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgerrit.openbmc.org%2Fc%2Fopenbmc%2Fphosphor-host-ipmid%2F%2B%2F54692&amp;data=05%7C01%7Cchli30%40nuvoton.com%7C3399be844b7f4e06ca6c08da5097a331%7Ca3f24931d4034b4a94f17d83ac638e07%7C0%7C0%7C637910909465356845%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=9%2BrrcTk6OAzkSdvvHK7sn6vc12sNNNMy9haaMjaS3IA%3D&amp;reserved=0
Please help to review and merge it for fixing this compile error in ipmid at arrach64 platform. Thanks.

Hi John,
Thanks your great help to resolve this compile error.
If there is any suggestion, welcome to discuss with us. Thanks.

Best regards,
Tim
-----Original Message-----
From: Patrick Williams <patrick@stwcx.xyz>
Sent: Saturday, June 18, 2022 12:36 AM
To: CS20 CHLi30 <CHLI30@nuvoton.com>
Cc: openbmc@lists.ozlabs.org; Tim Lee <timlee660101@gmail.com>
Subject: Re: [phosphor-ipmi-host] static assertion be raised in aarch64 build

On Fri, Jun 17, 2022 at 03:20:04AM +0000, CHLI30@nuvoton.com wrote:
> Hi All,
> Share the root cause about this kind of compile error in ipmid at aarch64 platform.
> After debugging with boost/multiprecision owner, we have found the root cause why boost v1.79.0 got this compile error in ipmid.
> More detail you can refer from
> https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fboostorg%2Fmultiprecision%2Fissues%2F472&amp;data=05%7C01%7Cchli30%40nuvoton.com%7C3399be844b7f4e06ca6c08da5097a331%7Ca3f24931d4034b4a94f17d83ac638e07%7C0%7C0%7C637910909465356845%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=TR%2Fle56CCGwfBzUi37%2BQNm524R2ZL7%2Fn%2BHvVU5vIDoM%3D&amp;reserved=0

Hello Tim,

I saw a PR that someone submitted related to this problem:
    - https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fopenbmc%2Fphosphor-host-ipmid%2Fpull%2F183&amp;data=05%7C01%7Cchli30%40nuvoton.com%7C3399be844b7f4e06ca6c08da5097a331%7Ca3f24931d4034b4a94f17d83ac638e07%7C0%7C0%7C637910909465356845%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=hyWLpT32cXnto5Qo0VvLa8VQ8exlVb1k13%2Ff3V1zVIQ%3D&amp;reserved=0

Was that from your team?  Can you have someone resubmit it by Gerrit as we do not accept Github pull requests for the project.

--
Patrick Williams
________________________________
________________________________
 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.
________________________________
________________________________
 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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [phosphor-ipmi-host] static assertion be raised in aarch64 build
  2022-06-02 10:10 CHLI30
@ 2022-06-06  0:59 ` CHLI30
  0 siblings, 0 replies; 7+ messages in thread
From: CHLI30 @ 2022-06-06  0:59 UTC (permalink / raw)
  To: openbmc, Tim Lee; +Cc: CHLI30

[-- Attachment #1: Type: text/plain, Size: 6800 bytes --]

Hi All,
Here is the compile option different between arm and aarch64 platform.
The major difference is 'bit-64' vs. 'bit-32' and 'arm-64' vs. 'arm-32'.
Could someone know how to trace this kind of compile error only in aarch64 platform? Thanks in advance.

aarch64 compile option:
DEBUG: SITE files ['endian-little', 'bit-64', 'arm-common', 'arm-64', 'common-linux', 'common-glibc', 'aarch64-linux', 'common']

arm compile option:
DEBUG: SITE files ['endian-little', 'bit-32', 'arm-common', 'arm-32', 'common-linux', 'common-glibc', 'arm-linux', 'arm-linux-gnueabi', 'common']

Best regards,
Tim
From: CS20 CHLi30 <CHLI30@nuvoton.com>
Sent: Thursday, June 2, 2022 6:11 PM
To: openbmc@lists.ozlabs.org; CS20 CHLi30 <CHLI30@nuvoton.com>; Tim Lee <timlee660101@gmail.com>
Subject: [phosphor-ipmi-host] static assertion be raised in aarch64 build

Hi All,
Is anyone meet this kind of static_assert() be raised in "pack.hpp" and "unpack.hpp"?

We meet one compile error in "aarch64" platform with the newer commit (5d38067).
However, the same commit without this compile error in "arm" platform.
I try to diff "arm" and "aarch64" compile options,
Unfortunately, didn't find any clues to fix this build error in aarch64 platform.

Error message of log.do_compile:
error: static assertion failed: Attempt to pack a type that has no IPMI unpack operation
error: static assertion failed: Attempt to unpack a type that has no IPMI unpack operation
....
cc1plus: all warnings being treated as errors
Makefile:1344: recipe for target 'libipmi20_la-sensorhandler.lo' failed
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'
Makefile:1599: recipe for target 'all-recursive' failed
make[2]: *** [libipmi20_la-sensorhandler.lo] Error 1
make[1]: *** [all-recursive] Error 1
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'
ERROR: oe_runmake failed

More messages in log.do_compile:
/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>]':
/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 = {}]'
../git/ipmid-new.cpp:300:37:   required from here
/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: error: static assertion failed: Attempt to unpack a type that has no IPMI unpack operation
  123 |                 utility::dependent_false<T>::value,
      |                                              ^~~~~
/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
/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]
  126 |     }
      |     ^
......
/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>]':
/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 = {}]'
../git/ipmid-new.cpp:308:16:   required from here
/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:80:28: error: static assertion failed: Attempt to pack a type that has no IPMI pack operation
   80 |         static_assert(std::is_integral_v<T>,
      |                       ~~~~~^~~~~~~~~~~~~~~~

static_assert() in unpack.hpp:
template <typename T>
struct UnpackSingle
{
    static int op(Payload& p, T& t)
    {
            static_assert(
                utility::dependent_false<T>::value,
                "Attempt to unpack a type that has no IPMI unpack operation");

static_assert() in pack.hpp:
template <typename T>
struct PackSingle
{
    static int op(Payload& p, const T& t)
    {
        static_assert(std::is_integral_v<T>,
                      "Attempt to pack a type that has no IPMI pack operation");

Best regards,
Tim
________________________________
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.

[-- Attachment #2: Type: text/html, Size: 15567 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [phosphor-ipmi-host] static assertion be raised in aarch64 build
@ 2022-06-02 10:10 CHLI30
  2022-06-06  0:59 ` CHLI30
  0 siblings, 1 reply; 7+ messages in thread
From: CHLI30 @ 2022-06-02 10:10 UTC (permalink / raw)
  To: openbmc, CHLI30, Tim Lee

[-- Attachment #1: Type: text/plain, Size: 5938 bytes --]

Hi All,
Is anyone meet this kind of static_assert() be raised in "pack.hpp" and "unpack.hpp"?

We meet one compile error in "aarch64" platform with the newer commit (5d38067).
However, the same commit without this compile error in "arm" platform.
I try to diff "arm" and "aarch64" compile options,
Unfortunately, didn't find any clues to fix this build error in aarch64 platform.

Error message of log.do_compile:
error: static assertion failed: Attempt to pack a type that has no IPMI unpack operation
error: static assertion failed: Attempt to unpack a type that has no IPMI unpack operation
....
cc1plus: all warnings being treated as errors
Makefile:1344: recipe for target 'libipmi20_la-sensorhandler.lo' failed
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'
Makefile:1599: recipe for target 'all-recursive' failed
make[2]: *** [libipmi20_la-sensorhandler.lo] Error 1
make[1]: *** [all-recursive] Error 1
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'
ERROR: oe_runmake failed

More messages in log.do_compile:
/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>]':
/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 = {}]'
../git/ipmid-new.cpp:300:37:   required from here
/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: error: static assertion failed: Attempt to unpack a type that has no IPMI unpack operation
  123 |                 utility::dependent_false<T>::value,
      |                                              ^~~~~
/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
/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]
  126 |     }
      |     ^
......
/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>]':
/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 = {}]'
../git/ipmid-new.cpp:308:16:   required from here
/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:80:28: error: static assertion failed: Attempt to pack a type that has no IPMI pack operation
   80 |         static_assert(std::is_integral_v<T>,
      |                       ~~~~~^~~~~~~~~~~~~~~~

static_assert() in unpack.hpp:
template <typename T>
struct UnpackSingle
{
    static int op(Payload& p, T& t)
    {
            static_assert(
                utility::dependent_false<T>::value,
                "Attempt to unpack a type that has no IPMI unpack operation");

static_assert() in pack.hpp:
template <typename T>
struct PackSingle
{
    static int op(Payload& p, const T& t)
    {
        static_assert(std::is_integral_v<T>,
                      "Attempt to pack a type that has no IPMI pack operation");

Best regards,
Tim
________________________________
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.

[-- Attachment #2: Type: text/html, Size: 13013 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-06-29  1:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08  8:41 [phosphor-ipmi-host] static assertion be raised in aarch64 build CHLI30
2022-06-17  3:20 ` CHLI30
2022-06-17 16:36   ` Patrick Williams
2022-06-17 19:27     ` CHLI30
2022-06-29  1:55       ` CHLI30
  -- strict thread matches above, loose matches on Subject: below --
2022-06-02 10:10 CHLI30
2022-06-06  0:59 ` CHLI30

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.