* Re: [dpdk-dev] [dpdk-stable] [PATCH v5 1/2] mk: fix cross build errors
@ 2018-05-30 2:45 Gavin Hu
2018-05-30 8:32 ` Thomas Monjalon
0 siblings, 1 reply; 5+ messages in thread
From: Gavin Hu @ 2018-05-30 2:45 UTC (permalink / raw)
To: Bruce Richardson, Thomas Monjalon; +Cc: dev
> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Tuesday, May 29, 2018 11:00 PM
> To: Thomas Monjalon <thomas@monjalon.net>
> Cc: Gavin Hu <Gavin.Hu@arm.com>; dev@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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [dpdk-stable] [PATCH v5 1/2] mk: fix cross build errors
2018-05-30 2:45 [dpdk-dev] [dpdk-stable] [PATCH v5 1/2] mk: fix cross build errors Gavin Hu
@ 2018-05-30 8:32 ` Thomas Monjalon
2018-05-30 9:41 ` Gavin Hu
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Monjalon @ 2018-05-30 8:32 UTC (permalink / raw)
To: Gavin Hu; +Cc: Bruce Richardson, dev
30/05/2018 04:45, Gavin Hu:
> From: Bruce Richardson <bruce.richardson@intel.com>
> > 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.
Now I understand what we missed from the beginning: I am testing with meson.
This flag is added unconditionnaly in config/meson.build.
> @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?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [dpdk-stable] [PATCH v5 1/2] mk: fix cross build errors
2018-05-30 8:32 ` Thomas Monjalon
@ 2018-05-30 9:41 ` Gavin Hu
2018-05-30 10:18 ` Thomas Monjalon
0 siblings, 1 reply; 5+ messages in thread
From: Gavin Hu @ 2018-05-30 9:41 UTC (permalink / raw)
To: Thomas Monjalon, Bruce Richardson; +Cc: dev
> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Wednesday, May 30, 2018 4:32 PM
> To: Gavin Hu <Gavin.Hu@arm.com>
> Cc: Bruce Richardson <bruce.richardson@intel.com>; dev@dpdk.org
> Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v5 1/2] mk: fix cross build
> errors
>
> 30/05/2018 04:45, Gavin Hu:
> > From: Bruce Richardson <bruce.richardson@intel.com>
> > > 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.
>
> Now I understand what we missed from the beginning: I am testing with
> meson.
> This flag is added unconditionnaly in config/meson.build.
[Gavin Hu] Hi Thomas and Bruce, then do you have more comments on the v5 patch?
Any comments are welcome, if no, can you act the patches for merging?
>
> > @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?
>
>
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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [dpdk-stable] [PATCH v5 1/2] mk: fix cross build errors
2018-05-30 9:41 ` Gavin Hu
@ 2018-05-30 10:18 ` Thomas Monjalon
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2018-05-30 10:18 UTC (permalink / raw)
To: Gavin Hu; +Cc: Bruce Richardson, dev
30/05/2018 11:41, Gavin Hu:
> From: Thomas Monjalon <thomas@monjalon.net>
> > 30/05/2018 04:45, Gavin Hu:
> > > From: Bruce Richardson <bruce.richardson@intel.com>
> > > > 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.
> >
> > Now I understand what we missed from the beginning: I am testing with
> > meson.
> > This flag is added unconditionnaly in config/meson.build.
>
> [Gavin Hu] Hi Thomas and Bruce, then do you have more comments on the v5 patch?
> Any comments are welcome, if no, can you act the patches for merging?
Of course we have comments!
I keep telling you that compilation is not working.
Try meson compilation: devtools/test-meson-builds.sh
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH v4 0/2] *** cross gcc fix and guide doc ***
@ 2018-05-29 7:21 Gavin Hu
2018-05-29 10:43 ` [dpdk-dev] [PATCH v5 0/2] *** cross gcc compile fix and add a " Gavin Hu
0 siblings, 1 reply; 5+ messages in thread
From: Gavin Hu @ 2018-05-29 7:21 UTC (permalink / raw)
To: dev; +Cc: gavin.hu
*** 1. Simply use -Wnoimplicit-fallthrough for pmdinfogen, other than gcc version check. ***
*** 2. Make the doc in the correct format ***
*** 3. Correct the rst index file ***
Gavin Hu (2):
mk: fix cross build errors
doc: add a guide doc for cross compiling from x86
buildtools/pmdinfogen/Makefile | 2 +-
.../linux_gsg/cross_build_dpdk_for_arm64.rst | 125 +++++++++++++++++++++
doc/guides/linux_gsg/index.rst | 1 +
3 files changed, 127 insertions(+), 1 deletion(-)
create mode 100644 doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
--
2.1.4
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH v5 0/2] *** cross gcc compile fix and add a guide doc ***
2018-05-29 7:21 [dpdk-dev] [PATCH v4 0/2] *** cross gcc fix and guide doc *** Gavin Hu
@ 2018-05-29 10:43 ` Gavin Hu
2018-05-29 10:43 ` [dpdk-dev] [PATCH v5 1/2] mk: fix cross build errors Gavin Hu
0 siblings, 1 reply; 5+ messages in thread
From: Gavin Hu @ 2018-05-29 10:43 UTC (permalink / raw)
To: dev; +Cc: gavin.hu
*** Correct two spelling errors in the doc ***
Gavin Hu (2):
mk: fix cross build errors
doc: add a guide doc for cross compiling from x86
buildtools/pmdinfogen/Makefile | 2 +-
.../linux_gsg/cross_build_dpdk_for_arm64.rst | 125 +++++++++++++++++++++
doc/guides/linux_gsg/index.rst | 1 +
3 files changed, 127 insertions(+), 1 deletion(-)
create mode 100644 doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
--
2.1.4
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH v5 1/2] mk: fix cross build errors
2018-05-29 10:43 ` [dpdk-dev] [PATCH v5 0/2] *** cross gcc compile fix and add a " Gavin Hu
@ 2018-05-29 10:43 ` Gavin Hu
2018-05-29 15:09 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
0 siblings, 1 reply; 5+ messages in thread
From: Gavin Hu @ 2018-05-29 10:43 UTC (permalink / raw)
To: dev; +Cc: gavin.hu, stable
The "-Wimplicit-fallthrough=2" option was introduced into gcc 7.0, it was
enabled when the cross compiler gcc is greater than 7.0, but for the host
side buildtools/pmdinfogen, if the native is older than 7.0, it should not
be enabled.
The fix is to simply enable -Wnoimplicit-fallthrough for pmdinfogen.
gcc -Wp,-MD,./.pmdinfogen.o.d.tmp -W -Wall -Wstrict-prototypes
-Wmissing-prototypes -Wmissing-declarations -Wold-style-definition
-Wpointer-arith -Wcast-align -Wnested-externs -Wcast-qual
-Wformat-nonliteral -Wformat-security -Wundef -Wwrite-strings -Wdeprecated
-Werror -Wimplicit-fallthrough=2 -Dbbb -Wno-format-truncation -g
-I/home/gavin/arm_repo/dpdk/build/include -o pmdinfogen.o -c
~/dpdk/buildtools/pmdinfogen/pmdinfogen.c gcc: error:
unrecognized command line option ‘-Wimplicit-fallthrough=2’
~/dpdk/mk/internal/rte.compile-pre.mk:114: recipe for target 'pmdinfogen.o'
failed make[3]: *** [pmdinfogen.o] Error 1
Fixes: ced3e6f8 ("mk: adjust gcc flags for new gcc 7 warnings")
Cc: stable@dpdk.org
Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
Reviewed-by: Steve Capper <Steve.Capper@arm.com>
Reviewed-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
---
buildtools/pmdinfogen/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/buildtools/pmdinfogen/Makefile b/buildtools/pmdinfogen/Makefile
index bf07b6f..8ee6427 100644
--- a/buildtools/pmdinfogen/Makefile
+++ b/buildtools/pmdinfogen/Makefile
@@ -41,7 +41,7 @@ HOSTAPP = dpdk-pmdinfogen
#
SRCS-y += pmdinfogen.c
-HOST_CFLAGS += $(WERROR_FLAGS) -g
+HOST_CFLAGS += -Wno-implicit-fallthrough $(WERROR_FLAGS) -g
HOST_CFLAGS += -I$(RTE_OUTPUT)/include
include $(RTE_SDK)/mk/rte.hostapp.mk
--
2.1.4
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-05-30 10:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-30 2:45 [dpdk-dev] [dpdk-stable] [PATCH v5 1/2] mk: fix cross build errors Gavin Hu
2018-05-30 8:32 ` Thomas Monjalon
2018-05-30 9:41 ` Gavin Hu
2018-05-30 10:18 ` Thomas Monjalon
-- strict thread matches above, loose matches on Subject: below --
2018-05-29 7:21 [dpdk-dev] [PATCH v4 0/2] *** cross gcc fix and guide doc *** Gavin Hu
2018-05-29 10:43 ` [dpdk-dev] [PATCH v5 0/2] *** cross gcc compile fix and add a " Gavin Hu
2018-05-29 10:43 ` [dpdk-dev] [PATCH v5 1/2] mk: fix cross build errors Gavin Hu
2018-05-29 15:09 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
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).