From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 7F23A1B6F4 for ; Tue, 3 Apr 2018 12:55:29 +0200 (CEST) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Apr 2018 03:55:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,400,1517904000"; d="scan'208";a="44497695" Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.51]) by orsmga001.jf.intel.com with SMTP; 03 Apr 2018 03:55:25 -0700 Received: by (sSMTP sendmail emulation); Tue, 03 Apr 2018 11:55:24 +0100 Date: Tue, 3 Apr 2018 11:55:24 +0100 From: Bruce Richardson To: Pavan Nikhilesh Cc: thomas@monjalon.net, jerin.jacob@caviumnetworks.com, dev@dpdk.org Message-ID: <20180403105524.GA3544@bricha3-MOBL.ger.corp.intel.com> References: <20180402182823.30688-1-pbhagavatula@caviumnetworks.com> <20180403102110.9507-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180403102110.9507-1-pbhagavatula@caviumnetworks.com> Organization: Intel Research and Development Ireland Ltd. User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH v2] build: meson set toolchain info during config init 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: , X-List-Received-Date: Tue, 03 Apr 2018 10:55:30 -0000 On Tue, Apr 03, 2018 at 03:51:10PM +0530, Pavan Nikhilesh wrote: > Meson set RTE_TOOLCHAIN to clang/gcc and set RTE_TOOLCHAIN_CLANG/GCC to > 1 during initilizing dpdk_conf so that it can be used by both x86 and arm. > > Signed-off-by: Pavan Nikhilesh > --- > > v2 Changes: > - Use get_id for identifying compiler instead of checking for compiler defines > manually.(Bruce) > > config/arm/meson.build | 9 --------- > config/meson.build | 8 ++++++++ > 2 files changed, 8 insertions(+), 9 deletions(-) > > diff --git a/config/arm/meson.build b/config/arm/meson.build > index c1ab6ed01..e9c9eb1a5 100644 > --- a/config/arm/meson.build > +++ b/config/arm/meson.build > @@ -83,15 +83,6 @@ impl_0x69 = ['Intel', flags_generic, machine_args_generic] > impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_generic] > impl_dpaa2 = ['NXP DPAA2', flags_dpaa2, machine_args_generic] > > - > -if cc.get_define('__clang__') != '' > - dpdk_conf.set_quoted('RTE_TOOLCHAIN', 'clang') > - dpdk_conf.set('RTE_TOOLCHAIN_CLANG', 1) > -else > - dpdk_conf.set_quoted('RTE_TOOLCHAIN', 'gcc') > - dpdk_conf.set('RTE_TOOLCHAIN_GCC', 1) > -endif > - > dpdk_conf.set('RTE_FORCE_INTRINSICS', 1) > > if cc.sizeof('void *') != 8 > diff --git a/config/meson.build b/config/meson.build > index f8c67578d..b8f953b54 100644 > --- a/config/meson.build > +++ b/config/meson.build > @@ -11,6 +11,14 @@ dpdk_conf.set('RTE_MACHINE', machine) > machine_args = [] > machine_args += '-march=' + machine > > +if cc.get_id() == 'clang' > + dpdk_conf.set_quoted('RTE_TOOLCHAIN', 'clang') > + dpdk_conf.set('RTE_TOOLCHAIN_CLANG', 1) > +elif cc.get_id() == 'gcc' > + dpdk_conf.set_quoted('RTE_TOOLCHAIN', 'gcc') > + dpdk_conf.set('RTE_TOOLCHAIN_GCC', 1) > +endif > + What about: toolchain = cc.get_id() dpdk_conf.set_quoted('RTE_TOOLCHAIN', toolchain) dpdk_conf.set('RTE_TOOLCHAIN_' + toolchain.to_upper()) It will give the exact same result for GCC and CLANG and save us having to update in future for other compilers. The one potential gotcha is that for ICC, it's going to report "intel" instead of "icc". However, from use of grep, it appears that we don't ever check for icc except in the makefiles, so having it reported as "intel" for meson builds should not be a problem. [If it is a problem later on we can always put in a special case: if toolchain == 'intel'; toolchain = 'icc']. /Bruce