netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Report: iproute2 build broken?
@ 2022-07-04 15:51 Jamal Hadi Salim
  2022-07-04 16:04 ` Jamal Hadi Salim
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Jamal Hadi Salim @ 2022-07-04 15:51 UTC (permalink / raw)
  To: Petr Machata
  Cc: David Ahern, Stephen Hemminger, Linux Kernel Network Developers

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

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

* Re: Report: iproute2 build broken?
  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 17:07 ` Stephen Hemminger
  2 siblings, 0 replies; 8+ messages in thread
From: Jamal Hadi Salim @ 2022-07-04 16:04 UTC (permalink / raw)
  To: Petr Machata
  Cc: David Ahern, Stephen Hemminger, Linux Kernel Network Developers

Should have said this is a really old system, but shouldnt really matter, yes?

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.7 LTS
Release: 16.04
Codename: xenial
hadi@vindaloo:~/sample-iproute2-p4tc$ uname -a
Linux vindaloo 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56
UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

cheers,
jamal

On Mon, Jul 4, 2022 at 11:51 AM 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

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

* Re: Report: iproute2 build broken?
  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:07 ` Stephen Hemminger
  2 siblings, 1 reply; 8+ messages in thread
From: Ido Schimmel @ 2022-07-04 16:34 UTC (permalink / raw)
  To: Jamal Hadi Salim
  Cc: Petr Machata, David Ahern, Stephen Hemminger,
	Linux Kernel Network Developers

On Mon, Jul 04, 2022 at 11:51:39AM -0400, Jamal Hadi Salim 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

Petr is OOO, not sure he will see your mail till later this week so I
will try to help. Can you try with current main branch [1] or just take
this patch [2] ?

[1] https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/log/
[2] https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=11e41a635cfab54e8e02fbff2a03715467e77ae9

> 
> There's more if you fix that one given a whole lot
> of dependencies
> 
> cheers,
> jamal

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

* Re: Report: iproute2 build broken?
  2022-07-04 16:34 ` Ido Schimmel
@ 2022-07-04 16:59   ` Jamal Hadi Salim
  2022-07-04 17:17     ` Ido Schimmel
  0 siblings, 1 reply; 8+ messages in thread
From: Jamal Hadi Salim @ 2022-07-04 16:59 UTC (permalink / raw)
  To: Ido Schimmel
  Cc: Petr Machata, David Ahern, Stephen Hemminger,
	Linux Kernel Network Developers

Thanks Ido. That fixed it.
General question: do we need a "stable" iproute2?

cheers,
jamal

On Mon, Jul 4, 2022 at 12:34 PM Ido Schimmel <idosch@idosch.org> wrote:
>
> On Mon, Jul 04, 2022 at 11:51:39AM -0400, Jamal Hadi Salim 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
>
> Petr is OOO, not sure he will see your mail till later this week so I
> will try to help. Can you try with current main branch [1] or just take
> this patch [2] ?
>
> [1] https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/log/
> [2] https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=11e41a635cfab54e8e02fbff2a03715467e77ae9
>
> >
> > There's more if you fix that one given a whole lot
> > of dependencies
> >
> > cheers,
> > jamal

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

* Re: Report: iproute2 build broken?
  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 17:07 ` Stephen Hemminger
  2 siblings, 0 replies; 8+ messages in thread
From: Stephen Hemminger @ 2022-07-04 17:07 UTC (permalink / raw)
  To: Jamal Hadi Salim
  Cc: Petr Machata, David Ahern, Linux Kernel Network Developers

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>


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

* Re: Report: iproute2 build broken?
  2022-07-04 16:59   ` Jamal Hadi Salim
@ 2022-07-04 17:17     ` Ido Schimmel
  2022-07-04 19:07       ` Stephen Hemminger
  0 siblings, 1 reply; 8+ messages in thread
From: Ido Schimmel @ 2022-07-04 17:17 UTC (permalink / raw)
  To: Jamal Hadi Salim
  Cc: Petr Machata, David Ahern, Stephen Hemminger,
	Linux Kernel Network Developers

On Mon, Jul 04, 2022 at 12:59:45PM -0400, Jamal Hadi Salim wrote:
> Thanks Ido. That fixed it.
> General question: do we need a "stable" iproute2?

Maybe a new point release is enough (e.g., 5.18.1)?

I see that's what Stephen did the last time something similar happened:

$ git log v4.14.0^..v4.14.1

commit 212b52299e90a369373b9e38924b9492df695559
Author: Stephen Hemminger <stephen@networkplumber.org>
Date:   Mon Nov 13 10:09:57 2017 -0800

    v4.14.1

