From patchwork Wed Jan 31 05:00:06 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: 126309 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp372938ljc; Tue, 30 Jan 2018 21:01:18 -0800 (PST) X-Google-Smtp-Source: AH8x225G4LSiALem9AGHfN/qV0eyPqMeU9hKwgYrtEV7GzzvkSSF8c3qSkRpcvoWxMdIRd9aBHZY X-Received: by 10.200.26.130 with SMTP id x2mr52240401qtj.288.1517374877933; Tue, 30 Jan 2018 21:01:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517374877; cv=none; d=google.com; s=arc-20160816; b=wJofxufnhmpWB9ZWKnr+fARnTToBCNAVTJolP6WE04WWR5obuT3D4BT0Fpx5ocOM3f oNzMZATgYVZzJgByFxRP4kBZpZPar1McSe+SHUBGkxzX1O9CgB9qERr88XYUG6GWBvWE 2rn/BLdG+I5JugUv0qmeuW6yb18Z3T+i2Bwj62Ehf46EJUEclD+oUnYsn9U9f9FUIu3X /vI8NInaJl1MM42H3HVWTOu8IdW/HNN8pzKR8H2RXMdncc0YfZWCC2RvVo5aBkRFUwbf j3hH5fOmxrIoQGJ25RMOmTDVVVGYZVFSva66v/Js0nKwbt2cFTrfZkciUm+6lWVeZORF Er7w== 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=QUFKS045p5BU2OlNK1wdbteVg54l5HYNuR01RqCnFEk=; b=CeYQgKZJPekd/VqnIw88C/ORc/o7Ip3I6qjqkIy3h7kavP5Uc4PepQE6ktQKFP4559 OPiv89whMdUbqm2+SFd4jGxQX/aHjW0A3jz172zEgafcgrVciLIRlP2f6LR19ATeBM+z Z3dhp0QtZdzu8ICCZ0t9VPde6+bmvb0+vo/hbON+6S03Ifjp5dPgIoFAxfDzEl1Nt7pH x1McNsQAStNQrVmVwImELdtvCHa9FS3TrGN0zvSAzIW7QbaXwGMjL3OKL3Et/08/lcHt V9j+LjGj+EK4Nj3yBu2MXTbe6WnEGrvnX/e9EQQc84izeBhDj13AD12FwKj7inKwRe17 8siQ== 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 o50si2395247qtb.313.2018.01.30.21.01.17; Tue, 30 Jan 2018 21:01:17 -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 96A126176F; Wed, 31 Jan 2018 05:01:17 +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 5D80261745; Wed, 31 Jan 2018 05:00:35 +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 D6FA2614E1; Wed, 31 Jan 2018 05:00:28 +0000 (UTC) Received: from forward103j.mail.yandex.net (forward103j.mail.yandex.net [5.45.198.246]) by lists.linaro.org (Postfix) with ESMTPS id CE7B761745 for ; Wed, 31 Jan 2018 05:00:10 +0000 (UTC) Received: from mxback11g.mail.yandex.net (mxback11g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:90]) by forward103j.mail.yandex.net (Yandex) with ESMTP id CB5D434C4F76 for ; Wed, 31 Jan 2018 08:00:08 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback11g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id qDCFFN8hEZ-08J4Ibc4; Wed, 31 Jan 2018 08:00:08 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id ANT764L3aJ-079q0oi5; Wed, 31 Jan 2018 08:00:07 +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 08:00:06 +0300 Message-Id: <1517374806-4821-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517374806-4821-1-git-send-email-odpbot@yandex.ru> References: <1517374806-4821-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 439 Subject: [lng-odp] [PATCH v2 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: 350da6bc81e31aa039ed8c65b817529ea6ec4cec **/ .travis.yml | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index b7d6cd415..c26c0f556 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 -ri -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