From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 2E2DF1B123 for ; Wed, 26 Sep 2018 11:45:45 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Sep 2018 02:45:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,305,1534834800"; d="scan'208";a="93837430" Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.107]) by orsmga001.jf.intel.com with SMTP; 26 Sep 2018 02:45:40 -0700 Received: by (sSMTP sendmail emulation); Wed, 26 Sep 2018 10:45:40 +0100 Date: Wed, 26 Sep 2018 10:45:39 +0100 From: Bruce Richardson To: dev@dpdk.org Cc: bluca@debian.org Message-ID: <20180926094539.GA18768@bricha3-MOBL.ger.corp.intel.com> References: <20180926091536.61370-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180926091536.61370-1-bruce.richardson@intel.com> Organization: Intel Research and Development Ireland Ltd. User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [dpdk-dev] [PATCH] build: set RTE_ARCH_64 based on pointer size 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: Wed, 26 Sep 2018 09:45:45 -0000 On Wed, Sep 26, 2018 at 10:15:36AM +0100, Bruce Richardson wrote: > Rather than relying on the target machine architecture, use the > size of a pointer from the compiler to determine if we are 64-bits > or not. This allows correct behaviour when you pass -m32 as a compile > option. It also allows us to use this value repeatedly throughout the > repo rather than continually testing for the sizeof(void*). > > Signed-off-by: Bruce Richardson > --- Just by way of note, for those looking to test: On Fedora 28 I can compile a 32-bit version of DPDK using: PKG_CONFIG_LIBDIR='/usr/lib/pkgconfig' meson -Dc_args=-m32 -Dc_link_args=-m32 i686-build ninja -C i686-build The PKG_CONFIG_LIBDIR is necessary to ensure the 32-bit .pc files are found. The c_args and c_link_args values are pretty self-explanatory. This didn't work before this patch because we looked at host_system() for 32-bit or 64-bit info, rather than asking the compiler about it. /Bruce PS: Sorry, Thomas, this doesn't seem to work on Arch, which seems to have a more mixed lib setup than other distros, having /usr/lib32, /usr/lib64 as well as a 3rd /usr/lib directory to confuse things. :-(