[dpdk-dev] [PATCH v2] net/octeontx: use stub for building in old compilers

Pavan Nikhilesh pbhagavatula at caviumnetworks.com
Fri Jan 26 07:40:16 CET 2018


Use stub for building clang < 4.0 as it doesn't support the following
arm machine directives:

.cpu

Signed-off-by: Pavan Nikhilesh <pbhagavatula at caviumnetworks.com>
---

 v2 Changes:
 - use stub for older clang compilers instead of disabling PMD

 drivers/net/octeontx/Makefile           | 8 ++++++++
 drivers/net/octeontx/base/octeontx_io.h | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/net/octeontx/Makefile b/drivers/net/octeontx/Makefile
index b47bf7a40..5244eedd3 100644
--- a/drivers/net/octeontx/Makefile
+++ b/drivers/net/octeontx/Makefile
@@ -30,6 +30,14 @@ SRCS-$(CONFIG_RTE_LIBRTE_OCTEONTX_PMD) += octeontx_pkivf.c
 SRCS-$(CONFIG_RTE_LIBRTE_OCTEONTX_PMD) += octeontx_bgx.c
 SRCS-$(CONFIG_RTE_LIBRTE_OCTEONTX_PMD) += octeontx_ethdev.c

+ifeq ($(CONFIG_RTE_TOOLCHAIN_CLANG),y)
+
+ifeq ($(shell test $(CLANG_MAJOR_VERSION)$(CLANG_MINOR_VERSION) -lt 40 && echo 1), 1)
+CFLAGS += -D CLANG_BUILD_BUG
+endif
+
+endif
+
 ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
 CFLAGS_octeontx_rxtx.o += -fno-prefetch-loop-arrays

diff --git a/drivers/net/octeontx/base/octeontx_io.h b/drivers/net/octeontx/base/octeontx_io.h
index d51ded236..1c0a941a5 100644
--- a/drivers/net/octeontx/base/octeontx_io.h
+++ b/drivers/net/octeontx/base/octeontx_io.h
@@ -51,7 +51,7 @@ do {							\
 } while (0)
 #endif

-#if defined(RTE_ARCH_ARM64)
+#if defined(RTE_ARCH_ARM64) && !defined(CLANG_BUILD_BUG)
 /**
  * Perform an atomic fetch-and-add operation.
  */
--
2.16.0



More information about the dev mailing list