[Buildroot] [PATCH 1/1] package/arptables: fix build with BR2_OPTIMIZE_0

Fabrice Fontaine fontaine.fabrice at gmail.com
Sat Apr 23 16:52:45 UTC 2022


Le sam. 23 avr. 2022 à 18:30, Arnout Vandecappelle <arnout at mind.be> a écrit :
>
>
>
> On 21/04/2022 13:55, Fabrice Fontaine wrote:
> > Fix the following build failure with BR2_OPTIMIZE_0 raised since the
> > addition of the package in commit
> > efc10eb6b87884f1f7917462d78af6953fcd99e3 and
> > https://git.netfilter.org/arptables/commit/?id=369afc14de1d89ff5627ff4c5f72f6f839244b50:
> >
> > libarptc/libarptc.c:48:21: error: redefinition of 'arpt_get_target'
> >     48 | #define GET_TARGET  arpt_get_target
> >        |                     ^~~~~~~~~~~~~~~
> > libarptc/libarptc_incl.c:16:1: note: in expansion of macro 'GET_TARGET'
> >     16 | GET_TARGET(STRUCT_ENTRY *e)
> >        | ^~~~~~~~~~
> > In file included from .//include/libarptc/libarptc.h:7,
> >                   from libarptc/libarptc.c:26:
> > .//include/linux/netfilter_arp/arp_tables.h:196:43: note: previous definition of 'arpt_get_target' was here
> >    196 | static __inline__ struct xt_entry_target *arpt_get_target(struct arpt_entry *e)
> >        |                                           ^~~~~~~~~~~~~~~
> >
> > Fixes:
> >   - http://autobuild.buildroot.org/results/730dce4101e7afcee233067e2870603cd64b8a48
> >
> > Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
> > ---
> >   ...tc-libarptc_incl.c-fix-build-with-O0.patch | 49 +++++++++++++++++++
> >   1 file changed, 49 insertions(+)
> >   create mode 100644 package/arptables/0002-libarptc-libarptc_incl.c-fix-build-with-O0.patch
> >
> > diff --git a/package/arptables/0002-libarptc-libarptc_incl.c-fix-build-with-O0.patch b/package/arptables/0002-libarptc-libarptc_incl.c-fix-build-with-O0.patch
> > new file mode 100644
> > index 0000000000..29f2d714e2
> > --- /dev/null
> > +++ b/package/arptables/0002-libarptc-libarptc_incl.c-fix-build-with-O0.patch
> > @@ -0,0 +1,49 @@
> > +From 7d8285ae92253017a15282dd25f76d76eed49518 Mon Sep 17 00:00:00 2001
> > +From: Fabrice Fontaine <fontaine.fabrice at gmail.com>
> > +Date: Thu, 21 Apr 2022 13:43:23 +0200
> > +Subject: [PATCH] libarptc/libarptc_incl.c: fix build with -O0
> > +
> > +Fix the following build failure with -O0:
> > +
> > +libarptc/libarptc.c:48:21: error: redefinition of 'arpt_get_target'
> > +   48 | #define GET_TARGET  arpt_get_target
> > +      |                     ^~~~~~~~~~~~~~~
> > +libarptc/libarptc_incl.c:16:1: note: in expansion of macro 'GET_TARGET'
> > +   16 | GET_TARGET(STRUCT_ENTRY *e)
> > +      | ^~~~~~~~~~
> > +In file included from .//include/libarptc/libarptc.h:7,
> > +                 from libarptc/libarptc.c:26:
> > +.//include/linux/netfilter_arp/arp_tables.h:196:43: note: previous definition of 'arpt_get_target' was here
> > +  196 | static __inline__ struct xt_entry_target *arpt_get_target(struct arpt_entry *e)
> > +      |                                           ^~~~~~~~~~~~~~~
> > +
> > +Fixes:
> > + - http://autobuild.buildroot.org/results/730dce4101e7afcee233067e2870603cd64b8a48
> > +
> > +Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
>
>   No upstream reference? Is upstream dead?

upstream seems dead: no commit since December 2019:
https://git.netfilter.org/arptables.

>
>   Applied to master, thanks.
>
>   Regards,
>   Arnout
>
> > +---
> > + libarptc/libarptc_incl.c | 8 --------
> > + 1 file changed, 8 deletions(-)
> > +
> > +diff --git a/libarptc/libarptc_incl.c b/libarptc/libarptc_incl.c
> > +index c4d5de3..441f2de 100644
> > +--- a/libarptc/libarptc_incl.c
> > ++++ b/libarptc/libarptc_incl.c
> > +@@ -11,14 +11,6 @@
> > + /* (C)1999 Paul ``Rusty'' Russell - Placed under the GNU GPL (See
> > +    COPYING for details). */
> > +
> > +-#ifndef __OPTIMIZE__
> > +-STRUCT_ENTRY_TARGET *
> > +-GET_TARGET(STRUCT_ENTRY *e)
> > +-{
> > +-    return (void *)e + e->target_offset;
> > +-}
> > +-#endif
> > +-
> > + static int sockfd = -1;
> > + static void *arptc_fn = NULL;
> > +
> > +--
> > +2.35.1
> > +

Best Regards,

Fabrice



More information about the buildroot mailing list