[dpdk-dev] [dpdk-stable] [PATCH v5 1/2] mk: fix cross build errors

Gavin Hu Gavin.Hu at arm.com
Wed May 30 04:45:19 CEST 2018



> -----Original Message-----
> From: Bruce Richardson <bruce.richardson at intel.com>
> Sent: Tuesday, May 29, 2018 11:00 PM
> To: Thomas Monjalon <thomas at monjalon.net>
> Cc: Gavin Hu <Gavin.Hu at arm.com>; dev at dpdk.org
> Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v2 1/2] mk: fix cross build
> errors
>
> On Tue, May 29, 2018 at 04:45:55PM +0200, Thomas Monjalon wrote:
> > 28/05/2018 15:24, Bruce Richardson:
> > > Would a simpler solution for this not be to put "-Wno-implicit-
> fallthrough"
> > > for pmdinfogen? GCC will not give a warning for an unrecognised "-Wno"
> > > flag when compiling, unless there are other errors. This means we
> > > can just use the flag without bothering with version checks.
> >
> > No, it does not work.
> > I have this error with clang 5.0.1:
> >     error: unknown warning option '-Wno-format-truncation'
> >
> Yes, you still need to check for GCC to use the flag, just not for a specific
> version of GCC.
>
> /Bruce
[Gavin Hu] Hi Thomas, '-Wno-format-truncation' is applied to gcc only, not to clang.
Gcc, icc and clang have their own WERROR_FLAGS, they should not mix up with each other.

@Bruce,
Yes, in this sense, I am really concerned about to add -Wno-implicit-fallthrough option in the pmdinfogen Makefile, as it impacts not only gcc, but also clang and icc.
Maybe this not a best solution, as maybe it is not supported by all compilers. So should I fall back to the previous patch which check for the gcc version and apply the options for gcc only?

toolchain/clang/rte.vars.mk:38:WERROR_FLAGS := -W -Wall -Wstrict-prototypes -Wmissing-prototypes
toolchain/clang/rte.vars.mk:39:WERROR_FLAGS += -Wmissing-declarations -Wold-style-definition -Wpointer-arith
toolchain/clang/rte.vars.mk:40:WERROR_FLAGS += -Wnested-externs -Wcast-qual
toolchain/clang/rte.vars.mk:41:WERROR_FLAGS += -Wformat-nonliteral -Wformat-security
toolchain/clang/rte.vars.mk:42:WERROR_FLAGS += -Wundef -Wwrite-strings -Wdeprecated
toolchain/clang/rte.vars.mk:45:WERROR_FLAGS += -Werror
toolchain/clang/rte.vars.mk:52:WERROR_FLAGS += -Wno-missing-field-initializers
toolchain/clang/rte.vars.mk:56:WERROR_FLAGS += -Wno-address-of-packed-member
toolchain/gcc/rte.vars.mk:46:WERROR_FLAGS := -W -Wall -Wstrict-prototypes -Wmissing-prototypes
toolchain/gcc/rte.vars.mk:47:WERROR_FLAGS += -Wmissing-declarations -Wold-style-definition -Wpointer-arith
toolchain/gcc/rte.vars.mk:48:WERROR_FLAGS += -Wcast-align -Wnested-externs -Wcast-qual
toolchain/gcc/rte.vars.mk:49:WERROR_FLAGS += -Wformat-nonliteral -Wformat-security
toolchain/gcc/rte.vars.mk:50:WERROR_FLAGS += -Wundef -Wwrite-strings -Wdeprecated
toolchain/gcc/rte.vars.mk:53:WERROR_FLAGS += -Werror
toolchain/gcc/rte.vars.mk:59:WERROR_FLAGS += -Wno-error=cast-align
toolchain/gcc/rte.vars.mk:67:WERROR_FLAGS += -Wno-missing-field-initializers
toolchain/gcc/rte.vars.mk:71:WERROR_FLAGS += -Wno-uninitialized
toolchain/gcc/rte.vars.mk:76:WERROR_FLAGS += -Wimplicit-fallthrough=2
toolchain/gcc/rte.vars.mk:78:WERROR_FLAGS += -Wno-format-truncation

I tried at my side with clang-3.5 on X86 and clang-6.0 on ARM64. The buildings were successful. Unfortunately I did not have clang-5.0 machines.
clang -Wp,-MD,./.pmdinfogen.o.d.tmp  -Wno-implicit-fallthrough -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -Wpointer-arith -Wnested-externs -Wcast-qual -Wformat-nonliteral -Wformat-security -Wundef -Wwrite-strings -Wdeprecated -Werror -Wno-missing-field-initializers -g -I/home/gavin/community/dpdk/build/include    -o pmdinfogen.o -c /home/gavin/community/dpdk/buildtools/pmdinfogen/pmdinfogen.c

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


More information about the dev mailing list