From patchwork Wed Jan 31 13:00:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 126330 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp1922187edc; Wed, 31 Jan 2018 05:06:16 -0800 (PST) X-Google-Smtp-Source: AH8x225hvTqNRDc8H79oneIxCzNOYRVFhMVVRBERBXzflCs8umbVTdf2/p5GNfghlUy7cBgmVQiS X-Received: by 10.129.136.194 with SMTP id y185mr22508647ywf.202.1517403976342; Wed, 31 Jan 2018 05:06:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517403976; cv=none; d=google.com; s=arc-20160816; b=dDFnGDzenkbm6iYBon4OV+dEMxYPEXyOnYZfFvtWu4mB5aM6Y/FpKLx/URHw05pPsQ zRLZZQST+FhdfRiQabj1Q5X2BKZ4oEnj1Ozj6AgKW5zWhCn+QU7tRNZu4UnDm5SlLoU9 KpuqFnGYntUP6P0G9KZGFUU9ZLUbKGFZ/H0r7sphgy0sMf32WT+ULubwPYosJ0be322+ Sv/G1bMiaCvA3gBKVd4BxYO7cnjdE34/hGwlGqqryWfrilEni5zYctBMtN475Cz4Jc5o /xwsq/AK9627CWyoihaC+xhQBy3IVeTH0reIUo4r1yL0nc+BwVxxa2fVgfpFVeJ2M2mW QWNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=YMDcx+FKebz3CK8HXzK34F17ODaSgXrYSYbrAMqgFhk=; b=Aw2ZsKDrX4f7P5XDiObooffpV2w2Kb4+QXNsuCql8lOrILaLAhvMPKyMUVlSVoc02o 3mAOkZxTAuD9frYyPkVGwHXFbQsev44rVqL6KMxcIGW0VmrKXhwn7gd2faW3Bv+LT3+C Q/DtYPaCvO34rLQoeAc8CyI5DpVqYgWOzam5uC7iisyIdLgW6FbIKGy71tvOMaZXtTSf 4/pca8reGR+fRZMskUUilSW3WUTXvVyIUUDRqUE2JKmbA+n9JLQ0u8kOjFNlqyNJ3HBy n4x+kiRbFNiUvQVULG++rRGscjU0qkucQe0FmFhKndnr9XfItPv5DXPrZOaGOClCOsNx ZSwQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id h15si5792733ybm.368.2018.01.31.05.06.16; Wed, 31 Jan 2018 05:06:16 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 00B55616E1; Wed, 31 Jan 2018 13:06:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id D1CDB617BE; Wed, 31 Jan 2018 13:00:59 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 0796F61787; Wed, 31 Jan 2018 13:00:26 +0000 (UTC) Received: from forward102j.mail.yandex.net (forward102j.mail.yandex.net [5.45.198.243]) by lists.linaro.org (Postfix) with ESMTPS id D5FE7616DA for ; Wed, 31 Jan 2018 13:00:19 +0000 (UTC) Received: from mxback7g.mail.yandex.net (mxback7g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:168]) by forward102j.mail.yandex.net (Yandex) with ESMTP id 74BB25605ACE for ; Wed, 31 Jan 2018 16:00:18 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback7g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id VrnL408AGE-0IGS437q; Wed, 31 Jan 2018 16:00:18 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id TNz0djhUfe-0HtSgo5A; Wed, 31 Jan 2018 16:00:17 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 31 Jan 2018 16:00:17 +0300 Message-Id: <1517403617-12669-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517403617-12669-1-git-send-email-odpbot@yandex.ru> References: <1517403617-12669-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 439 Subject: [lng-odp] [PATCH v4 1/1] travis: build DPDK with clang if it was selected X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov gcc-built DPDK is not fully compatible with clang (see https://travis-ci.org/lumag/odp/jobs/335324053 for example). Use clang to compile DPDK if selected compiler is clang. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 439 (lumag:dpdk-clang) ** https://github.com/Linaro/odp/pull/439 ** Patch: https://github.com/Linaro/odp/pull/439.patch ** Base sha: b95ccd3db6eeb7358a877541747e06354429acdd ** Merge commit sha: ee6b84c69a8604de3ee075fcc551ca6df617035e **/ .travis.yml | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index b7d6cd415..87f290092 100644 --- a/.travis.yml +++ b/.travis.yml @@ -100,9 +100,10 @@ before_install: then DPDK_CFLAGS="-m32" ; else - DPDK_CROSS="$CROSS_GNU_TYPE-" ; + DPDK_CFLAGS="--target=$CROSS_GNU_TYPE" ; fi fi ; + DPDK_CROSS="$CROSS_GNU_TYPE-" ; export CXX="${CC/clang/clang++}"; elif [ "$CROSS_ARCH" = "i386" ] ; then @@ -161,30 +162,36 @@ install: - | case "$CROSS_ARCH" in "arm64") - DPDK_TARGET="arm64-armv8a-linuxapp-gcc" + DPDK_TARGET="arm64-armv8a-linuxapp-" ;; "armhf") - DPDK_TARGET="arm-armv7a-linuxapp-gcc" + DPDK_TARGET="arm-armv7a-linuxapp-" ;; "i386") - DPDK_TARGET="i686-native-linuxapp-gcc" + DPDK_TARGET="i686-native-linuxapp-" ;; "") - DPDK_TARGET="x86_64-native-linuxapp-gcc" + DPDK_TARGET="x86_64-native-linuxapp-" DPDK_MACHINE=snb ;; esac - | if [ -n "$DPDK_TARGET" ] ; then + if [ "${CC#clang}" != "${CC}" ] ; then + DPDKCC=clang ; + else + DPDKCC=gcc ; + fi if [ -n "$DPDK_SHARED" ] ; then - TARGET="$DPDK_TARGET"-shared + TARGET="${DPDK_TARGET}$DPDKCC"-shared LIBDPDKEXT=so export LD_LIBRARY_PATH="`pwd`/${TARGET}:$LD_LIBRARY_PATH" echo $LD_LIBRARY_PATH else - TARGET="$DPDK_TARGET" + TARGET="${DPDK_TARGET}$DPDKCC" LIBDPDKEXT=a fi + DPDK_TARGET="${DPDK_TARGET}gcc" if [ ! -f "dpdk/${TARGET}/lib/libdpdk.$LIBDPDKEXT" ]; then git -c advice.detachedHead=false clone -q --depth=1 --single-branch --branch=v${DPDK_VERS} http://dpdk.org/git/dpdk dpdk pushd dpdk @@ -193,6 +200,7 @@ install: sed -i -e 's/40900/40800/g' lib/librte_eal/common/include/arch/arm/rte_vect.h sed -i -e 's/!(/!(defined(__arm__) \&\& defined(__clang__) || /g' lib/librte_eal/common/include/arch/arm/rte_byteorder.h sed -i -e 's/__GNUC__/defined(__arm__) \&\& defined(__clang__) || __GNUC__/' lib/librte_eal/common/include/generic/rte_byteorder.h + sed -i -e 's,\$(CC),\0 $(EXTRA_CFLAGS),g' lib/librte_acl/Makefile make config T=${DPDK_TARGET} O=${TARGET} pushd ${TARGET} sed -ri 's,(CONFIG_RTE_LIBRTE_PMD_PCAP=).*,\1y,' .config @@ -206,8 +214,11 @@ install: sed -ri -e 's,(CONFIG_RTE_EAL_IGB_UIO=).*,\1n,' .config sed -ri -e 's,(CONFIG_RTE_KNI_KMOD=).*,\1n,' .config fi + sed -ri -e 's,(CONFIG_RTE_TOOLCHAIN=).*,\1"'${DPDKCC}'",' .config + sed -ri -e '/CONFIG_RTE_TOOLCHAIN_.*/d' .config + echo CONFIG_RTE_TOOLCHAIN_${DPDKCC^^}=y >> .config popd - make build T=${DPDK_TARGET} O=${TARGET} EXTRA_CFLAGS="-fPIC $DPDK_CFLAGS" CROSS="$DPDK_CROSS" -j $(nproc) + make build O=${TARGET} EXTRA_CFLAGS="-fPIC $DPDK_CFLAGS" CROSS="$DPDK_CROSS" CC="$CC" HOSTCC=gcc -j $(nproc) rm -r ./doc ./${TARGET}/app ./${TARGET}/build popd fi