From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 394F3A10DA for ; Wed, 31 Jul 2019 16:30:49 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 917361C0C8; Wed, 31 Jul 2019 16:30:47 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 33D061C06D; Wed, 31 Jul 2019 16:30:44 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Jul 2019 07:30:41 -0700 X-IronPort-AV: E=Sophos;i="5.64,330,1559545200"; d="scan'208";a="172462215" Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.61]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Jul 2019 07:30:40 -0700 Date: Wed, 31 Jul 2019 15:30:37 +0100 From: Bruce Richardson To: Neil Horman Cc: pbhagavatula@marvell.com, jerinj@marvell.com, dev@dpdk.org, stable@dpdk.org Message-ID: <20190731143037.GE1705@bricha3-MOBL.ger.corp.intel.com> References: <20190731062706.931-1-pbhagavatula@marvell.com> <20190731113503.GB9823@hmswarspite.think-freely.org> <20190731142145.GC1705@bricha3-MOBL.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190731142145.GC1705@bricha3-MOBL.ger.corp.intel.com> User-Agent: Mutt/1.11.4 (2019-03-13) Subject: Re: [dpdk-dev] [PATCH] buildtools: fix pmdinfogen compilation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list 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 Wed, Jul 31, 2019 at 03:21:46PM +0100, Bruce Richardson wrote: > On Wed, Jul 31, 2019 at 07:35:03AM -0400, Neil Horman wrote: > > On Wed, Jul 31, 2019 at 11:57:05AM +0530, pbhagavatula@marvell.com wrote: > > > From: Pavan Nikhilesh > > > > > > Pmdinfogen is always compiled with host gcc. > > > If host gcc version is lessthan 7 and target gcc is greaterthan 7 > > > pmdinfogen fails to compile due to unsupported cflags. > > > This patch removes unsupported host cflags when the above condition is > > > met. > > > > > > Fixes: 98b0fdb0ffc6 ("pmdinfogen: add buildtools and pmdinfogen utility") > > > Cc: stable@dpdk.org > > > > > > Signed-off-by: Pavan Nikhilesh > > > --- > > > buildtools/pmdinfogen/Makefile | 8 ++++++++ > > > 1 file changed, 8 insertions(+) > > > > > > diff --git a/buildtools/pmdinfogen/Makefile b/buildtools/pmdinfogen/Makefile > > > index a97a7648f..86f883e05 100644 > > > --- a/buildtools/pmdinfogen/Makefile > > > +++ b/buildtools/pmdinfogen/Makefile > > > @@ -9,6 +9,14 @@ include $(RTE_SDK)/mk/rte.vars.mk > > > # > > > HOSTAPP = dpdk-pmdinfogen > > > > > > +HOST_GCC_MAJOR = $(shell echo __GNUC__ | $(HOSTCC) -E -x c - | tail -n 1) > > > +HOST_GCC_MINOR = $(shell echo __GNUC_MINOR__ | $(HOSTCC) -E -x c - | tail -n 1) > > > +HOST_GCC_VERSION = $(HOST_GCC_MAJOR)$(HOST_GCC_MINOR) > > > + > > > +ifeq ($(shell test $(HOST_GCC_VERSION) -gt 70 && echo 1), 1) > > > +HOST_WERROR_FLAGS = $(filter-out -Wimplicit-fallthrough=2, $(WERROR_FLAGS)) > > > +endif > > > + > > > > A few things: > > > > 1) HOST_GCC_MAJOR and HOST_GCC_MINOR seem to already be computed in > > rte.toolchain-compat.mk and so I don't think you need to recompute them here > > > > 2) This seems limited in its function. That is to say, ostensibly there are > > simmilar incompatibilities with icc and clang that may need addressing for which > > there are different environment variables (CLANG_MAJOR_VERSION, etc) > > > > 3) This may also need to be reflected into the meson build environment > > Initially I though that meson cross-compilation support would make this a > non-issue, but looking into it further it could theoretically be a problem > with meson too. Where the issue would arise is where we use > "add_project_arguments()" in "config/meson.build" for the cflags. When > adding those flags we only check the standard compiler, which would be the > cross-compiler in the cross compilation case. Unfortunately, I don't > believe that meson supports setting project options only for native or > non-native compiles - it assumes that per-project arguments are really > global to that whole project, and expect you to specify them per-target if > not. > > To fix this possible issue for cross-compilation, what we really need to do > in to get the native compiler too (using "meson.get_compiler('c', native: > 'true')") and check that the cflags are valid for it also. In case of a > flag that is supported by one compiler but not the other, the flag would be > omitted, which means that instead of a compiler error we should instead get > an error with reduced warning flags. (I'm assuming that it's only the > warnings need adjusting here - any compiler that doesn't support > "-D" syntax just won't work anyway, I suspect :-)) > > I'll see if I can do up a quick patch to fix this for meson. > Actually, looks like I sent the reply too quickly and I may be incorrect here. Checking the build.ninja file for a cross-build for arm64-armv8, I already see different flags for pmdinfogen and other objects, so looks to me like no issue after all. [This is with meson v0.51]. /Bruce