From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 26206A0350; Mon, 28 Feb 2022 18:58:32 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1D3094068C; Mon, 28 Feb 2022 18:58:31 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 534D4411A7 for ; Mon, 28 Feb 2022 18:58:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646071109; x=1677607109; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=aENZHEyLaP7Am6zmtODo0tggSkncJOBI3Cp5kipAm8w=; b=ZoHd+2ZVeLniL8VyIlzpjC+Uu+u4gNY7GqDfhHr07SqbPUPBfgxpgSe1 L6m0FpiL9EjryYpvbk3OBJr8iPAs5AgmFMN5Vrq0wbD5f8VzBLRlUJfr8 sqIUzz52G3tJ8kmibmE21a+o888OGvRcrlr4YixtmK1d5QTxe5JGuG0jB D0rYAN2G3gkX1OfM6sL8Tx0bwktxtvc4RRi5PGgavROZ8SAymQVt7GwjJ cyQu/9sZ8nfWEFXroZUxrOdiT9rlrxaGQkY9FM2nTadLd5PYtPX5vx33O qtHhNVMpTG/tfoCGunsm3Kb6yJ1lTt6/gGchwxmyi1/C0VR127C0H/qJq Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10272"; a="316159921" X-IronPort-AV: E=Sophos;i="5.90,144,1643702400"; d="scan'208";a="316159921" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2022 09:55:03 -0800 X-IronPort-AV: E=Sophos;i="5.90,144,1643702400"; d="scan'208";a="550340773" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.27.47]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 28 Feb 2022 09:55:02 -0800 Date: Mon, 28 Feb 2022 17:54:59 +0000 From: Bruce Richardson To: aisha Cc: dev@dpdk.org Subject: Re: [patch] allow using standard ar from the build ini files instead of 'ar' string Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Mon, Feb 28, 2022 at 10:54:28AM -0500, aisha wrote: > Hi, > > I've attached a patch, from Gentoo, which uses the *ar* binary passed to > meson when available, instead of 'ar', which may not be available, for > instance when cross compiling, or having multiple gcc versions present, like > in Gentoo. > > This should not have any regressions, as when the binary is not available it > uses the same logic as the original. > > Aisha > > diff --git a/buildtools/meson.build b/buildtools/meson.build > index 400b88f251..d886bfb1dc 100644 > --- a/buildtools/meson.build > +++ b/buildtools/meson.build > @@ -24,15 +24,20 @@ binutils_avx512_check = (py3 + files('binutils-avx512-check.py') + > # select library and object file format > pmdinfo = py3 + files('gen-pmdinfo-cfile.py') + [meson.current_build_dir()] > pmdinfogen = py3 + files('pmdinfogen.py') > +ar = '' > +if cc.get_id() == 'gcc' or host_machine.system() != 'windows' This doesn't work correctly for FreeBSD, as we want to use llvm-ar by default there for clang builds. It should probably check explicitly for linux instead. > + ar = 'ar' > +else > + ar = 'llvm-ar' > +endif > +ar_bin = find_program('ar', required: false) > +if ar_bin.found() > + ar = ar_bin.full_path() > +endif This here looks wrong too. Even if clang is being used as a compiler and llvm-ar as a linker, this will still find the "ar" binary if present. > +pmdinfo += ar > if host_machine.system() == 'windows' > - if cc.get_id() == 'gcc' > - pmdinfo += 'ar' > - else > - pmdinfo += 'llvm-ar' > - endif > pmdinfogen += 'coff' > else > - pmdinfo += 'ar' > pmdinfogen += 'elf' > endif > > diff --git a/meson.build b/meson.build > index 937f6110c0..35650ab20d 100644 > --- a/meson.build > +++ b/meson.build > @@ -12,7 +12,7 @@ project('DPDK', 'C', > 'default_library=static', > 'warning_level=2', > ], > - meson_version: '>= 0.49.2' > + meson_version: '>= 0.55.0' > ) > > # check for developer mode