[dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30
Richardson, Bruce
bruce.richardson at intel.com
Fri May 3 18:28:35 CEST 2019
> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Bruce Richardson
> Sent: Friday, May 3, 2019 5:25 PM
> To: Jerin Jacob Kollanukkaran <jerinj at 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 at dpdk.org> On Behalf Of Thomas Monjalon
> > > Sent: Thursday, May 2, 2019 9:27 PM
> > > To: Reshma Pattan <reshma.pattan at intel.com>
> > > Cc: dev at dpdk.org; David Marchand <david.marchand at 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 at 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 at intel.com>
> > > > >
> > > > >
> > > > Tested on rhel-7 and fedora-30.
> > > > Tested-by: David Marchand <david.marchand at 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."
More information about the dev
mailing list