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 8447CA04B5; Fri, 6 Nov 2020 17:56:31 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E60F6DED; Fri, 6 Nov 2020 17:56:29 +0100 (CET) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 3A7362AB for ; Fri, 6 Nov 2020 17:56:28 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 968125C0163; Fri, 6 Nov 2020 11:56:26 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Fri, 06 Nov 2020 11:56:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=MGWlfweRqD5rg 24aVi6+fsMW/ADm4cs7HfB513cSVXk=; b=Mc8RslxHXOBGeXlEIIE2B3Pl7M4LL u24lNCQVNWsvwiP1tKnCTmfKt+0Tbu4qhN/LTKjhsz7v1rMHD0vZG8cgHcYsKnGG Du8xZjarps5/+TpW2q2ksyNrGNAGKUHi1WLWu4MfIqY6znpq/+HZ1FoJGwcN8EjA NkBvO4+2UIKdoxE8yedts/0yyx01UjeGxIbLdI0shyAnXTK+IAB6TI+NHoM1MiCQ uP4XNSRY8jGHgzAHlEyC7QHGRwmx/LnEjoVqiLrf4+Hzui3r+bV7wz6m+HiV1R3K xkfuzXODhuPP5T3vncBPEJEEomrZosDjBnvglPmGmCocY4DCl3GfpF86Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=MGWlfweRqD5rg24aVi6+fsMW/ADm4cs7HfB513cSVXk=; b=GxWZd8et z3L06o/inftxJOoioeRC0mJy07a4hhgW2sYtt5LN7PjX07bMHQD/I7H7RzFGFjix ZGlW5JbDRJhGgsUD3eQDznRR/DpqUwZJMnzM1dRl2/QWVL0zPnulFtf5qDjJPK2G wkPJQ1H12OIHOb87oKzUpPzviHkaArIXY2dr+eDyzR/zv5lt4iKIvWqLdQwKI8t0 eNDDNLv7EMXa27HN6pLhGyvbqmzc+XPbLxGlZdHnYYHVy//BTcipNKPJc/fwW9L6 olvgzxE3fN1qqL+Ufw63c2JQ5Nyg4PWVZLYPqxQ/++zXFFsZ4mM0u+qYWMQFycr+ Uuc3ppvDBZMiWg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedruddtledgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdehgfeivdejgedtveehfefhteelfefgieevgfffveefjeegtdfg uedthedtgeevnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvght X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 598A9306005C; Fri, 6 Nov 2020 11:56:25 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: david.marchand@redhat.com, Bruce Richardson Date: Fri, 6 Nov 2020 17:56:10 +0100 Message-Id: <20201106165611.232288-1-thomas@monjalon.net> X-Mailer: git-send-email 2.28.0 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 v3 1/1] devtools: test 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" From: Bruce Richardson 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 Signed-off-by: Thomas Monjalon --- v3: unset override move and rename override split command in check_cc_flags use check_cc_flags for x86 default build 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 | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh index a87de635a2..ac76c2184b 100755 --- a/devtools/test-meson-builds.sh +++ b/devtools/test-meson-builds.sh @@ -43,6 +43,12 @@ 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 @@ -52,11 +58,14 @@ load_env () # export CFLAGS=$default_cflags export LDFLAGS=$default_ldflags unset DPDK_MESON_OPTIONS - if command -v $targetcc >/dev/null 2>&1 ; then + if [ -n "$target_override" ] ; then + DPDK_TARGET=$target_override + elif command -v $targetcc >/dev/null 2>&1 ; then DPDK_TARGET=$($targetcc -v 2>&1 | sed -n 's,^Target: ,,p') else # toolchain not yet in PATH: its name should be enough DPDK_TARGET=$targetcc 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 @@ -200,12 +209,29 @@ done # Set the install path for libraries to "lib" explicitly to prevent problems # with pkg-config prefixes if installed in "lib/x86_64-linux-gnu" later. default_machine='nehalem' -ok=$(cc -march=$default_machine -E - < /dev/null > /dev/null 2>&1 || echo false) -if [ "$ok" = "false" ] ; then +if ! check_cc_flags "-march=$default_machine" ; then default_machine='corei7' fi build build-x86-default cc -Dlibdir=lib -Dmachine=$default_machine $use_shared +# 32-bit with default compiler +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 + target_override='i386-pc-linux-gnu' + build build-32b cc -Dc_args='-m32' -Dc_link_args='-m32' + target_override= + unset PKG_CONFIG_LIBDIR +fi + # x86 MinGW build build-x86-mingw $srcdir/config/x86/cross-mingw -Dexamples=helloworld -- 2.28.0