From patchwork Wed Jan 31 07:00:07 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: 126319 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp447751ljc; Tue, 30 Jan 2018 23:01:30 -0800 (PST) X-Google-Smtp-Source: AH8x225php1Nk56Q/RcQXcIbiZPzgE6YU8XH/KiaU8vhauqOEQic7qcFjJh5f3gN2AAPMMN78O5q X-Received: by 10.13.253.132 with SMTP id n126mr21288067ywf.10.1517382090129; Tue, 30 Jan 2018 23:01:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517382090; cv=none; d=google.com; s=arc-20160816; b=A7YQi9n59/GLXhjNiBr2p1m9pMV+x3tzQFCK4hBPYiHYbKUKlzm7awlJ0zRwvll8cR ow48KCXqJSCgTGO3jHlfS1N2LvvKDkBBTbPbjdIEXyiNRofgLHlH4czuLl1gXYrgrGsA 7VJHt0OCF0Ze5txYFA1hxFfdx2Tj/JwcFVs//z9Nw4WMRT5o4RU5i6qA/O0VLcYN1w/P Al6g2Qv3ufHoceqkViwWQGXx2SbviUVIIrOHIq1Sc5k4KkNRFqsX2Pxxhq9jM33mXCek 9gz3W88LqE8fjhTMCkS1rLsu+oAqeDFtjtxtR812zp9t1NG+Dld0dyRBsHxCXaIaHemB D+qA== 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=w94AvAz1hcuy6Me7jl6jLjy1oNIoLyi1KbuOFpb1284=; b=fcLHaX8kJlX7/HwR5QIvIuwWoBrD8Es5FBlUe3rTwslw/LkCfp4SFZQwmmanGwQ6u/ fYXwZ0ClIz3vD6g5VHMZ1vPG4abb8wVBKeVvx3dV0zg6A4GjEGdyJnqw1eQ5ZNxBpJxU 7pliJb7iYGwIj387P2oKxCWqS4DC9TjuFYgorST7QC8I0y65O4zr3ys7yTy6fty7gFjx qt7Nxrj9ayXTnz1OsJPOdqmgr4d7OzlkwgFLpjrBV5GvJN7SggNs6f2QoBgmgRBp/RFR WjWCzF/9gQU5hKLoJ0UYqLXFCKFKXbbiGD0cbLZDd6gs07Ro28dvrIElD3zodV9UvPWv bCIA== 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 t56si63126qte.470.2018.01.30.23.01.29; Tue, 30 Jan 2018 23:01:30 -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 57ACD6150F; Wed, 31 Jan 2018 07:01:29 +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_H2 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 4D52F61510; Wed, 31 Jan 2018 07:00:33 +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 70C1A60956; Wed, 31 Jan 2018 07:00:16 +0000 (UTC) Received: from forward104o.mail.yandex.net (forward104o.mail.yandex.net [37.140.190.179]) by lists.linaro.org (Postfix) with ESMTPS id BE85460C40 for ; Wed, 31 Jan 2018 07:00:11 +0000 (UTC) Received: from mxback10o.mail.yandex.net (mxback10o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::24]) by forward104o.mail.yandex.net (Yandex) with ESMTP id 64C7A70321D for ; Wed, 31 Jan 2018 10:00:09 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback10o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id lu3VeVcl0l-09O8Ed72; Wed, 31 Jan 2018 10:00:09 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id ay1q5H4bkQ-08tq88il; Wed, 31 Jan 2018 10:00:08 +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 10:00:07 +0300 Message-Id: <1517382007-7050-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517382007-7050-1-git-send-email-odpbot@yandex.ru> References: <1517382007-7050-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 439 Subject: [lng-odp] [PATCH v3 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: 591a621ec1272945c0712e7a148ff119db1dca09 **/ .travis.yml | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index b7d6cd415..d9cbb1eff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -100,7 +100,7 @@ before_install: then DPDK_CFLAGS="-m32" ; else - DPDK_CROSS="$CROSS_GNU_TYPE-" ; + DPDK_CFLAGS="--target=$CROSS_GNU_TYPE" ; fi fi ; export CXX="${CC/clang/clang++}"; @@ -158,33 +158,40 @@ install: if [ "${CACHED_DPDK_VERS}" != "${DPDK_VERS}" ]; then rm -rf dpdk fi + - if [ "${CC#clang}" != "${CC}" ] ; + then + DPDKCC=clang ; + else + DPDKCC=gcc ; + fi - | 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 [ -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,6 +214,9 @@ 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) rm -r ./doc ./${TARGET}/app ./${TARGET}/build