[dpdk-dev] [PATCH 1/1] net/hinic: solve compilation issues

Ziyang Xuan xuanziyang2 at huawei.com
Fri Jun 28 05:46:08 CEST 2019


This patch fixes ci/Intel-compilation issues for hinic PMD
on 32-bits platform.

Signed-off-by: Ziyang Xuan <xuanziyang2 at huawei.com>
---
 drivers/net/hinic/Makefile         | 18 ++++++++++++++++++
 drivers/net/hinic/base/meson.build | 12 ++++++++++++
 2 files changed, 30 insertions(+)

diff --git a/drivers/net/hinic/Makefile b/drivers/net/hinic/Makefile
index df7871b05..123a6263d 100644
--- a/drivers/net/hinic/Makefile
+++ b/drivers/net/hinic/Makefile
@@ -25,6 +25,24 @@ EXPORT_MAP := rte_pmd_hinic_version.map
 
 LIBABIVER := 1
 
+#
+# CFLAGS for 32-bits platforms
+#
+ifneq ($(CONFIG_RTE_ARCH_64),y)
+ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y)
+#
+# CFLAGS for icc
+#
+CFLAGS += -diag-disable 2259
+else
+#
+# CFLAGS for gcc
+#
+CFLAGS += -Wno-int-to-pointer-cast
+CFLAGS += -Wno-pointer-to-int-cast
+endif
+endif
+
 VPATH += $(SRCDIR)/base
 
 #
diff --git a/drivers/net/hinic/base/meson.build b/drivers/net/hinic/base/meson.build
index 21a246cd1..cde394a20 100644
--- a/drivers/net/hinic/base/meson.build
+++ b/drivers/net/hinic/base/meson.build
@@ -14,6 +14,18 @@ sources = [
 	'hinic_pmd_wq.c',
 ]
 
+extra_flags = []
+# The driver runs only on arch64 machine, remove 32bit warnings
+if not dpdk_conf.get('RTE_ARCH_64')
+        extra_flags += ['-Wno-int-to-pointer-cast', '-Wno-pointer-to-int-cast']
+endif
+
+foreach flag: extra_flags
+        if cc.has_argument(flag)
+                cflags += flag
+        endif
+endforeach
+
 deps += ['hash']
 
 c_args = cflags
-- 
2.18.0



More information about the dev mailing list