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 40645A04E7; Thu, 5 Nov 2020 18:22:08 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D71AF2BE2; Thu, 5 Nov 2020 18:22:06 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id C8A44160 for ; Thu, 5 Nov 2020 18:22:05 +0100 (CET) IronPort-SDR: x/P7CtXt5NPZ5JA3mVbBVpaFAof6BduD72i+2zVVaLhSTKxrHbxpmQxqJDdoh8LWfrTT7cQRbV Ix9WwSdjiG/g== X-IronPort-AV: E=McAfee;i="6000,8403,9796"; a="165914271" X-IronPort-AV: E=Sophos;i="5.77,454,1596524400"; d="scan'208";a="165914271" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Nov 2020 09:22:03 -0800 IronPort-SDR: 3HOLV3NpDiECuPAqm1zjI+8cMt2dubbqekMm53wGFB1b1kyeuYP1pOLmd09d8LmdbJAW4Gm16U 2VpQRFlaSxzg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,454,1596524400"; d="scan'208";a="337310465" Received: from silpixa00399126.ir.intel.com ([10.237.222.4]) by orsmga002.jf.intel.com with ESMTP; 05 Nov 2020 09:22:02 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: thomas@monjalon.net, david.marchand@redhat.com, Bruce Richardson Date: Thu, 5 Nov 2020 17:21:45 +0000 Message-Id: <20201105172144.516685-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201105110728.220957-1-bruce.richardson@intel.com> References: <20201105110728.220957-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2] test-meson-builds: add a 32-bit build 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" It's reasonably common for patches to have issues when built on 32-bits, so to prevent this, we can add a 32-bit build (if supported) to the "test-meson-builds.sh" script. The tricky bit is using a valid PKG_CONFIG_LIBDIR, so for now we use two common possibilities for where that should point to in order to get a successful build. Signed-off-by: Bruce Richardson --- V2: added separate flag checking function added override of the DPDK_TARGET value added /usr/lib32 as possible 32-bit libdir --- devtools/test-meson-builds.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh index a87de635a2..47786dcd69 100755 --- a/devtools/test-meson-builds.sh +++ b/devtools/test-meson-builds.sh @@ -43,6 +43,11 @@ default_cppflags=$CPPFLAGS default_cflags=$CFLAGS default_ldflags=$LDFLAGS +check_cc_flags () # ... +{ + echo "int main(void) { return 0; }" | cc $@ -x c - -o /dev/null 2> /dev/null +} + load_env () # { targetcc=$1 @@ -57,6 +62,10 @@ load_env () # else # toolchain not yet in PATH: its name should be enough DPDK_TARGET=$targetcc fi + if [ -n "$DPDK_TARGET_OVERRIDE" ] ; then + DPDK_TARGET=$DPDK_TARGET_OVERRIDE + fi + echo "Using DPDK_TARGET $DPDK_TARGET" # config input: $DPDK_TARGET . $srcdir/devtools/load-devel-config # config output: $DPDK_MESON_OPTIONS, $PATH, $PKG_CONFIG_PATH, etc @@ -226,6 +235,23 @@ for f in $srcdir/config/ppc/ppc* ; do build build-$(basename $f | cut -d'-' -f-2) $f $use_shared done +# test a 32-bit build +if check_cc_flags '-m32' ; then + if [ -d "/usr/lib/i386-linux-gnu" ] ; then + # 32-bit pkgconfig on debian/ubuntu + export PKG_CONFIG_LIBDIR="/usr/lib/i386-linux-gnu/pkgconfig" + elif [ -d "/usr/lib32" ] ; then + # 32-bit pkgconfig on arch + export PKG_CONFIG_LIBDIR="/usr/lib32/pkgconfig" + else + # 32-bit pkgconfig on RHEL/fedora (lib vs lib64) + export PKG_CONFIG_LIBDIR="/usr/lib/pkgconfig" + fi + DPDK_TARGET_OVERRIDE="i386-pc-linux-gnu" \ + build build-32b cc -Dc_args='-m32' -Dc_link_args='-m32' + unset PKG_CONFIG_LIBDIR +fi + # Test installation of the x86-default target, to be used for checking # the sample apps build using the pkg-config file for cflags and libs build_path=$(readlink -f $builds_dir/build-x86-default) -- 2.25.1