commit b867d46dafee4ac81acecd2d398c392eb43b50bb
Author: Stephen Hemminger <stephen@networkplumber.org>
Date:   Mon Nov 13 10:08:39 2017 -0800

    utils: remove duplicate include of ctype.h
    
    Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

commit aba736dc251ee7aa7c2035e18bffc37b18f05222
Author: Leon Romanovsky <leonro@mellanox.com>
Date:   Mon Nov 13 12:21:19 2017 +0200

    ip: Fix compilation break on old systems
    
    As was reported [1], the iproute2 fails to compile on old systems,
    in Cong's case, it was Fedora 19, in our case it was RedHat 7.2, which
    failed with the following errors during compilation:
    
    ipxfrm.c: In function ‘xfrm_selector_print’:
    ipxfrm.c:479:7: error: ‘IPPROTO_MH’ undeclared (first use in this
    function)
      case IPPROTO_MH:
           ^
    ipxfrm.c:479:7: note: each undeclared identifier is reported only once
    for each function it appears in
    ipxfrm.c: In function ‘xfrm_selector_upspec_parse’:
    ipxfrm.c:1345:8: error: ‘IPPROTO_MH’ undeclared (first use in this
    function)
       case IPPROTO_MH:
            ^                                                                                                                                                            make[1]: *** [ipxfrm.o] Error 1
    
    The reason to it is the order of headers files. The IPPROTO_MH field is
    set in kernel's UAPI header file (in6.h), but only in case
    __UAPI_DEF_IPPROTO_V6 is set before. That define comes from other kernel's
    header file (libc-compat.h) and is set in case there are no previous
    libc relevant declarations.
    
    In ip code, the include of <netdb.h> causes to indirect inclusion of
    <netinet/in.h> and it sets __UAPI_DEF_IPPROTO_V6 to be zero and prevents from
    IPPROTO_MH declaration.
    
    This patch takes the simplest possible approach to fix the compilation
    error by checking if IPPROTO_MH was defined before and in case it
    wasn't, it defines it to be the same as in the kernel.
    
    [1] https://www.spinics.net/lists/netdev/msg463980.html
    
    Cc: Cong Wang <xiyou.wangcong@gmail.com>
    Cc: Riad Abo Raed <riada@mellanox.com>
    Signed-off-by: Leon Romanovsky <leonro@mellanox.com>

commit 7d14d00795c334a288f1733bfdabdf363a7f962c
Author: Stephen Hemminger <stephen@networkplumber.org>
Date:   Sun Nov 12 16:29:43 2017 -0800

    v4.14.0

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

* Re: Report: iproute2 build broken?
  2022-07-04 17:17     ` Ido Schimmel
@ 2022-07-04 19:07       ` Stephen Hemminger
  2022-07-06 11:26         ` Jamal Hadi Salim
  0 siblings, 1 reply; 8+ messages in thread
From: Stephen Hemminger @ 2022-07-04 19:07 UTC (permalink / raw)
  To: Ido Schimmel
  Cc: Jamal Hadi Salim, Petr Machata, David Ahern,
	Linux Kernel Network Developers

On Mon, 4 Jul 2022 20:17:51 +0300
Ido Schimmel <idosch@idosch.org> wrote:

> On Mon, Jul 04, 2022 at 12:59:45PM -0400, Jamal Hadi Salim wrote:
> > Thanks Ido. That fixed it.
> > General question: do we need a "stable" iproute2?  
> 
> Maybe a new point release is enough (e.g., 5.18.1)?


I don't think this is urgent enough for another release.

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

* Re: Report: iproute2 build broken?
  2022-07-04 19:07       ` Stephen Hemminger
@ 2022-07-06 11:26         ` Jamal Hadi Salim
  0 siblings, 0 replies; 8+ messages in thread
From: Jamal Hadi Salim @ 2022-07-06 11:26 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Ido Schimmel, Petr Machata, David Ahern,
	Linux Kernel Network Developers

On Mon, Jul 4, 2022 at 3:07 PM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> On Mon, 4 Jul 2022 20:17:51 +0300
> Ido Schimmel <idosch@idosch.org> wrote:
>
> > On Mon, Jul 04, 2022 at 12:59:45PM -0400, Jamal Hadi Salim wrote:
> > > Thanks Ido. That fixed it.
> > > General question: do we need a "stable" iproute2?
> >
> > Maybe a new point release is enough (e.g., 5.18.1)?
>
>
> I don't think this is urgent enough for another release.

I was more wondering whether such a process even existed - it seems to
but then what is the criteria for deciding something deserves another release?
What was the motivation the last time?
Distros did their own thing in the past...

cheers,
jamal

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

end of thread, other threads:[~2022-07-06 11:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).