DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30
@ 2019-05-02  9:33 Reshma Pattan
  2019-05-02  9:33 ` Reshma Pattan
                   ` (3 more replies)
  0 siblings, 4 replies; 36+ messages in thread
From: Reshma Pattan @ 2019-05-02  9:33 UTC (permalink / raw)
  To: dev; +Cc: Reshma Pattan

gcc 9 on Fedora 30 gives an error
"taking address of packed member may result in an
unaligned pointer value" warnings.

For clang builds this warning is already disabled,
so disable "-Waddress-of-packed-member" for gcc builds
also.

Snippet of build error:
...lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’:
...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking address
of packed member of ‘struct rte_mem_config’ may result in an unaligned
pointer value [-Werror=address-of-packed-member]
  768 |  cur_msl = &mcfg->memsegs[msl_idx];
      |            ^~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
---
 mk/toolchain/gcc/rte.vars.mk | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk
index d8b99faf6..b852fcfd7 100644
--- a/mk/toolchain/gcc/rte.vars.mk
+++ b/mk/toolchain/gcc/rte.vars.mk
@@ -87,5 +87,8 @@ WERROR_FLAGS += -Wimplicit-fallthrough=2
 WERROR_FLAGS += -Wno-format-truncation
 endif
 
+# disable packed member unalign warnings
+WERROR_FLAGS += -Wno-address-of-packed-member
+
 export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF
 export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS
-- 
2.21.0

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

