diff mbox series

[v1,1/1] travis: build DPDK with clang if it was selected

Message ID 1517371206-699-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [v1,1/1] travis: build DPDK with clang if it was selected | expand

Commit Message

Github ODP bot Jan. 31, 2018, 4 a.m. UTC
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


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 <dmitry.ereminsolenikov@linaro.org>

---
/** 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: d2cc4db97bcf26b6a8039f26e4046ea1de48c9d9
 **/
 .travis.yml | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/.travis.yml b/.travis.yml
index b7d6cd415..15f13f3b0 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
@@ -206,6 +213,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