netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Petr Machata <petrm@nvidia.com>, David Ahern <dsahern@gmail.com>,
	Linux Kernel Network Developers <netdev@vger.kernel.org>
Subject: Re: Report: iproute2 build broken?
Date: Mon, 4 Jul 2022 10:07:29 -0700	[thread overview]
Message-ID: <20220704100729.570bc39b@hermes.local> (raw)
In-Reply-To: <CAM0EoMkWjOYRuJx3ebY-cQr5odJekwCtxeM5_Cmu1G4vxZ5dpw@mail.gmail.com>

On Mon, 4 Jul 2022 11:51:39 -0400
Jamal Hadi Salim <jhs@mojatatu.com> wrote:

> I have to admit i am being lazy here digging into the
> root cause but normally iproute2 should just build
> standalone regardless especially when it is a stable
> version:
> 
> $ cat include/version.h
> static const char version[] = "5.18.0";
> 
> $make
> ..
> ....
> .....
>   CC       iplink_bond.o
> iplink_bond.c:935:10: error: initializer element is not constant
>   .desc = ipstats_stat_desc_bond_tmpl_lacp,
>           ^
> iplink_bond.c:935:10: note: (near initialization for
> ‘ipstats_stat_desc_xstats_bond_lacp.desc’)
> iplink_bond.c:957:10: error: initializer element is not constant
>   .desc = ipstats_stat_desc_bond_tmpl_lacp,
>           ^
> iplink_bond.c:957:10: note: (near initialization for
> ‘ipstats_stat_desc_xstats_slave_bond_lacp.desc’)
> ../config.mk:40: recipe for target 'iplink_bond.o' failed
> make[1]: *** [iplink_bond.o] Error 1
> Makefile:77: recipe for target 'all' failed
> make: *** [all] Error 2
> 
> There's more if you fix that one given a whole lot
> of dependencies
> 
> cheers,
> jamal


Fixed in main by:


commit 11e41a635cfab54e8e02fbff2a03715467e77ae9
Author: Petr Machata <petrm@nvidia.com>
Date:   Tue May 31 13:35:48 2022 +0200

    ip: Convert non-constant initializers to macros
    
    As per the C standard, "expressions in an initializer for an object that
    has static or thread storage duration shall be constant expressions".
    Aggregate objects are not constant expressions. Newer GCC doesn't mind, but
    older GCC and LLVM do.
    
    Therefore convert to a macro. And since all these macros will look very
    similar, extract a generic helper, IPSTATS_STAT_DESC_XSTATS_LEAF, which
    takes the leaf name as an argument and initializes the rest as appropriate
    for an xstats descriptor.
    
    Reported-by: Stephen Hemminger <stephen@networkplumber.org>
    Signed-off-by: Petr Machata <petrm@nvidia.com>
    Reviewed-by: Ido Schimmel <idosch@nvidia.com>
    Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>


      parent reply	other threads:[~2022-07-04 17:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-04 15:51 Report: iproute2 build broken? Jamal Hadi Salim
2022-07-04 16:04 ` Jamal Hadi Salim
2022-07-04 16:34 ` Ido Schimmel
2022-07-04 16:59   ` Jamal Hadi Salim
2022-07-04 17:17     ` Ido Schimmel
2022-07-04 19:07       ` Stephen Hemminger
2022-07-06 11:26         ` Jamal Hadi Salim
2022-07-04 17:07 ` Stephen Hemminger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220704100729.570bc39b@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=dsahern@gmail.com \
    --cc=jhs@mojatatu.com \
    --cc=netdev@vger.kernel.org \
    --cc=petrm@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).