aboutsummaryrefslogtreecommitdiffstats
path: root/dpdk
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2016-04-26 14:54:57 +0200
committerDave Barach <openvpp@barachs.net>2016-04-26 16:16:44 +0000
commite39a7b8347b1055cca6e9cfadcfeca23f8236eb9 (patch)
tree0113d89f6faaf4013266f46c5e520735063b63f5 /dpdk
parent1dabaafcebb02699cae1ebd2b58e34dfe6b0f064 (diff)
Fix compile errors reported by clang
For using clang as a compiler it is enough to specify CC=clang in the make command line Change-Id: I06f1c1d418b68768f8119de5bdc8748c51f90c02 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'dpdk')
-rw-r--r--dpdk/Makefile13
-rw-r--r--dpdk/dpdk-16.04_patches/0010-Fix-O0-clang-build.patch32
2 files changed, 42 insertions, 3 deletions
diff --git a/dpdk/Makefile b/dpdk/Makefile
index 398fc60f..fadbb268 100644
--- a/dpdk/Makefile
+++ b/dpdk/Makefile
@@ -31,7 +31,14 @@ DPDK_2.1.0_TARBALL_MD5_CKSUM := 205a0d12bfd6eb717d57506272f43519
DPDK_2.2.0_TARBALL_MD5_CKSUM := 22e2fd68cd5504f43fe9a5a6fd6dd938
DPDK_16.04_TARBALL_MD5_CKSUM := 0728d506d7f56eb64233e824fa3c098a
DPDK_SOURCE := $(B)/dpdk-$(DPDK_VERSION)
-DPDK_TARGET := x86_64-native-linuxapp-gcc
+
+ifneq (,$(findstring clang,$(CC)))
+DPDK_CC=clang
+else
+DPDK_CC=gcc
+endif
+
+DPDK_TARGET := x86_64-native-linuxapp-$(DPDK_CC)
JOBS := $(shell grep processor /proc/cpuinfo | wc -l)
# compiler/linker custom arguments
@@ -40,9 +47,9 @@ DPDK_CPU_LDFLAGS :=
DPDK_EXTRA_LDFLAGS := -g
ifeq ($(DPDK_DEBUG),n)
-DPDK_EXTRA_CFLAGS := -g
+DPDK_EXTRA_CFLAGS := -g
else
-DPDK_EXTRA_CFLAGS := -g -O0
+DPDK_EXTRA_CFLAGS := -g -O0
endif
# translate gcc march values to DPDK arch
diff --git a/dpdk/dpdk-16.04_patches/0010-Fix-O0-clang-build.patch b/dpdk/dpdk-16.04_patches/0010-Fix-O0-clang-build.patch
new file mode 100644
index 00000000..2ce0e7c8
--- /dev/null
+++ b/dpdk/dpdk-16.04_patches/0010-Fix-O0-clang-build.patch
@@ -0,0 +1,32 @@
+From 2b82c248638bba6e98ecf388c6e0b1f5f0b44028 Mon Sep 17 00:00:00 2001
+From: Damjan Marion <damarion@cisco.com>
+Date: Tue, 26 Apr 2016 12:36:52 +0200
+Subject: [PATCH] Fix -O0 clang build
+
+Signed-off-by: Damjan Marion <damarion@cisco.com>
+---
+ lib/librte_eal/common/include/arch/x86/rte_rtm.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/lib/librte_eal/common/include/arch/x86/rte_rtm.h b/lib/librte_eal/common/include/arch/x86/rte_rtm.h
+index d935641..30c1969 100644
+--- a/lib/librte_eal/common/include/arch/x86/rte_rtm.h
++++ b/lib/librte_eal/common/include/arch/x86/rte_rtm.h
+@@ -50,11 +50,14 @@ void rte_xend(void)
+ asm volatile(".byte 0x0f,0x01,0xd5" ::: "memory");
+ }
+
++#define rte_xabort(x) asm volatile(".byte 0xc6,0xf8,%P0" :: "i" (x) : "memory")
++#if 0
+ static __attribute__((__always_inline__)) inline
+ void rte_xabort(const unsigned int status)
+ {
+ asm volatile(".byte 0xc6,0xf8,%P0" :: "i" (status) : "memory");
+ }
++#endif
+
+ static __attribute__((__always_inline__)) inline
+ int rte_xtest(void)
+--
+2.7.4
+