From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bruce Richardson Subject: Re: [PATCH v2 1/2] mk: fix cross build errors Date: Mon, 28 May 2018 14:24:02 +0100 Message-ID: <20180528132402.GC8752@bricha3-MOBL.ger.corp.intel.com> References: <1527133127-29407-1-git-send-email-gavin.hu@arm.com> <1527490428-15540-1-git-send-email-gavin.hu@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: dev@dpdk.org, stable@dpdk.org To: Gavin Hu Return-path: Content-Disposition: inline In-Reply-To: <1527490428-15540-1-git-send-email-gavin.hu@arm.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, May 28, 2018 at 02:53:47AM -0400, Gavin Hu wrote: > 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 differentiate the host gcc Werror options from the cross gcc. > > 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 > Reviewed-by: Honnappa Nagarahalli > Reviewed-by: Steve Capper > Reviewed-by: Thomas Monjalon > --- 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. /Bruce