From patchwork Wed Jan 31 20:00:33 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: 126410 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1052474ljc; Wed, 31 Jan 2018 12:04:48 -0800 (PST) X-Google-Smtp-Source: AH8x225OMgQ762G05HvYr/46cJ1+C5tQ0p6qHLxrA9JrPASkOzHC8+kBrxYhraKOSN2ZxZ1BzL4F X-Received: by 10.55.73.203 with SMTP id w194mr50272016qka.21.1517429087846; Wed, 31 Jan 2018 12:04:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517429087; cv=none; d=google.com; s=arc-20160816; b=g2sTNbFT7iew/H7Ytx99uIIrJh5ledh3Cu9nG5BuWsy3SitXZYg1uEOBHlJliGZBYv sJmtEecxUCkE30BJSNNPGrtGABfO8Pzru/HrLOoqAsUChwpjRCb/0XQGqmzTngg+1G8w wZORaTvAs3UkFf32uHgjH7IuhpdfuESZidjWbZ72BNikXZ/+60EYkNCPz53I96wUtmcE ZjP3RBmwTW05OGnC2Bdr9aWSLQzhfjqR+d1lMMJR+CF9lwALgH+ZkSUjT1BKASVjV/nk xrzlDgrxU2Ox2doQmdaMlHFwQ2wI1b9hC+4ypy+F+IhcB5hGZ2NhgVsrMKCV97MTDJlc JY1g== 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=3sKoyfHBj8ErBD8rtJr+JocPEsDXugBNLemb7pWS80I=; b=0nxejvt29Do6sQj3VZBPsFJCpCmz+SGt0C3bG+VeMhpMwTZTEmNdlLQHgfRdZKlUEV JbKa/TE0Bn1Hvi/PnjBYqtLYDM7+SWOnndj6olR95O89S/mIE3HNLzfl0oH5BouhP/6o g9nkWa+IrZKwW3MO/5g2ywWroGzMXFcNyEY40/FOkz4//L/ClyjsnY9JW5kuFjmPwfP6 m6aUwnsjJW+HZHiAex8HhrBGOr0Sw6foBMZeh4Vqywv1h7hrCwUfoFFHunSQA8HmvWDW vQ81Aor5YXseHJ1XuftEoSpeq1A2oMU2O7Bp+PZ8rfMeEYr9FUT5tqmGtS4HF76KpPzi C/7g== 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 90si296800qta.80.2018.01.31.12.04.47; Wed, 31 Jan 2018 12:04:47 -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 74F636176D; Wed, 31 Jan 2018 20:04:47 +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 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 0C44E61797; Wed, 31 Jan 2018 20:01:00 +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 C003860956; Wed, 31 Jan 2018 20:00:41 +0000 (UTC) Received: from forward104p.mail.yandex.net (forward104p.mail.yandex.net [77.88.28.107]) by lists.linaro.org (Postfix) with ESMTPS id EE44060956 for ; Wed, 31 Jan 2018 20:00:35 +0000 (UTC) Received: from mxback4o.mail.yandex.net (mxback4o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1e]) by forward104p.mail.yandex.net (Yandex) with ESMTP id BEC5A185F8B for ; Wed, 31 Jan 2018 23:00:34 +0300 (MSK) Received: from smtp1o.mail.yandex.net (smtp1o.mail.yandex.net [2a02:6b8:0:1a2d::25]) by mxback4o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id gaGyehsLyF-0YhaJE5x; Wed, 31 Jan 2018 23:00:34 +0300 Received: by smtp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id kGOYlxgHGl-0Y5K1cC6; Wed, 31 Jan 2018 23:00:34 +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 23:00:33 +0300 Message-Id: <1517428833-8438-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517428833-8438-1-git-send-email-odpbot@yandex.ru> References: <1517428833-8438-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 439 Subject: [lng-odp] [PATCH v5 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: 9e35d43844e9bc6eb28af8307ec91125c5022bc0 **/ .travis.yml | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index b7d6cd415..faf477b53 100644 --- a/.travis.yml +++ b/.travis.yml @@ -101,6 +101,7 @@ before_install: DPDK_CFLAGS="-m32" ; else DPDK_CROSS="$CROSS_GNU_TYPE-" ; + DPDK_CFLAGS="--target=$CROSS_GNU_TYPE" ; fi fi ; export CXX="${CC/clang/clang++}"; @@ -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