* [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30
  2019-05-02  9:33 [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30 Reshma Pattan
@ 2019-05-02  9:33 ` Reshma Pattan
  2019-05-02 10:07 ` David Marchand
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 36+ messages in thread
From: Reshma Pattan @ 2019-05-02  9:33 UTC (permalink / raw)
  To: dev; +Cc: Reshma Pattan

gcc 9 on Fedora 30 gives an error
"taking address of packed member may result in an
unaligned pointer value" warnings.

For clang builds this warning is already disabled,
so disable "-Waddress-of-packed-member" for gcc builds
also.

Snippet of build error:
...lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’:
...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking address
of packed member of ‘struct rte_mem_config’ may result in an unaligned
pointer value [-Werror=address-of-packed-member]
  768 |  cur_msl = &mcfg->memsegs[msl_idx];
      |            ^~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
---
 mk/toolchain/gcc/rte.vars.mk | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk
index d8b99faf6..b852fcfd7 100644
--- a/mk/toolchain/gcc/rte.vars.mk
+++ b/mk/toolchain/gcc/rte.vars.mk
@@ -87,5 +87,8 @@ WERROR_FLAGS += -Wimplicit-fallthrough=2
 WERROR_FLAGS += -Wno-format-truncation
 endif
 
+# disable packed member unalign warnings
+WERROR_FLAGS += -Wno-address-of-packed-member
+
 export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF
 export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS
-- 
2.21.0


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

* Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30
  2019-05-02  9:33 [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30 Reshma Pattan
  2019-05-02  9:33 ` Reshma Pattan
@ 2019-05-02 10:07 ` David Marchand
  2019-05-02 10:07   ` David Marchand
  2019-05-02 13:26   ` Bruce Richardson
  2019-05-02 14:13 ` [dpdk-dev] [PATCH v2] mk: report address of packed member as warning Reshma Pattan
  2019-05-02 15:00 ` [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30 David Marchand
  3 siblings, 2 replies; 36+ messages in thread
From: David Marchand @ 2019-05-02 10:07 UTC (permalink / raw)
  To: Reshma Pattan; +Cc: dev

On Thu, May 2, 2019 at 11:33 AM Reshma Pattan <reshma.pattan@intel.com>
wrote:

> gcc 9 on Fedora 30 gives an error
> "taking address of packed member may result in an
> unaligned pointer value" warnings.
>
> For clang builds this warning is already disabled,
> so disable "-Waddress-of-packed-member" for gcc builds
> also.
>
> Snippet of build error:
> ...lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’:
> ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking address
> of packed member of ‘struct rte_mem_config’ may result in an unaligned
> pointer value [-Werror=address-of-packed-member]
>   768 |  cur_msl = &mcfg->memsegs[msl_idx];
>       |            ^~~~~~~~~~~~~~~~~~~~~~~
>
> Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
> ---
>  mk/toolchain/gcc/rte.vars.mk | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk
> index d8b99faf6..b852fcfd7 100644
> --- a/mk/toolchain/gcc/rte.vars.mk
> +++ b/mk/toolchain/gcc/rte.vars.mk
> @@ -87,5 +87,8 @@ WERROR_FLAGS += -Wimplicit-fallthrough=2
>  WERROR_FLAGS += -Wno-format-truncation
>  endif
>
> +# disable packed member unalign warnings
> +WERROR_FLAGS += -Wno-address-of-packed-member
> +
>  export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF
>  export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS
> --
> 2.21.0
>
>
Not the best approach to me...
Let me install a fedora 30 and have a look.


-- 
David Marchand

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

* Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30
  2019-05-02 10:07 ` David Marchand
@ 2019-05-02 10:07   ` David Marchand
  2019-05-02 13:26   ` Bruce Richardson
  1 sibling, 0 replies; 36+ messages in thread
From: David Marchand @ 2019-05-02 10:07 UTC (permalink / raw)
  To: Reshma Pattan; +Cc: dev

On Thu, May 2, 2019 at 11:33 AM Reshma Pattan <reshma.pattan@intel.com>
wrote:

> gcc 9 on Fedora 30 gives an error
> "taking address of packed member may result in an
> unaligned pointer value" warnings.
>
> For clang builds this warning is already disabled,
> so disable "-Waddress-of-packed-member" for gcc builds
> also.
>
> Snippet of build error:
> ...lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’:
> ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking address
> of packed member of ‘struct rte_mem_config’ may result in an unaligned
> pointer value [-Werror=address-of-packed-member]
>   768 |  cur_msl = &mcfg->memsegs[msl_idx];
>       |            ^~~~~~~~~~~~~~~~~~~~~~~
>
> Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
> ---
>  mk/toolchain/gcc/rte.vars.mk | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk
> index d8b99faf6..b852fcfd7 100644
> --- a/mk/toolchain/gcc/rte.vars.mk
> +++ b/mk/toolchain/gcc/rte.vars.mk
> @@ -87,5 +87,8 @@ WERROR_FLAGS += -Wimplicit-fallthrough=2
>  WERROR_FLAGS += -Wno-format-truncation
>  endif
>
> +# disable packed member unalign warnings
> +WERROR_FLAGS += -Wno-address-of-packed-member
> +
>  export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF
>  export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS
> --
> 2.21.0
>
>
Not the best approach to me...
Let me install a fedora 30 and have a look.


-- 
David Marchand

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

* Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30
  2019-05-02 10:07 ` David Marchand
  2019-05-02 10:07   ` David Marchand
@ 2019-05-02 13:26   ` Bruce Richardson
  2019-05-02 13:26     ` Bruce Richardson
  2019-05-02 13:30     ` David Marchand
  1 sibling, 2 replies; 36+ messages in thread
From: Bruce Richardson @ 2019-05-02 13:26 UTC (permalink / raw)
  To: David Marchand; +Cc: Reshma Pattan, dev

On Thu, May 02, 2019 at 12:07:17PM +0200, David Marchand wrote:
> On Thu, May 2, 2019 at 11:33 AM Reshma Pattan <reshma.pattan@intel.com>
> wrote:
> 
> > gcc 9 on Fedora 30 gives an error
> > "taking address of packed member may result in an
> > unaligned pointer value" warnings.
> >
> > For clang builds this warning is already disabled,
> > so disable "-Waddress-of-packed-member" for gcc builds
> > also.
> >
> > Snippet of build error:
> > ...lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’:
> > ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking address
> > of packed member of ‘struct rte_mem_config’ may result in an unaligned
> > pointer value [-Werror=address-of-packed-member]
> >   768 |  cur_msl = &mcfg->memsegs[msl_idx];
> >       |            ^~~~~~~~~~~~~~~~~~~~~~~
> >
> > Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
> > ---
> >  mk/toolchain/gcc/rte.vars.mk | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk
> > index d8b99faf6..b852fcfd7 100644
> > --- a/mk/toolchain/gcc/rte.vars.mk
> > +++ b/mk/toolchain/gcc/rte.vars.mk
> > @@ -87,5 +87,8 @@ WERROR_FLAGS += -Wimplicit-fallthrough=2
> >  WERROR_FLAGS += -Wno-format-truncation
> >  endif
> >
> > +# disable packed member unalign warnings
> > +WERROR_FLAGS += -Wno-address-of-packed-member
> > +
> >  export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF
> >  export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS
> > --
> > 2.21.0
> >
> >
> Not the best approach to me...
> 
Agreed, but this fix does seem reasonable since we already disable this warning
for clang.

> Let me install a fedora 30 and have a look.
Hopefully you can come up with a better fix, but I think we need something
soon for 19.05, so this patch may be needed as a stop-gap fix.

/Bruce

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

* Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30
  2019-05-02 13:26   ` Bruce Richardson
@ 2019-05-02 13:26     ` Bruce Richardson
  2019-05-02 13:30     ` David Marchand
  1 sibling, 0 replies; 36+ messages in thread
From: Bruce Richardson @ 2019-05-02 13:26 UTC (permalink / raw)
  To: David Marchand; +Cc: Reshma Pattan, dev

On Thu, May 02, 2019 at 12:07:17PM +0200, David Marchand wrote:
> On Thu, May 2, 2019 at 11:33 AM Reshma Pattan <reshma.pattan@intel.com>
> wrote:
> 
> > gcc 9 on Fedora 30 gives an error
> > "taking address of packed member may result in an
> > unaligned pointer value" warnings.
> >
> > For clang builds this warning is already disabled,
> > so disable "-Waddress-of-packed-member" for gcc builds
> > also.
> >
> > Snippet of build error:
> > ...lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’:
> > ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking address
> > of packed member of ‘struct rte_mem_config’ may result in an unaligned
> > pointer value [-Werror=address-of-packed-member]
> >   768 |  cur_msl = &mcfg->memsegs[msl_idx];
> >       |            ^~~~~~~~~~~~~~~~~~~~~~~
> >
> > Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
> > ---
> >  mk/toolchain/gcc/rte.vars.mk | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk
> > index d8b99faf6..b852fcfd7 100644
> > --- a/mk/toolchain/gcc/rte.vars.mk
> > +++ b/mk/toolchain/gcc/rte.vars.mk
> > @@ -87,5 +87,8 @@ WERROR_FLAGS += -Wimplicit-fallthrough=2
> >  WERROR_FLAGS += -Wno-format-truncation
> >  endif
> >
> > +# disable packed member unalign warnings
> > +WERROR_FLAGS += -Wno-address-of-packed-member
> > +
> >  export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF
> >  export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS
> > --
> > 2.21.0
> >
> >
> Not the best approach to me...
> 
Agreed, but this fix does seem reasonable since we already disable this warning
for clang.

> Let me install a fedora 30 and have a look.
Hopefully you can come up with a better fix, but I think we need something
soon for 19.05, so this patch may be needed as a stop-gap fix.

/Bruce

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

* Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30
  2019-05-02 13:26   ` Bruce Richardson
  2019-05-02 13:26     ` Bruce Richardson
@ 2019-05-02 13:30     ` David Marchand
  2019-05-02 13:30       ` David Marchand
  2019-05-02 13:35       ` Pattan, Reshma
  1 sibling, 2 replies; 36+ messages in thread
From: David Marchand @ 2019-05-02 13:30 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Reshma Pattan, dev

On Thu, May 2, 2019 at 3:26 PM Bruce Richardson <bruce.richardson@intel.com>
wrote:

> On Thu, May 02, 2019 at 12:07:17PM +0200, David Marchand wrote:
> > On Thu, May 2, 2019 at 11:33 AM Reshma Pattan <reshma.pattan@intel.com>
> > wrote:
> >
> > > gcc 9 on Fedora 30 gives an error
> > > "taking address of packed member may result in an
> > > unaligned pointer value" warnings.
> > >
> > > For clang builds this warning is already disabled,
> > > so disable "-Waddress-of-packed-member" for gcc builds
> > > also.
> > >
> > > Snippet of build error:
> > > ...lib/librte_eal/linux/eal/eal_memalloc.c: In function
> ‘alloc_seg_walk’:
> > > ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking
> address
> > > of packed member of ‘struct rte_mem_config’ may result in an unaligned
> > > pointer value [-Werror=address-of-packed-member]
> > >   768 |  cur_msl = &mcfg->memsegs[msl_idx];
> > >       |            ^~~~~~~~~~~~~~~~~~~~~~~
> > >
> > > Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
> > > ---
> > >  mk/toolchain/gcc/rte.vars.mk | 3 +++
> > >  1 file changed, 3 insertions(+)
> > >
> > > diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/
> rte.vars.mk
> > > index d8b99faf6..b852fcfd7 100644
> > > --- a/mk/toolchain/gcc/rte.vars.mk
> > > +++ b/mk/toolchain/gcc/rte.vars.mk
> > > @@ -87,5 +87,8 @@ WERROR_FLAGS += -Wimplicit-fallthrough=2
> > >  WERROR_FLAGS += -Wno-format-truncation
> > >  endif
> > >
> > > +# disable packed member unalign warnings
> > > +WERROR_FLAGS += -Wno-address-of-packed-member
> > > +
> > >  export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF
> > >  export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS
> > > --
> > > 2.21.0
> > >
> > >
> > Not the best approach to me...
> >
> Agreed, but this fix does seem reasonable since we already disable this
> warning
> for clang.
>
> > Let me install a fedora 30 and have a look.
> Hopefully you can come up with a better fix, but I think we need something
> soon for 19.05, so this patch may be needed as a stop-gap fix.
>

Hiding this warning, we will never fix the places that could be fixed (and
I found some where the packed attribute makes no sense to me).
I'd prefer at least a -Wno-error=address-of-packed-member



-- 
David Marchand

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

* Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30
  2019-05-02 13:30     ` David Marchand
@ 2019-05-02 13:30       ` David Marchand
  2019-05-02 13:35       ` Pattan, Reshma
  1 sibling, 0 replies; 36+ messages in thread
From: David Marchand @ 2019-05-02 13:30 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Reshma Pattan, dev

On Thu, May 2, 2019 at 3:26 PM Bruce Richardson <bruce.richardson@intel.com>
wrote:

> On Thu, May 02, 2019 at 12:07:17PM +0200, David Marchand wrote:
> > On Thu, May 2, 2019 at 11:33 AM Reshma Pattan <reshma.pattan@intel.com>
> > wrote:
> >
> > > gcc 9 on Fedora 30 gives an error
> > > "taking address of packed member may result in an
> > > unaligned pointer value" warnings.
> > >
> > > For clang builds this warning is already disabled,
> > > so disable "-Waddress-of-packed-member" for gcc builds
> > > also.
> > >
> > > Snippet of build error:
> > > ...lib/librte_eal/linux/eal/eal_memalloc.c: In function
> ‘alloc_seg_walk’:
> > > ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking
> address
> > > of packed member of ‘struct rte_mem_config’ may result in an unaligned
> > > pointer value [-Werror=address-of-packed-member]
> > >   768 |  cur_msl = &mcfg->memsegs[msl_idx];
> > >       |            ^~~~~~~~~~~~~~~~~~~~~~~
> > >
> > > Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
> > > ---
> > >  mk/toolchain/gcc/rte.vars.mk | 3 +++
> > >  1 file changed, 3 insertions(+)
> > >
> > > diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/
> rte.vars.mk
> > > index d8b99faf6..b852fcfd7 100644
> > > --- a/mk/toolchain/gcc/rte.vars.mk
> > > +++ b/mk/toolchain/gcc/rte.vars.mk
> > > @@ -87,5 +87,8 @@ WERROR_FLAGS += -Wimplicit-fallthrough=2
> > >  WERROR_FLAGS += -Wno-format-truncation
> > >  endif
> > >
> > > +# disable packed member unalign warnings
> > > +WERROR_FLAGS += -Wno-address-of-packed-member
> > > +
> > >  export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF
> > >  export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS
> > > --
> > > 2.21.0
> > >
> > >
> > Not the best approach to me...
> >
> Agreed, but this fix does seem reasonable since we already disable this
> warning
> for clang.
>
> > Let me install a fedora 30 and have a look.
> Hopefully you can come up with a better fix, but I think we need something
> soon for 19.05, so this patch may be needed as a stop-gap fix.
>

Hiding this warning, we will never fix the places that could be fixed (and
I found some where the packed attribute makes no sense to me).
I'd prefer at least a -Wno-error=address-of-packed-member



-- 
David Marchand

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

* Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30
  2019-05-02 13:30     ` David Marchand
  2019-05-02 13:30       ` David Marchand
@ 2019-05-02 13:35       ` Pattan, Reshma
  2019-05-02 13:35         ` Pattan, Reshma
  1 sibling, 1 reply; 36+ messages in thread
From: Pattan, Reshma @ 2019-05-02 13:35 UTC (permalink / raw)
  To: David Marchand, Richardson, Bruce; +Cc: dev



From: David Marchand [mailto:david.marchand@redhat.com]
Sent: Thursday, May 2, 2019 2:31 PM
To: Richardson, Bruce <bruce.richardson@intel.com>
Cc: Pattan, Reshma <reshma.pattan@intel.com>; dev <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30



On Thu, May 2, 2019 at 3:26 PM Bruce Richardson <bruce.richardson@intel.com<mailto:bruce.richardson@intel.com>> wrote:
On Thu, May 02, 2019 at 12:07:17PM +0200, David Marchand wrote:
> On Thu, May 2, 2019 at 11:33 AM Reshma Pattan <reshma.pattan@intel.com<mailto:reshma.pattan@intel.com>>
> wrote:
>
> > gcc 9 on Fedora 30 gives an error
> > "taking address of packed member may result in an
> > unaligned pointer value" warnings.
> >
> > For clang builds this warning is already disabled,
> > so disable "-Waddress-of-packed-member" for gcc builds
> > also.
> >
> > Snippet of build error:
> > ...lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’:
> > ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking address
> > of packed member of ‘struct rte_mem_config’ may result in an unaligned
> > pointer value [-Werror=address-of-packed-member]
> >   768 |  cur_msl = &mcfg->memsegs[msl_idx];
> >       |            ^~~~~~~~~~~~~~~~~~~~~~~
> >
> > Signed-off-by: Reshma Pattan <reshma.pattan@intel.com<mailto:reshma.pattan@intel.com>>
> > ---
> >  mk/toolchain/gcc/rte.vars.mk<http://rte.vars.mk> | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/mk/toolchain/gcc/rte.vars.mk<http://rte.vars.mk> b/mk/toolchain/gcc/rte.vars.mk<http://rte.vars.mk>
> > index d8b99faf6..b852fcfd7 100644
> > --- a/mk/toolchain/gcc/rte.vars.mk<http://rte.vars.mk>
> > +++ b/mk/toolchain/gcc/rte.vars.mk<http://rte.vars.mk>
> > @@ -87,5 +87,8 @@ WERROR_FLAGS += -Wimplicit-fallthrough=2
> >  WERROR_FLAGS += -Wno-format-truncation
> >  endif
> >
> > +# disable packed member unalign warnings
> > +WERROR_FLAGS += -Wno-address-of-packed-member
> > +
> >  export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF
> >  export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS
> > --
> > 2.21.0
> >
> >
> Not the best approach to me...
>
Agreed, but this fix does seem reasonable since we already disable this warning
for clang.

> Let me install a fedora 30 and have a look.
Hopefully you can come up with a better fix, but I think we need something
soon for 19.05, so this patch may be needed as a stop-gap fix.

Hiding this warning, we will never fix the places that could be fixed (and I found some where the packed attribute makes no sense to me).
I'd prefer at least a -Wno-error=address-of-packed-member

Hi,

If below is ok, I will send the patch.

diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk
index b852fcfd7..cfe6f2645 100644
--- a/mk/toolchain/gcc/rte.vars.mk
+++ b/mk/toolchain/gcc/rte.vars.mk
@@ -49,6 +49,8 @@ WERROR_FLAGS += -Wcast-align -Wnested-externs -Wcast-qual
WERROR_FLAGS += -Wformat-nonliteral -Wformat-security
WERROR_FLAGS += -Wundef -Wwrite-strings -Wdeprecated

+WERROR_FLAGS += -Wno-error=address-of-packed-member
+

Thanks,
Reshma


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

* Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30
  2019-05-02 13:35       ` Pattan, Reshma
@ 2019-05-02 13:35         ` Pattan, Reshma
  0 siblings, 0 replies; 36+ messages in thread
From: Pattan, Reshma @ 2019-05-02 13:35 UTC (permalink / raw)
  To: David Marchand, Richardson, Bruce; +Cc: dev



From: David Marchand [mailto:david.marchand@redhat.com]
Sent: Thursday, May 2, 2019 2:31 PM
To: Richardson, Bruce <bruce.richardson@intel.com>
Cc: Pattan, Reshma <reshma.pattan@intel.com>; dev <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30



On Thu, May 2, 2019 at 3:26 PM Bruce Richardson <bruce.richardson@intel.com<mailto:bruce.richardson@intel.com>> wrote:
On Thu, May 02, 2019 at 12:07:17PM +0200, David Marchand wrote:
> On Thu, May 2, 2019 at 11:33 AM Reshma Pattan <reshma.pattan@intel.com<mailto:reshma.pattan@intel.com>>
> wrote:
>
> > gcc 9 on Fedora 30 gives an error
> > "taking address of packed member may result in an
> > unaligned pointer value" warnings.
> >
> > For clang builds this warning is already disabled,
> > so disable "-Waddress-of-packed-member" for gcc builds
> > also.
> >
> > Snippet of build error:
> > ...lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’:
> > ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking address
> > of packed member of ‘struct rte_mem_config’ may result in an unaligned
> > pointer value [-Werror=address-of-packed-member]
> >   768 |  cur_msl = &mcfg->memsegs[msl_idx];
> >       |            ^~~~~~~~~~~~~~~~~~~~~~~
> >
> > Signed-off-by: Reshma Pattan <reshma.pattan@intel.com<mailto:reshma.pattan@intel.com>>
> > ---
> >  mk/toolchain/gcc/rte.vars.mk<http://rte.vars.mk> | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/mk/toolchain/gcc/rte.vars.mk<http://rte.vars.mk> b/mk/toolchain/gcc/rte.vars.mk<http://rte.vars.mk>
> > index d8b99faf6..b852fcfd7 100644
> > --- a/mk/toolchain/gcc/rte.vars.mk<http://rte.vars.mk>
> > +++ b/mk/toolchain/gcc/rte.vars.mk<http://rte.vars.mk>
> > @@ -87,5 +87,8 @@ WERROR_FLAGS += -Wimplicit-fallthrough=2
> >  WERROR_FLAGS += -Wno-format-truncation
> >  endif
> >
> > +# disable packed member unalign warnings
> > +WERROR_FLAGS += -Wno-address-of-packed-member
> > +
> >  export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF
> >  export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS
> > --
> > 2.21.0
> >
> >
> Not the best approach to me...
>
Agreed, but this fix does seem reasonable since we already disable this warning
for clang.

> Let me install a fedora 30 and have a look.
Hopefully you can come up with a better fix, but I think we need something
soon for 19.05, so this patch may be needed as a stop-gap fix.

Hiding this warning, we will never fix the places that could be fixed (and I found some where the packed attribute makes no sense to me).
I'd prefer at least a -Wno-error=address-of-packed-member

Hi,

If below is ok, I will send the patch.

diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk
index b852fcfd7..cfe6f2645 100644
--- a/mk/toolchain/gcc/rte.vars.mk
+++ b/mk/toolchain/gcc/rte.vars.mk
@@ -49,6 +49,8 @@ WERROR_FLAGS += -Wcast-align -Wnested-externs -Wcast-qual
WERROR_FLAGS += -Wformat-nonliteral -Wformat-security
WERROR_FLAGS += -Wundef -Wwrite-strings -Wdeprecated

+WERROR_FLAGS += -Wno-error=address-of-packed-member
+

Thanks,
Reshma


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

* [dpdk-dev] [PATCH v2] mk: report address of packed member as warning
  2019-05-02  9:33 [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30 Reshma Pattan
  2019-05-02  9:33 ` Reshma Pattan
  2019-05-02 10:07 ` David Marchand
@ 2019-05-02 14:13 ` Reshma Pattan
  2019-05-02 14:13   ` Reshma Pattan
                     ` (2 more replies)
  2019-05-02 15:00 ` [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30 David Marchand
  3 siblings, 3 replies; 36+ messages in thread
From: Reshma Pattan @ 2019-05-02 14:13 UTC (permalink / raw)
  To: dev; +Cc: david.marchand, bruce.richardson, Reshma Pattan

gcc 9 on Fedora 30 gives an error
"taking address of packed member may result in an
unaligned pointer value" for -Waddress-of-packed-member.

Report it as warning instead of error to fix the build.

Snippet of build before fix
...lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’:
...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking address
of packed member of ‘struct rte_mem_config’ may result in an unaligned
pointer value [-Werror=address-of-packed-member]
  768 |  cur_msl = &mcfg->memsegs[msl_idx];
      |            ^~~~~~~~~~~~~~~~~~~~~~~

Snippet of build after fix
..lib/librte_eal/linux/eal/eal_memory.c: In function ‘remap_segment’:
..lib/librte_eal/linux/eal/eal_memory.c:685:9: warning: taking address
of packed member of ‘struct rte_mem_config’ may result in an unaligned
pointer value [-Waddress-of-packed-member]
  685 |   msl = &mcfg->memsegs[msl_idx];

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
---
 mk/toolchain/gcc/rte.vars.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk
index d8b99faf6..61032bbbc 100644
--- a/mk/toolchain/gcc/rte.vars.mk
+++ b/mk/toolchain/gcc/rte.vars.mk
@@ -87,5 +87,9 @@ WERROR_FLAGS += -Wimplicit-fallthrough=2
 WERROR_FLAGS += -Wno-format-truncation
 endif
 
+#Report "taking address of packed member may result
+#in an unaligned pointer value" issues as warnings.
+WERROR_FLAGS += -Wno-error=address-of-packed-member
+
 export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF
 export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS
-- 
2.21.0

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

* [dpdk-dev] [PATCH v2] mk: report address of packed member as warning
  2019-05-02 14:13 ` [dpdk-dev] [PATCH v2] mk: report address of packed member as warning Reshma Pattan
@ 2019-05-02 14:13   ` Reshma Pattan
  2019-05-02 14:24   ` David Marchand
  2019-05-02 15:53   ` Burakov, Anatoly
  2 siblings, 0 replies; 36+ messages in thread
From: Reshma Pattan @ 2019-05-02 14:13 UTC (permalink / raw)
  To: dev; +Cc: david.marchand, bruce.richardson, Reshma Pattan

gcc 9 on Fedora 30 gives an error
"taking address of packed member may result in an
unaligned pointer value" for -Waddress-of-packed-member.

Report it as warning instead of error to fix the build.

Snippet of build before fix
...lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’:
...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking address
of packed member of ‘struct rte_mem_config’ may result in an unaligned
pointer value [-Werror=address-of-packed-member]
  768 |  cur_msl = &mcfg->memsegs[msl_idx];
      |            ^~~~~~~~~~~~~~~~~~~~~~~

Snippet of build after fix
..lib/librte_eal/linux/eal/eal_memory.c: In function ‘remap_segment’:
..lib/librte_eal/linux/eal/eal_memory.c:685:9: warning: taking address
of packed member of ‘struct rte_mem_config’ may result in an unaligned
pointer value [-Waddress-of-packed-member]
  685 |   msl = &mcfg->memsegs[msl_idx];

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
---
 mk/toolchain/gcc/rte.vars.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk
index d8b99faf6..61032bbbc 100644
--- a/mk/toolchain/gcc/rte.vars.mk
+++ b/mk/toolchain/gcc/rte.vars.mk
@@ -87,5 +87,9 @@ WERROR_FLAGS += -Wimplicit-fallthrough=2
 WERROR_FLAGS += -Wno-format-truncation
 endif
 
+#Report "taking address of packed member may result
+#in an unaligned pointer value" issues as warnings.
+WERROR_FLAGS += -Wno-error=address-of-packed-member
+
 export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF
 export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS
-- 
2.21.0


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

* Re: [dpdk-dev] [PATCH v2] mk: report address of packed member as warning
  2019-05-02 14:13 ` [dpdk-dev] [PATCH v2] mk: report address of packed member as warning Reshma Pattan
  2019-05-02 14:13   ` Reshma Pattan
@ 2019-05-02 14:24   ` David Marchand
  2019-05-02 14:24     ` David Marchand
  2019-05-02 14:41     ` Bruce Richardson
  2019-05-02 15:53   ` Burakov, Anatoly
  2 siblings, 2 replies; 36+ messages in thread
From: David Marchand @ 2019-05-02 14:24 UTC (permalink / raw)
  To: Reshma Pattan; +Cc: dev, Bruce Richardson

On Thu, May 2, 2019 at 4:13 PM Reshma Pattan <reshma.pattan@intel.com>
wrote:

> gcc 9 on Fedora 30 gives an error
> "taking address of packed member may result in an
> unaligned pointer value" for -Waddress-of-packed-member.
>
> Report it as warning instead of error to fix the build.
>
> Snippet of build before fix
> ...lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’:
> ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking address
> of packed member of ‘struct rte_mem_config’ may result in an unaligned
> pointer value [-Werror=address-of-packed-member]
>   768 |  cur_msl = &mcfg->memsegs[msl_idx];
>       |            ^~~~~~~~~~~~~~~~~~~~~~~
>
> Snippet of build after fix
> ..lib/librte_eal/linux/eal/eal_memory.c: In function ‘remap_segment’:
> ..lib/librte_eal/linux/eal/eal_memory.c:685:9: warning: taking address
> of packed member of ‘struct rte_mem_config’ may result in an unaligned
> pointer value [-Waddress-of-packed-member]
>   685 |   msl = &mcfg->memsegs[msl_idx];
>
> Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
> ---
>  mk/toolchain/gcc/rte.vars.mk | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk
> index d8b99faf6..61032bbbc 100644
> --- a/mk/toolchain/gcc/rte.vars.mk
> +++ b/mk/toolchain/gcc/rte.vars.mk
> @@ -87,5 +87,9 @@ WERROR_FLAGS += -Wimplicit-fallthrough=2
>  WERROR_FLAGS += -Wno-format-truncation
>  endif
>
> +#Report "taking address of packed member may result
> +#in an unaligned pointer value" issues as warnings.
> +WERROR_FLAGS += -Wno-error=address-of-packed-member
> +
>  export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF
>  export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS
> --
> 2.21.0
>
>
No, you can't do this unconditionally.

Looked at clang (in make build system) and meson (globally) and those
completely disable the warning.
$ git grep address-of-packed-member origin/master --
origin/master:config/meson.build:       '-Wno-address-of-packed-member'
origin/master:mk/toolchain/clang/rte.vars.mk:WERROR_FLAGS +=
-Wno-address-of-packed-member

It should be something like (untested):

@@ -87,5 +87,10 @@ WERROR_FLAGS += -Wimplicit-fallthrough=2
 WERROR_FLAGS += -Wno-format-truncation
 endif

+# disable packed member unalign warnings
+ifeq ($(shell test $(GCC_VERSION) -ge 90 && echo 1), 1)
+WERROR_FLAGS += -Wno-address-of-packed-member
+endif
+
 export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF
 export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS


-- 
David Marchand

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

* Re: [dpdk-dev] [PATCH v2] mk: report address of packed member as warning
  2019-05-02 14:24   ` David Marchand
@ 2019-05-02 14:24     ` David Marchand
  2019-05-02 14:41     ` Bruce Richardson
  1 sibling, 0 replies; 36+ messages in thread
From: David Marchand @ 2019-05-02 14:24 UTC (permalink / raw)
  To: Reshma Pattan; +Cc: dev, Bruce Richardson

On Thu, May 2, 2019 at 4:13 PM Reshma Pattan <reshma.pattan@intel.com>
wrote:

> gcc 9 on Fedora 30 gives an error
> "taking address of packed member may result in an
> unaligned pointer value" for -Waddress-of-packed-member.
>
> Report it as warning instead of error to fix the build.
>
> Snippet of build before fix
> ...lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’:
> ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking address
> of packed member of ‘struct rte_mem_config’ may result in an unaligned
> pointer value [-Werror=address-of-packed-member]
>   768 |  cur_msl = &mcfg->memsegs[msl_idx];
>       |            ^~~~~~~~~~~~~~~~~~~~~~~
>
> Snippet of build after fix
> ..lib/librte_eal/linux/eal/eal_memory.c: In function ‘remap_segment’:
> ..lib/librte_eal/linux/eal/eal_memory.c:685:9: warning: taking address
> of packed member of ‘struct rte_mem_config’ may result in an unaligned
> pointer value [-Waddress-of-packed-member]
>   685 |   msl = &mcfg->memsegs[msl_idx];
>
> Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
> ---
>  mk/toolchain/gcc/rte.vars.mk | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk
> index d8b99faf6..61032bbbc 100644
> --- a/mk/toolchain/gcc/rte.vars.mk
> +++ b/mk/toolchain/gcc/rte.vars.mk
> @@ -87,5 +87,9 @@ WERROR_FLAGS += -Wimplicit-fallthrough=2
>  WERROR_FLAGS += -Wno-format-truncation
>  endif
>
> +#Report "taking address of packed member may result
> +#in an unaligned pointer value" issues as warnings.
> +WERROR_FLAGS += -Wno-error=address-of-packed-member
> +
>  export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF
>  export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS
> --
> 2.21.0
>
>
No, you can't do this unconditionally.

Looked at clang (in make build system) and meson (globally) and those
completely disable the warning.
$ git grep address-of-packed-member origin/master --
origin/master:config/meson.build:       '-Wno-address-of-packed-member'
origin/master:mk/toolchain/clang/rte.vars.mk:WERROR_FLAGS +=
-Wno-address-of-packed-member

It should be something like (untested):

@@ -87,5 +87,10 @@ WERROR_FLAGS += -Wimplicit-fallthrough=2
 WERROR_FLAGS += -Wno-format-truncation
 endif

+# disable packed member unalign warnings
+ifeq ($(shell test $(GCC_VERSION) -ge 90 && echo 1), 1)
+WERROR_FLAGS += -Wno-address-of-packed-member
+endif
+
 export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF
 export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS


-- 
David Marchand

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

* Re: [dpdk-dev] [PATCH v2] mk: report address of packed member as warning
  2019-05-02 14:24   ` David Marchand
  2019-05-02 14:24     ` David Marchand
@ 2019-05-02 14:41     ` Bruce Richardson
  2019-05-02 14:41       ` Bruce Richardson
  2019-05-02 14:48       ` David Marchand
  1 sibling, 2 replies; 36+ messages in thread
From: Bruce Richardson @ 2019-05-02 14:41 UTC (permalink / raw)
  To: David Marchand; +Cc: Reshma Pattan, dev

On Thu, May 02, 2019 at 04:24:37PM +0200, David Marchand wrote:
>    On Thu, May 2, 2019 at 4:13 PM Reshma Pattan
>    <[1]reshma.pattan@intel.com> wrote:
> 
>      gcc 9 on Fedora 30 gives an error
>      "taking address of packed member may result in an
>      unaligned pointer value" for -Waddress-of-packed-member.
>      Report it as warning instead of error to fix the build.
>      Snippet of build before fix
>      ...lib/librte_eal/linux/eal/eal_memalloc.c: In function
>      ‘alloc_seg_walk’:
>      ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking
>      address
>      of packed member of ‘struct rte_mem_config’ may result in an
>      unaligned
>      pointer value [-Werror=address-of-packed-member]
>        768 |  cur_msl = &mcfg->memsegs[msl_idx];
>            |            ^~~~~~~~~~~~~~~~~~~~~~~
>      Snippet of build after fix
>      ..lib/librte_eal/linux/eal/eal_memory.c: In function
>      ‘remap_segment’:
>      ..lib/librte_eal/linux/eal/eal_memory.c:685:9: warning: taking
>      address
>      of packed member of ‘struct rte_mem_config’ may result in an
>      unaligned
>      pointer value [-Waddress-of-packed-member]
>        685 |   msl = &mcfg->memsegs[msl_idx];
>      Signed-off-by: Reshma Pattan <[2]reshma.pattan@intel.com>
>      ---
>       mk/toolchain/gcc/[3]rte.vars.mk | 4 ++++
>       1 file changed, 4 insertions(+)
>      diff --git a/mk/toolchain/gcc/[4]rte.vars.mk
>      b/mk/toolchain/gcc/[5]rte.vars.mk
>      index d8b99faf6..61032bbbc 100644
>      --- a/mk/toolchain/gcc/[6]rte.vars.mk
>      +++ b/mk/toolchain/gcc/[7]rte.vars.mk
>      @@ -87,5 +87,9 @@ WERROR_FLAGS += -Wimplicit-fallthrough=2
>       WERROR_FLAGS += -Wno-format-truncation
>       endif
>      +#Report "taking address of packed member may result
>      +#in an unaligned pointer value" issues as warnings.
>      +WERROR_FLAGS += -Wno-error=address-of-packed-member
>      +
>       export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF
>       export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS
>      --
>      2.21.0
> 
>    No, you can't do this unconditionally.
>    Looked at clang (in make build system) and meson (globally) and those
>    completely disable the warning.
>    $ git grep address-of-packed-member origin/master --
>    origin/master:config/meson.build:       '-Wno-address-of-packed-member'
>    origin/master:mk/toolchain/clang/rte.vars.mk:WERROR_FLAGS +=
>    -Wno-address-of-packed-member
>    It should be something like (untested):
>    @@ -87,5 +87,10 @@ WERROR_FLAGS += -Wimplicit-fallthrough=2
>     WERROR_FLAGS += -Wno-format-truncation
>     endif
> 
>    +# disable packed member unalign warnings
>    +ifeq ($(shell test $(GCC_VERSION) -ge 90 && echo 1), 1)
>    +WERROR_FLAGS += -Wno-address-of-packed-member
>    +endif
>    +
Actually, you should not need to check the GCC version for this.
GCC always ignores silently any warning disable flags it doesn't recognise,
only printing information about them if there is another error to report.
[This is why meson, when you ask it if the compiler supports "-Wno-foo", will
check the flag and also the -Wfoo flag, as gcc won't report an error with
just the "no" form]

/Bruce

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

* Re: [dpdk-dev] [PATCH v2] mk: report address of packed member as warning
  2019-05-02 14:41     ` Bruce Richardson
@ 2019-05-02 14:41       ` Bruce Richardson
  2019-05-02 14:48       ` David Marchand
  1 sibling, 0 replies; 36+ messages in thread
From: Bruce Richardson @ 2019-05-02 14:41 UTC (permalink / raw)
  To: David Marchand; +Cc: Reshma Pattan, dev

On Thu, May 02, 2019 at 04:24:37PM +0200, David Marchand wrote:
>    On Thu, May 2, 2019 at 4:13 PM Reshma Pattan
>    <[1]reshma.pattan@intel.com> wrote:
> 
>      gcc 9 on Fedora 30 gives an error
>      "taking address of packed member may result in an
>      unaligned pointer value" for -Waddress-of-packed-member.
>      Report it as warning instead of error to fix the build.
>      Snippet of build before fix
>      ...lib/librte_eal/linux/eal/eal_memalloc.c: In function
>      ‘alloc_seg_walk’:
>      ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking
>      address
>      of packed member of ‘struct rte_mem_config’ may result in an
>      unaligned
>      pointer value [-Werror=address-of-packed-member]
>        768 |  cur_msl = &mcfg->memsegs[msl_idx];
>            |            ^~~~~~~~~~~~~~~~~~~~~~~
>      Snippet of build after fix
>      ..lib/librte_eal/linux/eal/eal_memory.c: In function
>      ‘remap_segment’:
>      ..lib/librte_eal/linux/eal/eal_memory.c:685:9: warning: taking
>      address
>      of packed member of ‘struct rte_mem_config’ may result in an
>      unaligned
>      pointer value [-Waddress-of-packed-member]
>        685 |   msl = &mcfg->memsegs[msl_idx];
>      Signed-off-by: Reshma Pattan <[2]reshma.pattan@intel.com>
>      ---
>       mk/toolchain/gcc/[3]rte.vars.mk | 4 ++++
>       1 file changed, 4 insertions(+)
>      diff --git a/mk/toolchain/gcc/[4]rte.vars.mk
>      b/mk/toolchain/gcc/[5]rte.vars.mk
>      index d8b99faf6..61032bbbc 100644
>      --- a/mk/toolchain/gcc/[6]rte.vars.mk
>      +++ b/mk/toolchain/gcc/[7]rte.vars.mk
>      @@ -87,5 +87,9 @@ WERROR_FLAGS += -Wimplicit-fallthrough=2
>       WERROR_FLAGS += -Wno-format-truncation
>       endif
>      +#Report "taking address of packed member may result
>      +#in an unaligned pointer value" issues as warnings.
>      +WERROR_FLAGS += -Wno-error=address-of-packed-member
>      +
>       export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF
>       export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS
>      --
>      2.21.0
> 
>    No, you can't do this unconditionally.
>    Looked at clang (in make build system) and meson (globally) and those
>    completely disable the warning.
>    $ git grep address-of-packed-member origin/master --
>    origin/master:config/meson.build:       '-Wno-address-of-packed-member'
>    origin/master:mk/toolchain/clang/rte.vars.mk:WERROR_FLAGS +=
>    -Wno-address-of-packed-member
>    It should be something like (untested):
>    @@ -87,5 +87,10 @@ WERROR_FLAGS += -Wimplicit-fallthrough=2
>     WERROR_FLAGS += -Wno-format-truncation
>     endif
> 
>    +# disable packed member unalign warnings
>    +ifeq ($(shell test $(GCC_VERSION) -ge 90 && echo 1), 1)
>    +WERROR_FLAGS += -Wno-address-of-packed-member
>    +endif
>    +
Actually, you should not need to check the GCC version for this.
GCC always ignores silently any warning disable flags it doesn't recognise,
only printing information about them if there is another error to report.
[This is why meson, when you ask it if the compiler supports "-Wno-foo", will
check the flag and also the -Wfoo flag, as gcc won't report an error with
just the "no" form]

/Bruce

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

* Re: [dpdk-dev] [PATCH v2] mk: report address of packed member as warning
  2019-05-02 14:41     ` Bruce Richardson
  2019-05-02 14:41       ` Bruce Richardson
@ 2019-05-02 14:48       ` David Marchand
  2019-05-02 14:48         ` David Marchand
  1 sibling, 1 reply; 36+ messages in thread
From: David Marchand @ 2019-05-02 14:48 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Reshma Pattan, dev

On Thu, May 2, 2019 at 4:42 PM Bruce Richardson <bruce.richardson@intel.com>
wrote:

> On Thu, May 02, 2019 at 04:24:37PM +0200, David Marchand wrote:
> >    On Thu, May 2, 2019 at 4:13 PM Reshma Pattan
> >    <[1]reshma.pattan@intel.com> wrote:
> >
> >      gcc 9 on Fedora 30 gives an error
> >      "taking address of packed member may result in an
> >      unaligned pointer value" for -Waddress-of-packed-member.
> >      Report it as warning instead of error to fix the build.
> >      Snippet of build before fix
> >      ...lib/librte_eal/linux/eal/eal_memalloc.c: In function
> >      ‘alloc_seg_walk’:
> >      ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking
> >      address
> >      of packed member of ‘struct rte_mem_config’ may result in an
> >      unaligned
> >      pointer value [-Werror=address-of-packed-member]
> >        768 |  cur_msl = &mcfg->memsegs[msl_idx];
> >            |            ^~~~~~~~~~~~~~~~~~~~~~~
> >      Snippet of build after fix
> >      ..lib/librte_eal/linux/eal/eal_memory.c: In function
> >      ‘remap_segment’:
> >      ..lib/librte_eal/linux/eal/eal_memory.c:685:9: warning: taking
> >      address
> >      of packed member of ‘struct rte_mem_config’ may result in an
> >      unaligned
> >      pointer value [-Waddress-of-packed-member]
> >        685 |   msl = &mcfg->memsegs[msl_idx];
> >      Signed-off-by: Reshma Pattan <[2]reshma.pattan@intel.com>
> >      ---
> >       mk/toolchain/gcc/[3]rte.vars.mk | 4 ++++
> >       1 file changed, 4 insertions(+)
> >      diff --git a/mk/toolchain/gcc/[4]rte.vars.mk
> >      b/mk/toolchain/gcc/[5]rte.vars.mk
> >      index d8b99faf6..61032bbbc 100644
> >      --- a/mk/toolchain/gcc/[6]rte.vars.mk
> >      +++ b/mk/toolchain/gcc/[7]rte.vars.mk
> >      @@ -87,5 +87,9 @@ WERROR_FLAGS += -Wimplicit-fallthrough=2
> >       WERROR_FLAGS += -Wno-format-truncation
> >       endif
> >      +#Report "taking address of packed member may result
> >      +#in an unaligned pointer value" issues as warnings.
> >      +WERROR_FLAGS += -Wno-error=address-of-packed-member
> >      +
> >       export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF
> >       export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS
> >      --
> >      2.21.0
> >
> >    No, you can't do this unconditionally.
> >    Looked at clang (in make build system) and meson (globally) and those
> >    completely disable the warning.
> >    $ git grep address-of-packed-member origin/master --
> >    origin/master:config/meson.build:
>  '-Wno-address-of-packed-member'
> >    origin/master:mk/toolchain/clang/rte.vars.mk:WERROR_FLAGS +=
> >    -Wno-address-of-packed-member
> >    It should be something like (untested):
> >    @@ -87,5 +87,10 @@ WERROR_FLAGS += -Wimplicit-fallthrough=2
> >     WERROR_FLAGS += -Wno-format-truncation
> >     endif
> >
> >    +# disable packed member unalign warnings
> >    +ifeq ($(shell test $(GCC_VERSION) -ge 90 && echo 1), 1)
> >    +WERROR_FLAGS += -Wno-address-of-packed-member
> >    +endif
> >    +
> Actually, you should not need to check the GCC version for this.
> GCC always ignores silently any warning disable flags it doesn't recognise,
> only printing information about them if there is another error to report.
> [This is why meson, when you ask it if the compiler supports "-Wno-foo",
> will
> check the flag and also the -Wfoo flag, as gcc won't report an error with
> just the "no" form]
>

WERROR_FLAGS += -Wno-error=address-of-packed-member triggers an error.

[dmarchan@dmarchan dpdk]$ make EXTRA_CFLAGS="-g -O0" O=master
cc1: error: -Werror=address-of-packed-member: no option
-Waddress-of-packed-member
== Build lib
cc1: error: -Werror=address-of-packed-member: no option
-Waddress-of-packed-member
== Build lib/librte_kvargs
cc1: error: -Werror=address-of-packed-member: no option
-Waddress-of-packed-member
  CC rte_kvargs.o
cc1: error: -Werror=address-of-packed-member: no option
-Waddress-of-packed-member
make[3]: *** [rte_kvargs.o] Error 1
make[2]: *** [librte_kvargs] Error 2
make[1]: *** [lib] Error 2
make: *** [all] Error 2


WERROR_FLAGS += -Wno-address-of-packed-member is ignored.

Marvellous :-)
Sorry for the noise, let's go with your initial patch.

-- 
David Marchand

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

* Re: [dpdk-dev] [PATCH v2] mk: report address of packed member as warning
  2019-05-02 14:48       ` David Marchand
@ 2019-05-02 14:48         ` David Marchand
  0 siblings, 0 replies; 36+ messages in thread
From: David Marchand @ 2019-05-02 14:48 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Reshma Pattan, dev

On Thu, May 2, 2019 at 4:42 PM Bruce Richardson <bruce.richardson@intel.com>
wrote:

> On Thu, May 02, 2019 at 04:24:37PM +0200, David Marchand wrote:
> >    On Thu, May 2, 2019 at 4:13 PM Reshma Pattan
> >    <[1]reshma.pattan@intel.com> wrote:
> >
> >      gcc 9 on Fedora 30 gives an error
> >      "taking address of packed member may result in an
> >      unaligned pointer value" for -Waddress-of-packed-member.
> >      Report it as warning instead of error to fix the build.
> >      Snippet of build before fix
> >      ...lib/librte_eal/linux/eal/eal_memalloc.c: In function
> >      ‘alloc_seg_walk’:
> >      ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking
> >      address
> >      of packed member of ‘struct rte_mem_config’ may result in an
> >      unaligned
> >      pointer value [-Werror=address-of-packed-member]
> >        768 |  cur_msl = &mcfg->memsegs[msl_idx];
> >            |            ^~~~~~~~~~~~~~~~~~~~~~~
> >      Snippet of build after fix
> >      ..lib/librte_eal/linux/eal/eal_memory.c: In function
> >      ‘remap_segment’:
> >      ..lib/librte_eal/linux/eal/eal_memory.c:685:9: warning: taking
> >      address
> >      of packed member of ‘struct rte_mem_config’ may result in an
> >      unaligned
> >      pointer value [-Waddress-of-packed-member]
> >        685 |   msl = &mcfg->memsegs[msl_idx];
> >      Signed-off-by: Reshma Pattan <[2]reshma.pattan@intel.com>
> >      ---
> >       mk/toolchain/gcc/[3]rte.vars.mk | 4 ++++
> >       1 file changed, 4 insertions(+)
> >      diff --git a/mk/toolchain/gcc/[4]rte.vars.mk
> >      b/mk/toolchain/gcc/[5]rte.vars.mk
> >      index d8b99faf6..61032bbbc 100644
> >      --- a/mk/toolchain/gcc/[6]rte.vars.mk
> >      +++ b/mk/toolchain/gcc/[7]rte.vars.mk
> >      @@ -87,5 +87,9 @@ WERROR_FLAGS += -Wimplicit-fallthrough=2
> >       WERROR_FLAGS += -Wno-format-truncation
> >       endif
> >      +#Report "taking address of packed member may result
> >      +#in an unaligned pointer value" issues as warnings.
> >      +WERROR_FLAGS += -Wno-error=address-of-packed-member
> >      +
> >       export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF
> >       export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS
> >      --
> >      2.21.0
> >
> >    No, you can't do this unconditionally.
> >    Looked at clang (in make build system) and meson (globally) and those
> >    completely disable the warning.
> >    $ git grep address-of-packed-member origin/master --
> >    origin/master:config/meson.build:
>  '-Wno-address-of-packed-member'
> >    origin/master:mk/toolchain/clang/rte.vars.mk:WERROR_FLAGS +=
> >    -Wno-address-of-packed-member
> >    It should be something like (untested):
> >    @@ -87,5 +87,10 @@ WERROR_FLAGS += -Wimplicit-fallthrough=2
> >     WERROR_FLAGS += -Wno-format-truncation
> >     endif
> >
> >    +# disable packed member unalign warnings
> >    +ifeq ($(shell test $(GCC_VERSION) -ge 90 && echo 1), 1)
> >    +WERROR_FLAGS += -Wno-address-of-packed-member
> >    +endif
> >    +
> Actually, you should not need to check the GCC version for this.
> GCC always ignores silently any warning disable flags it doesn't recognise,
> only printing information about them if there is another error to report.
> [This is why meson, when you ask it if the compiler supports "-Wno-foo",
> will
> check the flag and also the -Wfoo flag, as gcc won't report an error with
> just the "no" form]
>

WERROR_FLAGS += -Wno-error=address-of-packed-member triggers an error.

[dmarchan@dmarchan dpdk]$ make EXTRA_CFLAGS="-g -O0" O=master
cc1: error: -Werror=address-of-packed-member: no option
-Waddress-of-packed-member
== Build lib
cc1: error: -Werror=address-of-packed-member: no option
-Waddress-of-packed-member
== Build lib/librte_kvargs
cc1: error: -Werror=address-of-packed-member: no option
-Waddress-of-packed-member
  CC rte_kvargs.o
cc1: error: -Werror=address-of-packed-member: no option
-Waddress-of-packed-member
make[3]: *** [rte_kvargs.o] Error 1
make[2]: *** [librte_kvargs] Error 2
make[1]: *** [lib] Error 2
make: *** [all] Error 2


WERROR_FLAGS += -Wno-address-of-packed-member is ignored.

Marvellous :-)
Sorry for the noise, let's go with your initial patch.

-- 
David Marchand

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

* Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30
  2019-05-02  9:33 [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30 Reshma Pattan
                   ` (2 preceding siblings ...)
  2019-05-02 14:13 ` [dpdk-dev] [PATCH v2] mk: report address of packed member as warning Reshma Pattan
@ 2019-05-02 15:00 ` David Marchand
  2019-05-02 15:00   ` David Marchand
  2019-05-02 15:56   ` Thomas Monjalon
  3 siblings, 2 replies; 36+ messages in thread
From: David Marchand @ 2019-05-02 15:00 UTC (permalink / raw)
  To: Reshma Pattan; +Cc: dev

On Thu, May 2, 2019 at 11:33 AM Reshma Pattan <reshma.pattan@intel.com>
wrote:

> gcc 9 on Fedora 30 gives an error
> "taking address of packed member may result in an
> unaligned pointer value" warnings.
>
> For clang builds this warning is already disabled,
> so disable "-Waddress-of-packed-member" for gcc builds
> also.
>
> Snippet of build error:
> ...lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’:
> ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking address
> of packed member of ‘struct rte_mem_config’ may result in an unaligned
> pointer value [-Werror=address-of-packed-member]
>   768 |  cur_msl = &mcfg->memsegs[msl_idx];
>       |            ^~~~~~~~~~~~~~~~~~~~~~~
>
> Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
> ---
>  mk/toolchain/gcc/rte.vars.mk | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk
> index d8b99faf6..b852fcfd7 100644
> --- a/mk/toolchain/gcc/rte.vars.mk
> +++ b/mk/toolchain/gcc/rte.vars.mk
> @@ -87,5 +87,8 @@ WERROR_FLAGS += -Wimplicit-fallthrough=2
>  WERROR_FLAGS += -Wno-format-truncation
>  endif
>
> +# disable packed member unalign warnings
> +WERROR_FLAGS += -Wno-address-of-packed-member
> +
>  export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF
>  export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS
> --
> 2.21.0
>
>
Tested on rhel-7 and fedora-30.
Tested-by: David Marchand <david.marchand@redhat.com>


-- 
David Marchand

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

* Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30
  2019-05-02 15:00 ` [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30 David Marchand
@ 2019-05-02 15:00   ` David Marchand
  2019-05-02 15:56   ` Thomas Monjalon
  1 sibling, 0 replies; 36+ messages in thread
From: David Marchand @ 2019-05-02 15:00 UTC (permalink / raw)
  To: Reshma Pattan; +Cc: dev

On Thu, May 2, 2019 at 11:33 AM Reshma Pattan <reshma.pattan@intel.com>
wrote:

> gcc 9 on Fedora 30 gives an error
> "taking address of packed member may result in an
> unaligned pointer value" warnings.
>
> For clang builds this warning is already disabled,
> so disable "-Waddress-of-packed-member" for gcc builds
> also.
>
> Snippet of build error:
> ...lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’:
> ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking address
> of packed member of ‘struct rte_mem_config’ may result in an unaligned
> pointer value [-Werror=address-of-packed-member]
>   768 |  cur_msl = &mcfg->memsegs[msl_idx];
>       |            ^~~~~~~~~~~~~~~~~~~~~~~
>
> Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
> ---
>  mk/toolchain/gcc/rte.vars.mk | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk
> index d8b99faf6..b852fcfd7 100644
> --- a/mk/toolchain/gcc/rte.vars.mk
> +++ b/mk/toolchain/gcc/rte.vars.mk
> @@ -87,5 +87,8 @@ WERROR_FLAGS += -Wimplicit-fallthrough=2
>  WERROR_FLAGS += -Wno-format-truncation
>  endif
>
> +# disable packed member unalign warnings
> +WERROR_FLAGS += -Wno-address-of-packed-member
> +
>  export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF
>  export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS
> --
> 2.21.0
>
>
Tested on rhel-7 and fedora-30.
Tested-by: David Marchand <david.marchand@redhat.com>


-- 
David Marchand

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

* Re: [dpdk-dev] [PATCH v2] mk: report address of packed member as warning
  2019-05-02 14:13 ` [dpdk-dev] [PATCH v2] mk: report address of packed member as warning Reshma Pattan
  2019-05-02 14:13   ` Reshma Pattan
  2019-05-02 14:24   ` David Marchand
@ 2019-05-02 15:53   ` Burakov, Anatoly
  2019-05-02 15:53     ` Burakov, Anatoly
  2019-05-02 18:54     ` Stephen Hemminger
  2 siblings, 2 replies; 36+ messages in thread
From: Burakov, Anatoly @ 2019-05-02 15:53 UTC (permalink / raw)
  To: Reshma Pattan, dev; +Cc: david.marchand, bruce.richardson

On 02-May-19 3:13 PM, Reshma Pattan wrote:
> gcc 9 on Fedora 30 gives an error
> "taking address of packed member may result in an
> unaligned pointer value" for -Waddress-of-packed-member.
> 
> Report it as warning instead of error to fix the build.
> 
> Snippet of build before fix
> ...lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’:
> ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking address
> of packed member of ‘struct rte_mem_config’ may result in an unaligned
> pointer value [-Werror=address-of-packed-member]
>    768 |  cur_msl = &mcfg->memsegs[msl_idx];
>        |            ^~~~~~~~~~~~~~~~~~~~~~~
> 
> Snippet of build after fix
> ..lib/librte_eal/linux/eal/eal_memory.c: In function ‘remap_segment’:
> ..lib/librte_eal/linux/eal/eal_memory.c:685:9: warning: taking address
> of packed member of ‘struct rte_mem_config’ may result in an unaligned
> pointer value [-Waddress-of-packed-member]
>    685 |   msl = &mcfg->memsegs[msl_idx];
> 

Fixing these would require an ABI break, because these are exposed 
externally. Should we submit a deprecation notice for EAL?


-- 
Thanks,
Anatoly

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

* Re: [dpdk-dev] [PATCH v2] mk: report address of packed member as warning
  2019-05-02 15:53   ` Burakov, Anatoly
@ 2019-05-02 15:53     ` Burakov, Anatoly
  2019-05-02 18:54     ` Stephen Hemminger
  1 sibling, 0 replies; 36+ messages in thread
From: Burakov, Anatoly @ 2019-05-02 15:53 UTC (permalink / raw)
  To: Reshma Pattan, dev; +Cc: david.marchand, bruce.richardson

On 02-May-19 3:13 PM, Reshma Pattan wrote:
> gcc 9 on Fedora 30 gives an error
> "taking address of packed member may result in an
> unaligned pointer value" for -Waddress-of-packed-member.
> 
> Report it as warning instead of error to fix the build.
> 
> Snippet of build before fix
> ...lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’:
> ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking address
> of packed member of ‘struct rte_mem_config’ may result in an unaligned
> pointer value [-Werror=address-of-packed-member]
>    768 |  cur_msl = &mcfg->memsegs[msl_idx];
>        |            ^~~~~~~~~~~~~~~~~~~~~~~
> 
> Snippet of build after fix
> ..lib/librte_eal/linux/eal/eal_memory.c: In function ‘remap_segment’:
> ..lib/librte_eal/linux/eal/eal_memory.c:685:9: warning: taking address
> of packed member of ‘struct rte_mem_config’ may result in an unaligned
> pointer value [-Waddress-of-packed-member]
>    685 |   msl = &mcfg->memsegs[msl_idx];
> 

Fixing these would require an ABI break, because these are exposed 
externally. Should we submit a deprecation notice for EAL?


-- 
Thanks,
Anatoly

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

* Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30
  2019-05-02 15:00 ` [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30 David Marchand
  2019-05-02 15:00   ` David Marchand
@ 2019-05-02 15:56   ` Thomas Monjalon
  2019-05-02 15:56     ` Thomas Monjalon
  2019-05-03 16:01     ` Jerin Jacob Kollanukkaran
  1 sibling, 2 replies; 36+ messages in thread
From: Thomas Monjalon @ 2019-05-02 15:56 UTC (permalink / raw)
  To: Reshma Pattan; +Cc: dev, David Marchand

02/05/2019 17:00, David Marchand:
> On Thu, May 2, 2019 at 11:33 AM Reshma Pattan <reshma.pattan@intel.com>
> wrote:
> 
> > gcc 9 on Fedora 30 gives an error
> > "taking address of packed member may result in an
> > unaligned pointer value" warnings.
> >
> > For clang builds this warning is already disabled,
> > so disable "-Waddress-of-packed-member" for gcc builds
> > also.
> >
> > Snippet of build error:
> > ...lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’:
> > ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking address
> > of packed member of ‘struct rte_mem_config’ may result in an unaligned
> > pointer value [-Werror=address-of-packed-member]
> >   768 |  cur_msl = &mcfg->memsegs[msl_idx];
> >       |            ^~~~~~~~~~~~~~~~~~~~~~~
> >
> > Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
> >
> >
> Tested on rhel-7 and fedora-30.
> Tested-by: David Marchand <david.marchand@redhat.com>

Applied, thanks

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

* Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30
  2019-05-02 15:56   ` Thomas Monjalon
@ 2019-05-02 15:56     ` Thomas Monjalon
  2019-05-03 16:01     ` Jerin Jacob Kollanukkaran
  1 sibling, 0 replies; 36+ messages in thread
From: Thomas Monjalon @ 2019-05-02 15:56 UTC (permalink / raw)
  To: Reshma Pattan; +Cc: dev, David Marchand

02/05/2019 17:00, David Marchand:
> On Thu, May 2, 2019 at 11:33 AM Reshma Pattan <reshma.pattan@intel.com>
> wrote:
> 
> > gcc 9 on Fedora 30 gives an error
> > "taking address of packed member may result in an
> > unaligned pointer value" warnings.
> >
> > For clang builds this warning is already disabled,
> > so disable "-Waddress-of-packed-member" for gcc builds
> > also.
> >
> > Snippet of build error:
> > ...lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’:
> > ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking address
> > of packed member of ‘struct rte_mem_config’ may result in an unaligned
> > pointer value [-Werror=address-of-packed-member]
> >   768 |  cur_msl = &mcfg->memsegs[msl_idx];
> >       |            ^~~~~~~~~~~~~~~~~~~~~~~
> >
> > Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
> >
> >
> Tested on rhel-7 and fedora-30.
> Tested-by: David Marchand <david.marchand@redhat.com>

Applied, thanks




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

* Re: [dpdk-dev] [PATCH v2] mk: report address of packed member as warning
  2019-05-02 15:53   ` Burakov, Anatoly
  2019-05-02 15:53     ` Burakov, Anatoly
@ 2019-05-02 18:54     ` Stephen Hemminger
  2019-05-02 18:54       ` Stephen Hemminger
  2019-05-03  7:56       ` Burakov, Anatoly
  1 sibling, 2 replies; 36+ messages in thread
From: Stephen Hemminger @ 2019-05-02 18:54 UTC (permalink / raw)
  To: Burakov, Anatoly; +Cc: Reshma Pattan, dev, david.marchand, bruce.richardson

On Thu, 2 May 2019 16:53:50 +0100
"Burakov, Anatoly" <anatoly.burakov@intel.com> wrote:

> On 02-May-19 3:13 PM, Reshma Pattan wrote:
> > gcc 9 on Fedora 30 gives an error
> > "taking address of packed member may result in an
> > unaligned pointer value" for -Waddress-of-packed-member.
> > 
> > Report it as warning instead of error to fix the build.
> > 
> > Snippet of build before fix
> > ...lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’:
> > ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking address
> > of packed member of ‘struct rte_mem_config’ may result in an unaligned
> > pointer value [-Werror=address-of-packed-member]
> >    768 |  cur_msl = &mcfg->memsegs[msl_idx];
> >        |            ^~~~~~~~~~~~~~~~~~~~~~~
> > 
> > Snippet of build after fix
> > ..lib/librte_eal/linux/eal/eal_memory.c: In function ‘remap_segment’:
> > ..lib/librte_eal/linux/eal/eal_memory.c:685:9: warning: taking address
> > of packed member of ‘struct rte_mem_config’ may result in an unaligned
> > pointer value [-Waddress-of-packed-member]
> >    685 |   msl = &mcfg->memsegs[msl_idx];
> >   
> 
> Fixing these would require an ABI break, because these are exposed 
> externally. Should we submit a deprecation notice for EAL?


Ideally mem config and related structures would not be exposed in the
API. Like lcore_config and eal_config it should be eal_private

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

* Re: [dpdk-dev] [PATCH v2] mk: report address of packed member as warning
  2019-05-02 18:54     ` Stephen Hemminger
@ 2019-05-02 18:54       ` Stephen Hemminger
  2019-05-03  7:56       ` Burakov, Anatoly
  1 sibling, 0 replies; 36+ messages in thread
From: Stephen Hemminger @ 2019-05-02 18:54 UTC (permalink / raw)
  To: Burakov, Anatoly; +Cc: Reshma Pattan, dev, david.marchand, bruce.richardson

On Thu, 2 May 2019 16:53:50 +0100
"Burakov, Anatoly" <anatoly.burakov@intel.com> wrote:

> On 02-May-19 3:13 PM, Reshma Pattan wrote:
> > gcc 9 on Fedora 30 gives an error
> > "taking address of packed member may result in an
> > unaligned pointer value" for -Waddress-of-packed-member.
> > 
> > Report it as warning instead of error to fix the build.
> > 
> > Snippet of build before fix
> > ...lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’:
> > ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking address
> > of packed member of ‘struct rte_mem_config’ may result in an unaligned
> > pointer value [-Werror=address-of-packed-member]
> >    768 |  cur_msl = &mcfg->memsegs[msl_idx];
> >        |            ^~~~~~~~~~~~~~~~~~~~~~~
> > 
> > Snippet of build after fix
> > ..lib/librte_eal/linux/eal/eal_memory.c: In function ‘remap_segment’:
> > ..lib/librte_eal/linux/eal/eal_memory.c:685:9: warning: taking address
> > of packed member of ‘struct rte_mem_config’ may result in an unaligned
> > pointer value [-Waddress-of-packed-member]
> >    685 |   msl = &mcfg->memsegs[msl_idx];
> >   
> 
> Fixing these would require an ABI break, because these are exposed 
> externally. Should we submit a deprecation notice for EAL?


Ideally mem config and related structures would not be exposed in the
API. Like lcore_config and eal_config it should be eal_private

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

* Re: [dpdk-dev] [PATCH v2] mk: report address of packed member as warning
  2019-05-02 18:54     ` Stephen Hemminger
  2019-05-02 18:54       ` Stephen Hemminger
@ 2019-05-03  7:56       ` Burakov, Anatoly
  2019-05-03  7:56         ` Burakov, Anatoly
  1 sibling, 1 reply; 36+ messages in thread
From: Burakov, Anatoly @ 2019-05-03  7:56 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Reshma Pattan, dev, david.marchand, bruce.richardson

On 02-May-19 7:54 PM, Stephen Hemminger wrote:
> On Thu, 2 May 2019 16:53:50 +0100
> "Burakov, Anatoly" <anatoly.burakov@intel.com> wrote:
> 
>> On 02-May-19 3:13 PM, Reshma Pattan wrote:
>>> gcc 9 on Fedora 30 gives an error
>>> "taking address of packed member may result in an
>>> unaligned pointer value" for -Waddress-of-packed-member.
>>>
>>> Report it as warning instead of error to fix the build.
>>>
>>> Snippet of build before fix
>>> ...lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’:
>>> ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking address
>>> of packed member of ‘struct rte_mem_config’ may result in an unaligned
>>> pointer value [-Werror=address-of-packed-member]
>>>     768 |  cur_msl = &mcfg->memsegs[msl_idx];
>>>         |            ^~~~~~~~~~~~~~~~~~~~~~~
>>>
>>> Snippet of build after fix
>>> ..lib/librte_eal/linux/eal/eal_memory.c: In function ‘remap_segment’:
>>> ..lib/librte_eal/linux/eal/eal_memory.c:685:9: warning: taking address
>>> of packed member of ‘struct rte_mem_config’ may result in an unaligned
>>> pointer value [-Waddress-of-packed-member]
>>>     685 |   msl = &mcfg->memsegs[msl_idx];
>>>    
>>
>> Fixing these would require an ABI break, because these are exposed
>> externally. Should we submit a deprecation notice for EAL?
> 
> 
> Ideally mem config and related structures would not be exposed in the
> API. Like lcore_config and eal_config it should be eal_private
> 

In a perfect world, that would've been the case. However, these are in 
shared memory structures that are used for multiprocess synchronization.

-- 
Thanks,
Anatoly

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

* Re: [dpdk-dev] [PATCH v2] mk: report address of packed member as warning
  2019-05-03  7:56       ` Burakov, Anatoly
@ 2019-05-03  7:56         ` Burakov, Anatoly
  0 siblings, 0 replies; 36+ messages in thread
From: Burakov, Anatoly @ 2019-05-03  7:56 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Reshma Pattan, dev, david.marchand, bruce.richardson

On 02-May-19 7:54 PM, Stephen Hemminger wrote:
> On Thu, 2 May 2019 16:53:50 +0100
> "Burakov, Anatoly" <anatoly.burakov@intel.com> wrote:
> 
>> On 02-May-19 3:13 PM, Reshma Pattan wrote:
>>> gcc 9 on Fedora 30 gives an error
>>> "taking address of packed member may result in an
>>> unaligned pointer value" for -Waddress-of-packed-member.
>>>
>>> Report it as warning instead of error to fix the build.
>>>
>>> Snippet of build before fix
>>> ...lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’:
>>> ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking address
>>> of packed member of ‘struct rte_mem_config’ may result in an unaligned
>>> pointer value [-Werror=address-of-packed-member]
>>>     768 |  cur_msl = &mcfg->memsegs[msl_idx];
>>>         |            ^~~~~~~~~~~~~~~~~~~~~~~
>>>
>>> Snippet of build after fix
>>> ..lib/librte_eal/linux/eal/eal_memory.c: In function ‘remap_segment’:
>>> ..lib/librte_eal/linux/eal/eal_memory.c:685:9: warning: taking address
>>> of packed member of ‘struct rte_mem_config’ may result in an unaligned
>>> pointer value [-Waddress-of-packed-member]
>>>     685 |   msl = &mcfg->memsegs[msl_idx];
>>>    
>>
>> Fixing these would require an ABI break, because these are exposed
>> externally. Should we submit a deprecation notice for EAL?
> 
> 
> Ideally mem config and related structures would not be exposed in the
> API. Like lcore_config and eal_config it should be eal_private
> 

In a perfect world, that would've been the case. However, these are in 
shared memory structures that are used for multiprocess synchronization.

-- 
Thanks,
Anatoly

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

* Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30
  2019-05-02 15:56   ` Thomas Monjalon
  2019-05-02 15:56     ` Thomas Monjalon
@ 2019-05-03 16:01     ` Jerin Jacob Kollanukkaran
  2019-05-03 16:01       ` Jerin Jacob Kollanukkaran
  2019-05-03 16:25       ` Bruce Richardson
  1 sibling, 2 replies; 36+ messages in thread
From: Jerin Jacob Kollanukkaran @ 2019-05-03 16:01 UTC (permalink / raw)
  To: Thomas Monjalon, Reshma Pattan
  Cc: dev, David Marchand, bruce.richardson, viktorin,
	Gavin Hu (Arm Technology China)

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Thomas Monjalon
> Sent: Thursday, May 2, 2019 9:27 PM
> To: Reshma Pattan <reshma.pattan@intel.com>
> Cc: dev@dpdk.org; David Marchand <david.marchand@redhat.com>
> Subject: Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30
> 
> 02/05/2019 17:00, David Marchand:
> > On Thu, May 2, 2019 at 11:33 AM Reshma Pattan
> > <reshma.pattan@intel.com>
> > wrote:
> >
> > > gcc 9 on Fedora 30 gives an error
> > > "taking address of packed member may result in an unaligned pointer
> > > value" warnings.
> > >
> > > For clang builds this warning is already disabled, so disable
> > > "-Waddress-of-packed-member" for gcc builds also.
> > >
> > > Snippet of build error:
> > > ...lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’:
> > > ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking
> > > address of packed member of ‘struct rte_mem_config’ may result in an
> > > unaligned pointer value [-Werror=address-of-packed-member]
> > >   768 |  cur_msl = &mcfg->memsegs[msl_idx];
> > >       |            ^~~~~~~~~~~~~~~~~~~~~~~
> > >
> > > Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
> > >
> > >
> > Tested on rhel-7 and fedora-30.
> > Tested-by: David Marchand <david.marchand@redhat.com>
> 
> Applied, thanks

Its been found that one of the armv7 toolchain treats
-Wno-address-of-packed-member as unrecognized command line option,
Hence armv7 build fails on dpdk.org master now. Not sure it is specific to armv7 or compiler?

Armv7 is not maintained and I don’t think, it has any use case for DPDK.
If everyone agrees IMO it is better remove the arm 32bit support.
   
    arm-buildroot-linux-gnueabihf-gcc -v
    Using built-in specs.
    COLLECT_GCC=/opt/armv7-eabihf--glibc--stable-2018.11-1/
    bin/arm-buildroot-linux-gnueabihf-gcc.br_real
    COLLECT_LTO_WRAPPER=/opt/armv7-eabihf--glibc--stable-2018.11-1/
    libexec/gcc/arm-buildroot-linux-gnueabihf/7.3.0/lto-wrapper
    Target: arm-buildroot-linux-gnueabihf
    Configured with: ./configure
    --prefix=/opt/armv7-eabihf--glibc--stable-2018.11-1
    --sysconfdir=/opt/armv7-eabihf--glibc--stable-2018.11-1/etc
    --enable-static --target=arm-buildroot-linux-gnueabihf
    --with-sysroot=/opt/armv7-eabihf--glibc--stable-2018.11-1/
    arm-buildroot-linux-gnueabihf/sysroot
    --disable-__cxa_atexit --with-gnu-ld --disable-libssp --disable-multilib
    --with-gmp=/opt/armv7-eabihf--glibc--stable-2018.11-1
    --with-mpc=/opt/armv7-eabihf--glibc--stable-2018.11-1
    --with-mpfr=/opt/armv7-eabihf--glibc--stable-2018.11-1
    --with-pkgversion='Buildroot 2018.08.1-00003-g576b333'
    --with-bugurl=http://bugs.buildroot.net/ --disable-libquadmath
    --enable-tls --disable-libmudflap --enable-threads --without-isl
    --without-cloog --disable-decimal-float --with-abi=aa
    pcs-linux --with-cpu=cortex-a9 --with-fpu=vfpv3-d16 --with-float=hard
    --with-mode=arm --enable-languages=c,c++
    --with-build-time-tools=/opt/armv7-eabihf--glibc--stable-2018.11-1/
    arm-buildroot-linux-gnueabihf/bin --enable-shared --disable-libgomp
    Thread model: posix
    gcc version 7.3.0 (Buildroot 2018.08.1-00003-g576b333)

    error log:

    dpdk.org/lib/librte_eal/linux/eal/eal_vfio_mp_sync.c: At top level:
    cc1: error: unrecognized command line option
    ‘-Wno-address-of-packed-member’ [-Werror]
    cc1: all warnings being treated as errors

> 
> 


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

* Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30
  2019-05-03 16:01     ` Jerin Jacob Kollanukkaran
@ 2019-05-03 16:01       ` Jerin Jacob Kollanukkaran
  2019-05-03 16:25       ` Bruce Richardson
  1 sibling, 0 replies; 36+ messages in thread
From: Jerin Jacob Kollanukkaran @ 2019-05-03 16:01 UTC (permalink / raw)
  To: Thomas Monjalon, Reshma Pattan
  Cc: dev, David Marchand, bruce.richardson, viktorin,
	Gavin Hu (Arm Technology China)

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Thomas Monjalon
> Sent: Thursday, May 2, 2019 9:27 PM
> To: Reshma Pattan <reshma.pattan@intel.com>
> Cc: dev@dpdk.org; David Marchand <david.marchand@redhat.com>
> Subject: Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30
> 
> 02/05/2019 17:00, David Marchand:
> > On Thu, May 2, 2019 at 11:33 AM Reshma Pattan
> > <reshma.pattan@intel.com>
> > wrote:
> >
> > > gcc 9 on Fedora 30 gives an error
> > > "taking address of packed member may result in an unaligned pointer
> > > value" warnings.
> > >
> > > For clang builds this warning is already disabled, so disable
> > > "-Waddress-of-packed-member" for gcc builds also.
> > >
> > > Snippet of build error:
> > > ...lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’:
> > > ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking
> > > address of packed member of ‘struct rte_mem_config’ may result in an
> > > unaligned pointer value [-Werror=address-of-packed-member]
> > >   768 |  cur_msl = &mcfg->memsegs[msl_idx];
> > >       |            ^~~~~~~~~~~~~~~~~~~~~~~
> > >
> > > Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
> > >
> > >
> > Tested on rhel-7 and fedora-30.
> > Tested-by: David Marchand <david.marchand@redhat.com>
> 
> Applied, thanks

Its been found that one of the armv7 toolchain treats
-Wno-address-of-packed-member as unrecognized command line option,
Hence armv7 build fails on dpdk.org master now. Not sure it is specific to armv7 or compiler?

Armv7 is not maintained and I don’t think, it has any use case for DPDK.
If everyone agrees IMO it is better remove the arm 32bit support.
   
    arm-buildroot-linux-gnueabihf-gcc -v
    Using built-in specs.
    COLLECT_GCC=/opt/armv7-eabihf--glibc--stable-2018.11-1/
    bin/arm-buildroot-linux-gnueabihf-gcc.br_real
    COLLECT_LTO_WRAPPER=/opt/armv7-eabihf--glibc--stable-2018.11-1/
    libexec/gcc/arm-buildroot-linux-gnueabihf/7.3.0/lto-wrapper
    Target: arm-buildroot-linux-gnueabihf
    Configured with: ./configure
    --prefix=/opt/armv7-eabihf--glibc--stable-2018.11-1
    --sysconfdir=/opt/armv7-eabihf--glibc--stable-2018.11-1/etc
    --enable-static --target=arm-buildroot-linux-gnueabihf
    --with-sysroot=/opt/armv7-eabihf--glibc--stable-2018.11-1/
    arm-buildroot-linux-gnueabihf/sysroot
    --disable-__cxa_atexit --with-gnu-ld --disable-libssp --disable-multilib
    --with-gmp=/opt/armv7-eabihf--glibc--stable-2018.11-1
    --with-mpc=/opt/armv7-eabihf--glibc--stable-2018.11-1
    --with-mpfr=/opt/armv7-eabihf--glibc--stable-2018.11-1
    --with-pkgversion='Buildroot 2018.08.1-00003-g576b333'
    --with-bugurl=http://bugs.buildroot.net/ --disable-libquadmath
    --enable-tls --disable-libmudflap --enable-threads --without-isl
    --without-cloog --disable-decimal-float --with-abi=aa
    pcs-linux --with-cpu=cortex-a9 --with-fpu=vfpv3-d16 --with-float=hard
    --with-mode=arm --enable-languages=c,c++
    --with-build-time-tools=/opt/armv7-eabihf--glibc--stable-2018.11-1/
    arm-buildroot-linux-gnueabihf/bin --enable-shared --disable-libgomp
    Thread model: posix
    gcc version 7.3.0 (Buildroot 2018.08.1-00003-g576b333)

    error log:

    dpdk.org/lib/librte_eal/linux/eal/eal_vfio_mp_sync.c: At top level:
    cc1: error: unrecognized command line option
    ‘-Wno-address-of-packed-member’ [-Werror]
    cc1: all warnings being treated as errors

> 
> 


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

* Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30
  2019-05-03 16:01     ` Jerin Jacob Kollanukkaran
  2019-05-03 16:01       ` Jerin Jacob Kollanukkaran
@ 2019-05-03 16:25       ` Bruce Richardson
  2019-05-03 16:25         ` Bruce Richardson
                           ` (2 more replies)
  1 sibling, 3 replies; 36+ messages in thread
From: Bruce Richardson @ 2019-05-03 16:25 UTC (permalink / raw)
  To: Jerin Jacob Kollanukkaran
  Cc: Thomas Monjalon, Reshma Pattan, dev, David Marchand, viktorin,
	Gavin Hu (Arm Technology China)

On Fri, May 03, 2019 at 04:01:38PM +0000, Jerin Jacob Kollanukkaran wrote:
> > -----Original Message-----
> > From: dev <dev-bounces@dpdk.org> On Behalf Of Thomas Monjalon
> > Sent: Thursday, May 2, 2019 9:27 PM
> > To: Reshma Pattan <reshma.pattan@intel.com>
> > Cc: dev@dpdk.org; David Marchand <david.marchand@redhat.com>
> > Subject: Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30
> > 
> > 02/05/2019 17:00, David Marchand:
> > > On Thu, May 2, 2019 at 11:33 AM Reshma Pattan
> > > <reshma.pattan@intel.com>
> > > wrote:
> > >
> > > > gcc 9 on Fedora 30 gives an error
> > > > "taking address of packed member may result in an unaligned pointer
> > > > value" warnings.
> > > >
> > > > For clang builds this warning is already disabled, so disable
> > > > "-Waddress-of-packed-member" for gcc builds also.
> > > >
> > > > Snippet of build error:
> > > > ...lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’:
> > > > ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking
> > > > address of packed member of ‘struct rte_mem_config’ may result in an
> > > > unaligned pointer value [-Werror=address-of-packed-member]
> > > >   768 |  cur_msl = &mcfg->memsegs[msl_idx];
> > > >       |            ^~~~~~~~~~~~~~~~~~~~~~~
> > > >
> > > > Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
> > > >
> > > >
> > > Tested on rhel-7 and fedora-30.
> > > Tested-by: David Marchand <david.marchand@redhat.com>
> > 
> > Applied, thanks
> 
> Its been found that one of the armv7 toolchain treats
> -Wno-address-of-packed-member as unrecognized command line option,
> Hence armv7 build fails on dpdk.org master now. Not sure it is specific to armv7 or compiler?
> 
> Armv7 is not maintained and I don’t think, it has any use case for DPDK.
> If everyone agrees IMO it is better remove the arm 32bit support.
>    
>     arm-buildroot-linux-gnueabihf-gcc -v
>     Using built-in specs.
>     COLLECT_GCC=/opt/armv7-eabihf--glibc--stable-2018.11-1/
>     bin/arm-buildroot-linux-gnueabihf-gcc.br_real
>     COLLECT_LTO_WRAPPER=/opt/armv7-eabihf--glibc--stable-2018.11-1/
>     libexec/gcc/arm-buildroot-linux-gnueabihf/7.3.0/lto-wrapper
>     Target: arm-buildroot-linux-gnueabihf
>     Configured with: ./configure
>     --prefix=/opt/armv7-eabihf--glibc--stable-2018.11-1
>     --sysconfdir=/opt/armv7-eabihf--glibc--stable-2018.11-1/etc
>     --enable-static --target=arm-buildroot-linux-gnueabihf
>     --with-sysroot=/opt/armv7-eabihf--glibc--stable-2018.11-1/
>     arm-buildroot-linux-gnueabihf/sysroot
>     --disable-__cxa_atexit --with-gnu-ld --disable-libssp --disable-multilib
>     --with-gmp=/opt/armv7-eabihf--glibc--stable-2018.11-1
>     --with-mpc=/opt/armv7-eabihf--glibc--stable-2018.11-1
>     --with-mpfr=/opt/armv7-eabihf--glibc--stable-2018.11-1
>     --with-pkgversion='Buildroot 2018.08.1-00003-g576b333'
>     --with-bugurl=http://bugs.buildroot.net/ --disable-libquadmath
>     --enable-tls --disable-libmudflap --enable-threads --without-isl
>     --without-cloog --disable-decimal-float --with-abi=aa
>     pcs-linux --with-cpu=cortex-a9 --with-fpu=vfpv3-d16 --with-float=hard
>     --with-mode=arm --enable-languages=c,c++
>     --with-build-time-tools=/opt/armv7-eabihf--glibc--stable-2018.11-1/
>     arm-buildroot-linux-gnueabihf/bin --enable-shared --disable-libgomp
>     Thread model: posix
>     gcc version 7.3.0 (Buildroot 2018.08.1-00003-g576b333)
> 
>     error log:
> 
>     dpdk.org/lib/librte_eal/linux/eal/eal_vfio_mp_sync.c: At top level:
>     cc1: error: unrecognized command line option
>     ‘-Wno-address-of-packed-member’ [-Werror]
>     cc1: all warnings being treated as errors
> 

Are you sure there is not another error as well? GCC silently ignores flags
like this one normally, but does report them as unrecognised if-and-only-if
another error or warning is given too.

/Bruce

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

* Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30
  2019-05-03 16:25       ` Bruce Richardson
@ 2019-05-03 16:25         ` Bruce Richardson
  2019-05-03 16:28         ` Richardson, Bruce
  2019-05-03 17:24         ` [dpdk-dev] [EXT] " Jerin Jacob Kollanukkaran
  2 siblings, 0 replies; 36+ messages in thread
From: Bruce Richardson @ 2019-05-03 16:25 UTC (permalink / raw)
  To: Jerin Jacob Kollanukkaran
  Cc: Thomas Monjalon, Reshma Pattan, dev, David Marchand, viktorin,
	Gavin Hu (Arm Technology China)

On Fri, May 03, 2019 at 04:01:38PM +0000, Jerin Jacob Kollanukkaran wrote:
> > -----Original Message-----
> > From: dev <dev-bounces@dpdk.org> On Behalf Of Thomas Monjalon
> > Sent: Thursday, May 2, 2019 9:27 PM
> > To: Reshma Pattan <reshma.pattan@intel.com>
> > Cc: dev@dpdk.org; David Marchand <david.marchand@redhat.com>
> > Subject: Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30
> > 
> > 02/05/2019 17:00, David Marchand:
> > > On Thu, May 2, 2019 at 11:33 AM Reshma Pattan
> > > <reshma.pattan@intel.com>
> > > wrote:
> > >
> > > > gcc 9 on Fedora 30 gives an error
> > > > "taking address of packed member may result in an unaligned pointer
> > > > value" warnings.
> > > >
> > > > For clang builds this warning is already disabled, so disable
> > > > "-Waddress-of-packed-member" for gcc builds also.
> > > >
> > > > Snippet of build error:
> > > > ...lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’:
> > > > ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking
> > > > address of packed member of ‘struct rte_mem_config’ may result in an
> > > > unaligned pointer value [-Werror=address-of-packed-member]
> > > >   768 |  cur_msl = &mcfg->memsegs[msl_idx];
> > > >       |            ^~~~~~~~~~~~~~~~~~~~~~~
> > > >
> > > > Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
> > > >
> > > >
> > > Tested on rhel-7 and fedora-30.
> > > Tested-by: David Marchand <david.marchand@redhat.com>
> > 
> > Applied, thanks
> 
> Its been found that one of the armv7 toolchain treats
> -Wno-address-of-packed-member as unrecognized command line option,
> Hence armv7 build fails on dpdk.org master now. Not sure it is specific to armv7 or compiler?
> 
> Armv7 is not maintained and I don’t think, it has any use case for DPDK.
> If everyone agrees IMO it is better remove the arm 32bit support.
>    
>     arm-buildroot-linux-gnueabihf-gcc -v
>     Using built-in specs.
>     COLLECT_GCC=/opt/armv7-eabihf--glibc--stable-2018.11-1/
>     bin/arm-buildroot-linux-gnueabihf-gcc.br_real
>     COLLECT_LTO_WRAPPER=/opt/armv7-eabihf--glibc--stable-2018.11-1/
>     libexec/gcc/arm-buildroot-linux-gnueabihf/7.3.0/lto-wrapper
>     Target: arm-buildroot-linux-gnueabihf
>     Configured with: ./configure
>     --prefix=/opt/armv7-eabihf--glibc--stable-2018.11-1
>     --sysconfdir=/opt/armv7-eabihf--glibc--stable-2018.11-1/etc
>     --enable-static --target=arm-buildroot-linux-gnueabihf
>     --with-sysroot=/opt/armv7-eabihf--glibc--stable-2018.11-1/
>     arm-buildroot-linux-gnueabihf/sysroot
>     --disable-__cxa_atexit --with-gnu-ld --disable-libssp --disable-multilib
>     --with-gmp=/opt/armv7-eabihf--glibc--stable-2018.11-1
>     --with-mpc=/opt/armv7-eabihf--glibc--stable-2018.11-1
>     --with-mpfr=/opt/armv7-eabihf--glibc--stable-2018.11-1
>     --with-pkgversion='Buildroot 2018.08.1-00003-g576b333'
>     --with-bugurl=http://bugs.buildroot.net/ --disable-libquadmath
>     --enable-tls --disable-libmudflap --enable-threads --without-isl
>     --without-cloog --disable-decimal-float --with-abi=aa
>     pcs-linux --with-cpu=cortex-a9 --with-fpu=vfpv3-d16 --with-float=hard
>     --with-mode=arm --enable-languages=c,c++
>     --with-build-time-tools=/opt/armv7-eabihf--glibc--stable-2018.11-1/
>     arm-buildroot-linux-gnueabihf/bin --enable-shared --disable-libgomp
>     Thread model: posix
>     gcc version 7.3.0 (Buildroot 2018.08.1-00003-g576b333)
> 
>     error log:
> 
>     dpdk.org/lib/librte_eal/linux/eal/eal_vfio_mp_sync.c: At top level:
>     cc1: error: unrecognized command line option
>     ‘-Wno-address-of-packed-member’ [-Werror]
>     cc1: all warnings being treated as errors
> 

Are you sure there is not another error as well? GCC silently ignores flags
like this one normally, but does report them as unrecognised if-and-only-if
another error or warning is given too.

/Bruce

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

* Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30
  2019-05-03 16:25       ` Bruce Richardson
  2019-05-03 16:25         ` Bruce Richardson
@ 2019-05-03 16:28         ` Richardson, Bruce
  2019-05-03 16:28           ` Richardson, Bruce
  2019-05-03 17:24         ` [dpdk-dev] [EXT] " Jerin Jacob Kollanukkaran
  2 siblings, 1 reply; 36+ messages in thread
From: Richardson, Bruce @ 2019-05-03 16:28 UTC (permalink / raw)
  To: Richardson, Bruce, Jerin Jacob Kollanukkaran
  Cc: Thomas Monjalon, Pattan, Reshma, dev, David Marchand, viktorin,
	Gavin Hu (Arm Technology China)

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> Sent: Friday, May 3, 2019 5:25 PM
> To: Jerin Jacob Kollanukkaran <jerinj@marvell.com>
> Subject: Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora
> 30
> 
> On Fri, May 03, 2019 at 04:01:38PM +0000, Jerin Jacob Kollanukkaran wrote:
> > > -----Original Message-----
> > > From: dev <dev-bounces@dpdk.org> On Behalf Of Thomas Monjalon
> > > Sent: Thursday, May 2, 2019 9:27 PM
> > > To: Reshma Pattan <reshma.pattan@intel.com>
> > > Cc: dev@dpdk.org; David Marchand <david.marchand@redhat.com>
> > > Subject: Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on
> > > Fedora 30
> > >
> > > 02/05/2019 17:00, David Marchand:
> > > > On Thu, May 2, 2019 at 11:33 AM Reshma Pattan
> > > > <reshma.pattan@intel.com>
> > > > wrote:
> > > >
> > > > > gcc 9 on Fedora 30 gives an error "taking address of packed
> > > > > member may result in an unaligned pointer value" warnings.
> > > > >
> > > > > For clang builds this warning is already disabled, so disable
> > > > > "-Waddress-of-packed-member" for gcc builds also.
> > > > >
> > > > > Snippet of build error:
> > > > > ...lib/librte_eal/linux/eal/eal_memalloc.c: In function
> ‘alloc_seg_walk’:
> > > > > ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking
> > > > > address of packed member of ‘struct rte_mem_config’ may result
> > > > > in an unaligned pointer value [-Werror=address-of-packed-member]
> > > > >   768 |  cur_msl = &mcfg->memsegs[msl_idx];
> > > > >       |            ^~~~~~~~~~~~~~~~~~~~~~~
> > > > >
> > > > > Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
> > > > >
> > > > >
> > > > Tested on rhel-7 and fedora-30.
> > > > Tested-by: David Marchand <david.marchand@redhat.com>
> > >
> > > Applied, thanks
> >
> > Its been found that one of the armv7 toolchain treats
> > -Wno-address-of-packed-member as unrecognized command line option,
> > Hence armv7 build fails on dpdk.org master now. Not sure it is specific
> to armv7 or compiler?
> >
> > Armv7 is not maintained and I don’t think, it has any use case for DPDK.
> > If everyone agrees IMO it is better remove the arm 32bit support.
> >
> >     arm-buildroot-linux-gnueabihf-gcc -v
> >     Using built-in specs.
> >     COLLECT_GCC=/opt/armv7-eabihf--glibc--stable-2018.11-1/
> >     bin/arm-buildroot-linux-gnueabihf-gcc.br_real
> >     COLLECT_LTO_WRAPPER=/opt/armv7-eabihf--glibc--stable-2018.11-1/
> >     libexec/gcc/arm-buildroot-linux-gnueabihf/7.3.0/lto-wrapper
> >     Target: arm-buildroot-linux-gnueabihf
> >     Configured with: ./configure
> >     --prefix=/opt/armv7-eabihf--glibc--stable-2018.11-1
> >     --sysconfdir=/opt/armv7-eabihf--glibc--stable-2018.11-1/etc
> >     --enable-static --target=arm-buildroot-linux-gnueabihf
> >     --with-sysroot=/opt/armv7-eabihf--glibc--stable-2018.11-1/
> >     arm-buildroot-linux-gnueabihf/sysroot
> >     --disable-__cxa_atexit --with-gnu-ld --disable-libssp --disable-
> multilib
> >     --with-gmp=/opt/armv7-eabihf--glibc--stable-2018.11-1
> >     --with-mpc=/opt/armv7-eabihf--glibc--stable-2018.11-1
> >     --with-mpfr=/opt/armv7-eabihf--glibc--stable-2018.11-1
> >     --with-pkgversion='Buildroot 2018.08.1-00003-g576b333'
> >     --with-bugurl=http://bugs.buildroot.net/ --disable-libquadmath
> >     --enable-tls --disable-libmudflap --enable-threads --without-isl
> >     --without-cloog --disable-decimal-float --with-abi=aa
> >     pcs-linux --with-cpu=cortex-a9 --with-fpu=vfpv3-d16 --with-
> float=hard
> >     --with-mode=arm --enable-languages=c,c++
> >     --with-build-time-tools=/opt/armv7-eabihf--glibc--stable-2018.11-1/
> >     arm-buildroot-linux-gnueabihf/bin --enable-shared --disable-libgomp
> >     Thread model: posix
> >     gcc version 7.3.0 (Buildroot 2018.08.1-00003-g576b333)
> >
> >     error log:
> >
> >     dpdk.org/lib/librte_eal/linux/eal/eal_vfio_mp_sync.c: At top level:
> >     cc1: error: unrecognized command line option
> >     ‘-Wno-address-of-packed-member’ [-Werror]
> >     cc1: all warnings being treated as errors
> >
> 
> Are you sure there is not another error as well? GCC silently ignores
> flags like this one normally, but does report them as unrecognised if-and-
> only-if another error or warning is given too.
> 
> /Bruce

For completeness, ref: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

"When an unrecognized warning option is requested (e.g., -Wunknown-warning), GCC emits a diagnostic stating that the option is not recognized. However, if the -Wno- form is used, the behavior is slightly different: no diagnostic is produced for -Wno-unknown-warning unless other diagnostics are being produced. This allows the use of new -Wno- options with old compilers, but if something goes wrong, the compiler warns that an unrecognized option is present."

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

* Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30
  2019-05-03 16:28         ` Richardson, Bruce
@ 2019-05-03 16:28           ` Richardson, Bruce
  0 siblings, 0 replies; 36+ messages in thread
From: Richardson, Bruce @ 2019-05-03 16:28 UTC (permalink / raw)
  To: Richardson, Bruce, Jerin Jacob Kollanukkaran
  Cc: Thomas Monjalon, Pattan, Reshma, dev, David Marchand, viktorin,
	Gavin Hu (Arm Technology China)

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> Sent: Friday, May 3, 2019 5:25 PM
> To: Jerin Jacob Kollanukkaran <jerinj@marvell.com>
> Subject: Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora
> 30
> 
> On Fri, May 03, 2019 at 04:01:38PM +0000, Jerin Jacob Kollanukkaran wrote:
> > > -----Original Message-----
> > > From: dev <dev-bounces@dpdk.org> On Behalf Of Thomas Monjalon
> > > Sent: Thursday, May 2, 2019 9:27 PM
> > > To: Reshma Pattan <reshma.pattan@intel.com>
> > > Cc: dev@dpdk.org; David Marchand <david.marchand@redhat.com>
> > > Subject: Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on
> > > Fedora 30
> > >
> > > 02/05/2019 17:00, David Marchand:
> > > > On Thu, May 2, 2019 at 11:33 AM Reshma Pattan
> > > > <reshma.pattan@intel.com>
> > > > wrote:
> > > >
> > > > > gcc 9 on Fedora 30 gives an error "taking address of packed
> > > > > member may result in an unaligned pointer value" warnings.
> > > > >
> > > > > For clang builds this warning is already disabled, so disable
> > > > > "-Waddress-of-packed-member" for gcc builds also.
> > > > >
> > > > > Snippet of build error:
> > > > > ...lib/librte_eal/linux/eal/eal_memalloc.c: In function
> ‘alloc_seg_walk’:
> > > > > ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking
> > > > > address of packed member of ‘struct rte_mem_config’ may result
> > > > > in an unaligned pointer value [-Werror=address-of-packed-member]
> > > > >   768 |  cur_msl = &mcfg->memsegs[msl_idx];
> > > > >       |            ^~~~~~~~~~~~~~~~~~~~~~~
> > > > >
> > > > > Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
> > > > >
> > > > >
> > > > Tested on rhel-7 and fedora-30.
> > > > Tested-by: David Marchand <david.marchand@redhat.com>
> > >
> > > Applied, thanks
> >
> > Its been found that one of the armv7 toolchain treats
> > -Wno-address-of-packed-member as unrecognized command line option,
> > Hence armv7 build fails on dpdk.org master now. Not sure it is specific
> to armv7 or compiler?
> >
> > Armv7 is not maintained and I don’t think, it has any use case for DPDK.
> > If everyone agrees IMO it is better remove the arm 32bit support.
> >
> >     arm-buildroot-linux-gnueabihf-gcc -v
> >     Using built-in specs.
> >     COLLECT_GCC=/opt/armv7-eabihf--glibc--stable-2018.11-1/
> >     bin/arm-buildroot-linux-gnueabihf-gcc.br_real
> >     COLLECT_LTO_WRAPPER=/opt/armv7-eabihf--glibc--stable-2018.11-1/
> >     libexec/gcc/arm-buildroot-linux-gnueabihf/7.3.0/lto-wrapper
> >     Target: arm-buildroot-linux-gnueabihf
> >     Configured with: ./configure
> >     --prefix=/opt/armv7-eabihf--glibc--stable-2018.11-1
> >     --sysconfdir=/opt/armv7-eabihf--glibc--stable-2018.11-1/etc
> >     --enable-static --target=arm-buildroot-linux-gnueabihf
> >     --with-sysroot=/opt/armv7-eabihf--glibc--stable-2018.11-1/
> >     arm-buildroot-linux-gnueabihf/sysroot
> >     --disable-__cxa_atexit --with-gnu-ld --disable-libssp --disable-
> multilib
> >     --with-gmp=/opt/armv7-eabihf--glibc--stable-2018.11-1
> >     --with-mpc=/opt/armv7-eabihf--glibc--stable-2018.11-1
> >     --with-mpfr=/opt/armv7-eabihf--glibc--stable-2018.11-1
> >     --with-pkgversion='Buildroot 2018.08.1-00003-g576b333'
> >     --with-bugurl=http://bugs.buildroot.net/ --disable-libquadmath
> >     --enable-tls --disable-libmudflap --enable-threads --without-isl
> >     --without-cloog --disable-decimal-float --with-abi=aa
> >     pcs-linux --with-cpu=cortex-a9 --with-fpu=vfpv3-d16 --with-
> float=hard
> >     --with-mode=arm --enable-languages=c,c++
> >     --with-build-time-tools=/opt/armv7-eabihf--glibc--stable-2018.11-1/
> >     arm-buildroot-linux-gnueabihf/bin --enable-shared --disable-libgomp
> >     Thread model: posix
> >     gcc version 7.3.0 (Buildroot 2018.08.1-00003-g576b333)
> >
> >     error log:
> >
> >     dpdk.org/lib/librte_eal/linux/eal/eal_vfio_mp_sync.c: At top level:
> >     cc1: error: unrecognized command line option
> >     ‘-Wno-address-of-packed-member’ [-Werror]
> >     cc1: all warnings being treated as errors
> >
> 
> Are you sure there is not another error as well? GCC silently ignores
> flags like this one normally, but does report them as unrecognised if-and-
> only-if another error or warning is given too.
> 
> /Bruce

For completeness, ref: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

"When an unrecognized warning option is requested (e.g., -Wunknown-warning), GCC emits a diagnostic stating that the option is not recognized. However, if the -Wno- form is used, the behavior is slightly different: no diagnostic is produced for -Wno-unknown-warning unless other diagnostics are being produced. This allows the use of new -Wno- options with old compilers, but if something goes wrong, the compiler warns that an unrecognized option is present."

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

* Re: [dpdk-dev] [EXT] Re: [PATCH] mk: disable warning with gcc 9 on Fedora 30
  2019-05-03 16:25       ` Bruce Richardson
  2019-05-03 16:25         ` Bruce Richardson
  2019-05-03 16:28         ` Richardson, Bruce
@ 2019-05-03 17:24         ` Jerin Jacob Kollanukkaran
  2019-05-03 17:24           ` Jerin Jacob Kollanukkaran
  2 siblings, 1 reply; 36+ messages in thread
From: Jerin Jacob Kollanukkaran @ 2019-05-03 17:24 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: Thomas Monjalon, Reshma Pattan, dev, David Marchand, viktorin,
	Gavin Hu (Arm Technology China)

> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Friday, May 3, 2019 9:55 PM
> To: Jerin Jacob Kollanukkaran <jerinj@marvell.com>
> Cc: Thomas Monjalon <thomas@monjalon.net>; Reshma Pattan
> <reshma.pattan@intel.com>; dev@dpdk.org; David Marchand
> <david.marchand@redhat.com>; viktorin@rehivetech.com; Gavin Hu (Arm
> Technology China) <Gavin.Hu@arm.com>
> Subject: [EXT] Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora
> On Fri, May 03, 2019 at 04:01:38PM +0000, Jerin Jacob Kollanukkaran wrote:
> > > -----Original Message-----
> > > From: dev <dev-bounces@dpdk.org> On Behalf Of Thomas Monjalon
> > > Sent: Thursday, May 2, 2019 9:27 PM
> > > To: Reshma Pattan <reshma.pattan@intel.com>
> > > Cc: dev@dpdk.org; David Marchand <david.marchand@redhat.com>
> > > Subject: Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on
> > > Fedora 30
> > >
> > > 02/05/2019 17:00, David Marchand:
> > > > On Thu, May 2, 2019 at 11:33 AM Reshma Pattan
> > > > <reshma.pattan@intel.com>
> > > > wrote:
> > > >
> > > > > gcc 9 on Fedora 30 gives an error "taking address of packed
> > > > > member may result in an unaligned pointer value" warnings.
> > > > >
> > > > > For clang builds this warning is already disabled, so disable
> > > > > "-Waddress-of-packed-member" for gcc builds also.
> > > > >
> > > > > Snippet of build error:
> > > > > ...lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’:
> > > > > ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking
> > > > > address of packed member of ‘struct rte_mem_config’ may result
> > > > > in an unaligned pointer value [-Werror=address-of-packed-member]
> > > > >   768 |  cur_msl = &mcfg->memsegs[msl_idx];
> > > > >       |            ^~~~~~~~~~~~~~~~~~~~~~~
> > > > >
> > > > > Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
> > > > >
> > > > >
> > > > Tested on rhel-7 and fedora-30.
> > > > Tested-by: David Marchand <david.marchand@redhat.com>
> > >
> > > Applied, thanks
> >
> > Its been found that one of the armv7 toolchain treats
> > -Wno-address-of-packed-member as unrecognized command line option,
> > Hence armv7 build fails on dpdk.org master now. Not sure it is specific to
> armv7 or compiler?
> >
> > Armv7 is not maintained and I don’t think, it has any use case for DPDK.
> > If everyone agrees IMO it is better remove the arm 32bit support.
> >
> >     arm-buildroot-linux-gnueabihf-gcc -v
> >     Using built-in specs.
> >     COLLECT_GCC=/opt/armv7-eabihf--glibc--stable-2018.11-1/
> >     bin/arm-buildroot-linux-gnueabihf-gcc.br_real
> >     COLLECT_LTO_WRAPPER=/opt/armv7-eabihf--glibc--stable-2018.11-1/
> >     libexec/gcc/arm-buildroot-linux-gnueabihf/7.3.0/lto-wrapper
> >     Target: arm-buildroot-linux-gnueabihf
> >     Configured with: ./configure
> >     --prefix=/opt/armv7-eabihf--glibc--stable-2018.11-1
> >     --sysconfdir=/opt/armv7-eabihf--glibc--stable-2018.11-1/etc
> >     --enable-static --target=arm-buildroot-linux-gnueabihf
> >     --with-sysroot=/opt/armv7-eabihf--glibc--stable-2018.11-1/
> >     arm-buildroot-linux-gnueabihf/sysroot
> >     --disable-__cxa_atexit --with-gnu-ld --disable-libssp --disable-multilib
> >     --with-gmp=/opt/armv7-eabihf--glibc--stable-2018.11-1
> >     --with-mpc=/opt/armv7-eabihf--glibc--stable-2018.11-1
> >     --with-mpfr=/opt/armv7-eabihf--glibc--stable-2018.11-1
> >     --with-pkgversion='Buildroot 2018.08.1-00003-g576b333'
> >     --with-bugurl=http://bugs.buildroot.net/ --disable-libquadmath
> >     --enable-tls --disable-libmudflap --enable-threads --without-isl
> >     --without-cloog --disable-decimal-float --with-abi=aa
> >     pcs-linux --with-cpu=cortex-a9 --with-fpu=vfpv3-d16 --with-float=hard
> >     --with-mode=arm --enable-languages=c,c++
> >     --with-build-time-tools=/opt/armv7-eabihf--glibc--stable-2018.11-1/
> >     arm-buildroot-linux-gnueabihf/bin --enable-shared --disable-libgomp
> >     Thread model: posix
> >     gcc version 7.3.0 (Buildroot 2018.08.1-00003-g576b333)
> >
> >     error log:
> >
> >     dpdk.org/lib/librte_eal/linux/eal/eal_vfio_mp_sync.c: At top level:
> >     cc1: error: unrecognized command line option
> >     ‘-Wno-address-of-packed-member’ [-Werror]
> >     cc1: all warnings being treated as errors
> >
> 
> Are you sure there is not another error as well? GCC silently ignores flags like
> this one normally, but does report them as unrecognised if-and-only-if another
> error or warning is given too.

That’s explains reason for error for armv7(the file has other warnings). 
There are plenty of warning for armv7 port. That is the one reason why, I think, we need to remove
Armv7 port if there is no end user for it. It just  a pain to maintain it.

arm-buildroot-linux-gnueabihf-gcc -Wp,-MD,./.eal_vfio.o.d.tmp  -marm -munaligned-access -pthread -I/home/jerin/dpdk.org/lib/librte_eal/linux/eal/include  -march=armv7-a -mtune=cortex-a9 -mfpu
=neon -DRTE_MACHINE_CPUFLAG_NEON  -I/home/jerin/dpdk.org/build/include -include /home/jerin/dpdk.org/build/include/rte_config.h -D_GNU_SOURCE -DALLOW_EXPERIMENTAL_API -I/home/jerin/dpdk.org/l
ib/librte_eal/linux/eal/include -I/home/jerin/dpdk.org/lib/librte_eal/common -I/home/jerin/dpdk.org/lib/librte_eal/common/include -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-d
eclarations -Wold-style-definition -Wpointer-arith -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral -Wformat-security -Wundef -Wwrite-strings -Wdeprecated -Werror -Wno-error=cast
-align -Wimplicit-fallthrough=2 -Wno-format-truncation -Wno-address-of-packed-member -O3    -o eal_vfio.o -c /home/jerin/dpdk.org/lib/librte_eal/linux/eal/eal_vfio.c
/home/jerin/dpdk.org/lib/librte_eal/linux/eal/eal_vfio.c: In function ‘vfio_open_group_fd’:
/home/jerin/dpdk.org/lib/librte_eal/linux/eal/eal_vfio.c:268:28: warning: cast increases required alignment of target type [-Wcast-align]
  struct vfio_mp_param *p = (struct vfio_mp_param *)mp_req.param;
                            ^
/home/jerin/dpdk.org/lib/librte_eal/linux/eal/eal_vfio.c:315:7: warning: cast increases required alignment of target type [-Wcast-align]
   p = (struct vfio_mp_param *)mp_rep->param;
       ^
/home/jerin/dpdk.org/lib/librte_eal/linux/eal/eal_vfio.c: In function ‘vfio_sync_default_container’:
/home/jerin/dpdk.org/lib/librte_eal/linux/eal/eal_vfio.c:558:28: warning: cast increases required alignment of target type [-Wcast-align]
  struct vfio_mp_param *p = (struct vfio_mp_param *)mp_req.param;
                            ^
/home/jerin/dpdk.org/lib/librte_eal/linux/eal/eal_vfio.c:583:7: warning: cast increases required alignment of target type [-Wcast-align]
   p = (struct vfio_mp_param *)mp_rep->param;
       ^
/home/jerin/dpdk.org/lib/librte_eal/linux/eal/eal_vfio.c: In function ‘vfio_get_default_container_fd’:
/home/jerin/dpdk.org/lib/librte_eal/linux/eal/eal_vfio.c:1027:28: warning: cast increases required alignment of target type [-Wcast-align]
  struct vfio_mp_param *p = (struct vfio_mp_param *)mp_req.param;
                            ^
/home/jerin/dpdk.org/lib/librte_eal/linux/eal/eal_vfio.c:1048:7: warning: cast increases required alignment of target type [-Wcast-align]
   p = (struct vfio_mp_param *)mp_rep->param;
       ^
/home/jerin/dpdk.org/lib/librte_eal/linux/eal/eal_vfio.c: In function ‘rte_vfio_get_container_fd’:
/home/jerin/dpdk.org/lib/librte_eal/linux/eal/eal_vfio.c:1133:28: warning: cast increases required alignment of target type [-Wcast-align]
  struct vfio_mp_param *p = (struct vfio_mp_param *)mp_req.param;
                            ^
/home/jerin/dpdk.org/lib/librte_eal/linux/eal/eal_vfio.c:1179:7: warning: cast increases required alignment of target type [-Wcast-align]
   p = (struct vfio_mp_param *)mp_rep->param;
       ^
/home/jerin/dpdk.org/lib/librte_eal/linux/eal/eal_vfio.c: At top level:
cc1: error: unrecognized command line option ‘-Wno-address-of-packed-member’ [-Werror]
cc1: all warnings being treated as errors
make[5]: *** [/home/jerin/dpdk.org/mk/internal/rte.compile-pre.mk:116: eal_vfio.o] Error 1
make[4]: *** [/home/jerin/dpdk.org/mk/rte.subdir.mk:37: eal] Error 2
make[3]: *** [/home/jerin/dpdk.org/mk/rte.subdir.mk:37: linux] Error 2
make[2]: *** [/home/jerin/dpdk.org/mk/rte.subdir.mk:37: librte_eal] Error 2
make[1]: *** [/home/jerin/dpdk.org/mk/rte.sdkbuild.mk:48: lib] Error 2
make: *** [/home/jerin/dpdk.org/mk/rte.sdkroot.mk:99: all] Error 2




> 
> /Bruce

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

* Re: [dpdk-dev] [EXT] Re: [PATCH] mk: disable warning with gcc 9 on Fedora 30
  2019-05-03 17:24         ` [dpdk-dev] [EXT] " Jerin Jacob Kollanukkaran
@ 2019-05-03 17:24           ` Jerin Jacob Kollanukkaran
  0 siblings, 0 replies; 36+ messages in thread
From: Jerin Jacob Kollanukkaran @ 2019-05-03 17:24 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: Thomas Monjalon, Reshma Pattan, dev, David Marchand, viktorin,
	Gavin Hu (Arm Technology China)

> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Friday, May 3, 2019 9:55 PM
> To: Jerin Jacob Kollanukkaran <jerinj@marvell.com>
> Cc: Thomas Monjalon <thomas@monjalon.net>; Reshma Pattan
> <reshma.pattan@intel.com>; dev@dpdk.org; David Marchand
> <david.marchand@redhat.com>; viktorin@rehivetech.com; Gavin Hu (Arm
> Technology China) <Gavin.Hu@arm.com>
> Subject: [EXT] Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora
> On Fri, May 03, 2019 at 04:01:38PM +0000, Jerin Jacob Kollanukkaran wrote:
> > > -----Original Message-----
> > > From: dev <dev-bounces@dpdk.org> On Behalf Of Thomas Monjalon
> > > Sent: Thursday, May 2, 2019 9:27 PM
> > > To: Reshma Pattan <reshma.pattan@intel.com>
> > > Cc: dev@dpdk.org; David Marchand <david.marchand@redhat.com>
> > > Subject: Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on
> > > Fedora 30
> > >
> > > 02/05/2019 17:00, David Marchand:
> > > > On Thu, May 2, 2019 at 11:33 AM Reshma Pattan
> > > > <reshma.pattan@intel.com>
> > > > wrote:
> > > >
> > > > > gcc 9 on Fedora 30 gives an error "taking address of packed
> > > > > member may result in an unaligned pointer value" warnings.
> > > > >
> > > > > For clang builds this warning is already disabled, so disable
> > > > > "-Waddress-of-packed-member" for gcc builds also.
> > > > >
> > > > > Snippet of build error:
> > > > > ...lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’:
> > > > > ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking
> > > > > address of packed member of ‘struct rte_mem_config’ may result
> > > > > in an unaligned pointer value [-Werror=address-of-packed-member]
> > > > >   768 |  cur_msl = &mcfg->memsegs[msl_idx];
> > > > >       |            ^~~~~~~~~~~~~~~~~~~~~~~
> > > > >
> > > > > Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
> > > > >
> > > > >
> > > > Tested on rhel-7 and fedora-30.
> > > > Tested-by: David Marchand <david.marchand@redhat.com>
> > >
> > > Applied, thanks
> >
> > Its been found that one of the armv7 toolchain treats
> > -Wno-address-of-packed-member as unrecognized command line option,
> > Hence armv7 build fails on dpdk.org master now. Not sure it is specific to
> armv7 or compiler?
> >
> > Armv7 is not maintained and I don’t think, it has any use case for DPDK.
> > If everyone agrees IMO it is better remove the arm 32bit support.
> >
> >     arm-buildroot-linux-gnueabihf-gcc -v
> >     Using built-in specs.
> >     COLLECT_GCC=/opt/armv7-eabihf--glibc--stable-2018.11-1/
> >     bin/arm-buildroot-linux-gnueabihf-gcc.br_real
> >     COLLECT_LTO_WRAPPER=/opt/armv7-eabihf--glibc--stable-2018.11-1/
> >     libexec/gcc/arm-buildroot-linux-gnueabihf/7.3.0/lto-wrapper
> >     Target: arm-buildroot-linux-gnueabihf
> >     Configured with: ./configure
> >     --prefix=/opt/armv7-eabihf--glibc--stable-2018.11-1
> >     --sysconfdir=/opt/armv7-eabihf--glibc--stable-2018.11-1/etc
> >     --enable-static --target=arm-buildroot-linux-gnueabihf
> >     --with-sysroot=/opt/armv7-eabihf--glibc--stable-2018.11-1/
> >     arm-buildroot-linux-gnueabihf/sysroot
> >     --disable-__cxa_atexit --with-gnu-ld --disable-libssp --disable-multilib
> >     --with-gmp=/opt/armv7-eabihf--glibc--stable-2018.11-1
> >     --with-mpc=/opt/armv7-eabihf--glibc--stable-2018.11-1
> >     --with-mpfr=/opt/armv7-eabihf--glibc--stable-2018.11-1
> >     --with-pkgversion='Buildroot 2018.08.1-00003-g576b333'
> >     --with-bugurl=http://bugs.buildroot.net/ --disable-libquadmath
> >     --enable-tls --disable-libmudflap --enable-threads --without-isl
> >     --without-cloog --disable-decimal-float --with-abi=aa
> >     pcs-linux --with-cpu=cortex-a9 --with-fpu=vfpv3-d16 --with-float=hard
> >     --with-mode=arm --enable-languages=c,c++
> >     --with-build-time-tools=/opt/armv7-eabihf--glibc--stable-2018.11-1/
> >     arm-buildroot-linux-gnueabihf/bin --enable-shared --disable-libgomp
> >     Thread model: posix
> >     gcc version 7.3.0 (Buildroot 2018.08.1-00003-g576b333)
> >
> >     error log:
> >
> >     dpdk.org/lib/librte_eal/linux/eal/eal_vfio_mp_sync.c: At top level:
> >     cc1: error: unrecognized command line option
> >     ‘-Wno-address-of-packed-member’ [-Werror]
> >     cc1: all warnings being treated as errors
> >
> 
> Are you sure there is not another error as well? GCC silently ignores flags like
> this one normally, but does report them as unrecognised if-and-only-if another
> error or warning is given too.

That’s explains reason for error for armv7(the file has other warnings). 
There are plenty of warning for armv7 port. That is the one reason why, I think, we need to remove
Armv7 port if there is no end user for it. It just  a pain to maintain it.

arm-buildroot-linux-gnueabihf-gcc -Wp,-MD,./.eal_vfio.o.d.tmp  -marm -munaligned-access -pthread -I/home/jerin/dpdk.org/lib/librte_eal/linux/eal/include  -march=armv7-a -mtune=cortex-a9 -mfpu
=neon -DRTE_MACHINE_CPUFLAG_NEON  -I/home/jerin/dpdk.org/build/include -include /home/jerin/dpdk.org/build/include/rte_config.h -D_GNU_SOURCE -DALLOW_EXPERIMENTAL_API -I/home/jerin/dpdk.org/l
ib/librte_eal/linux/eal/include -I/home/jerin/dpdk.org/lib/librte_eal/common -I/home/jerin/dpdk.org/lib/librte_eal/common/include -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-d
eclarations -Wold-style-definition -Wpointer-arith -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral -Wformat-security -Wundef -Wwrite-strings -Wdeprecated -Werror -Wno-error=cast
-align -Wimplicit-fallthrough=2 -Wno-format-truncation -Wno-address-of-packed-member -O3    -o eal_vfio.o -c /home/jerin/dpdk.org/lib/librte_eal/linux/eal/eal_vfio.c
/home/jerin/dpdk.org/lib/librte_eal/linux/eal/eal_vfio.c: In function ‘vfio_open_group_fd’:
/home/jerin/dpdk.org/lib/librte_eal/linux/eal/eal_vfio.c:268:28: warning: cast increases required alignment of target type [-Wcast-align]
  struct vfio_mp_param *p = (struct vfio_mp_param *)mp_req.param;
                            ^
/home/jerin/dpdk.org/lib/librte_eal/linux/eal/eal_vfio.c:315:7: warning: cast increases required alignment of target type [-Wcast-align]
   p = (struct vfio_mp_param *)mp_rep->param;
       ^
/home/jerin/dpdk.org/lib/librte_eal/linux/eal/eal_vfio.c: In function ‘vfio_sync_default_container’:
/home/jerin/dpdk.org/lib/librte_eal/linux/eal/eal_vfio.c:558:28: warning: cast increases required alignment of target type [-Wcast-align]
  struct vfio_mp_param *p = (struct vfio_mp_param *)mp_req.param;
                            ^
/home/jerin/dpdk.org/lib/librte_eal/linux/eal/eal_vfio.c:583:7: warning: cast increases required alignment of target type [-Wcast-align]
   p = (struct vfio_mp_param *)mp_rep->param;
       ^
/home/jerin/dpdk.org/lib/librte_eal/linux/eal/eal_vfio.c: In function ‘vfio_get_default_container_fd’:
/home/jerin/dpdk.org/lib/librte_eal/linux/eal/eal_vfio.c:1027:28: warning: cast increases required alignment of target type [-Wcast-align]
  struct vfio_mp_param *p = (struct vfio_mp_param *)mp_req.param;
                            ^
/home/jerin/dpdk.org/lib/librte_eal/linux/eal/eal_vfio.c:1048:7: warning: cast increases required alignment of target type [-Wcast-align]
   p = (struct vfio_mp_param *)mp_rep->param;
       ^
/home/jerin/dpdk.org/lib/librte_eal/linux/eal/eal_vfio.c: In function ‘rte_vfio_get_container_fd’:
/home/jerin/dpdk.org/lib/librte_eal/linux/eal/eal_vfio.c:1133:28: warning: cast increases required alignment of target type [-Wcast-align]
  struct vfio_mp_param *p = (struct vfio_mp_param *)mp_req.param;
                            ^
/home/jerin/dpdk.org/lib/librte_eal/linux/eal/eal_vfio.c:1179:7: warning: cast increases required alignment of target type [-Wcast-align]
   p = (struct vfio_mp_param *)mp_rep->param;
       ^
/home/jerin/dpdk.org/lib/librte_eal/linux/eal/eal_vfio.c: At top level:
cc1: error: unrecognized command line option ‘-Wno-address-of-packed-member’ [-Werror]
cc1: all warnings being treated as errors
make[5]: *** [/home/jerin/dpdk.org/mk/internal/rte.compile-pre.mk:116: eal_vfio.o] Error 1
make[4]: *** [/home/jerin/dpdk.org/mk/rte.subdir.mk:37: eal] Error 2
make[3]: *** [/home/jerin/dpdk.org/mk/rte.subdir.mk:37: linux] Error 2
make[2]: *** [/home/jerin/dpdk.org/mk/rte.subdir.mk:37: librte_eal] Error 2
make[1]: *** [/home/jerin/dpdk.org/mk/rte.sdkbuild.mk:48: lib] Error 2
make: *** [/home/jerin/dpdk.org/mk/rte.sdkroot.mk:99: all] Error 2




> 
> /Bruce

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

end of thread, other threads:[~2019-05-03 17:24 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-02  9:33 [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30 Reshma Pattan
2019-05-02  9:33 ` Reshma Pattan
2019-05-02 10:07 ` David Marchand
2019-05-02 10:07   ` David Marchand
2019-05-02 13:26   ` Bruce Richardson
2019-05-02 13:26     ` Bruce Richardson
2019-05-02 13:30     ` David Marchand
2019-05-02 13:30       ` David Marchand
2019-05-02 13:35       ` Pattan, Reshma
2019-05-02 13:35         ` Pattan, Reshma
2019-05-02 14:13 ` [dpdk-dev] [PATCH v2] mk: report address of packed member as warning Reshma Pattan
2019-05-02 14:13   ` Reshma Pattan
2019-05-02 14:24   ` David Marchand
2019-05-02 14:24     ` David Marchand
2019-05-02 14:41     ` Bruce Richardson
2019-05-02 14:41       ` Bruce Richardson
2019-05-02 14:48       ` David Marchand
2019-05-02 14:48         ` David Marchand
2019-05-02 15:53   ` Burakov, Anatoly
2019-05-02 15:53     ` Burakov, Anatoly
2019-05-02 18:54     ` Stephen Hemminger
2019-05-02 18:54       ` Stephen Hemminger
2019-05-03  7:56       ` Burakov, Anatoly
2019-05-03  7:56         ` Burakov, Anatoly
2019-05-02 15:00 ` [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30 David Marchand
2019-05-02 15:00   ` David Marchand
2019-05-02 15:56   ` Thomas Monjalon
2019-05-02 15:56     ` Thomas Monjalon
2019-05-03 16:01     ` Jerin Jacob Kollanukkaran
2019-05-03 16:01       ` Jerin Jacob Kollanukkaran
2019-05-03 16:25       ` Bruce Richardson
2019-05-03 16:25         ` Bruce Richardson
2019-05-03 16:28         ` Richardson, Bruce
2019-05-03 16:28           ` Richardson, Bruce
2019-05-03 17:24         ` [dpdk-dev] [EXT] " Jerin Jacob Kollanukkaran
2019-05-03 17:24           ` Jerin Jacob Kollanukkaran

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).