From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavan Nikhilesh Subject: Re: [PATCH] build: meson set toolchain info during config init Date: Tue, 3 Apr 2018 15:37:56 +0530 Message-ID: <20180403100755.GA8587@ltp-pvn> References: <20180402182823.30688-1-pbhagavatula@caviumnetworks.com> <20180403095508.GA32@bricha3-MOBL.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org To: Bruce Richardson , thomas@monjalon.net, jerin.jacob@caviumnetworks.com Return-path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0065.outbound.protection.outlook.com [104.47.32.65]) by dpdk.org (Postfix) with ESMTP id 606E51B68B for ; Tue, 3 Apr 2018 12:08:21 +0200 (CEST) Content-Disposition: inline In-Reply-To: <20180403095508.GA32@bricha3-MOBL.ger.corp.intel.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 Tue, Apr 03, 2018 at 10:55:08AM +0100, Bruce Richardson wrote: > On Mon, Apr 02, 2018 at 11:58:23PM +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 > > --- > > 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..5994d7b7b 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_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 > > + > > Never thought to look this up on the original patchset, but looking at the > meson docs, the compiler object already had a "get_id" method to identify > the compiler. We can use it rather than use checking for explicit defines > ourselves. Using get_id() also allows us to identify icc and possibly > visual studio compiler for future windows compilation too. > > http://mesonbuild.com/Reference-tables.html#compiler-ids Good point will send v2 using get_id and multiple checks instead of else so that we can extend it in future. > > Regards, > /Bruce Thanks, Pavan.