[1/1] net/hinic: solve compilation issues

Message ID eea2174a76daa3a1eef1bdc83c3372ec1287e603.1561693029.git.xuanziyang2@huawei.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series [1/1] net/hinic: solve compilation issues |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail apply issues

Commit Message

Ziyang Xuan June 28, 2019, 3:46 a.m. UTC
  This patch fixes ci/Intel-compilation issues for hinic PMD
on 32-bits platform.

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

Comments

Ferruh Yigit June 28, 2019, 10:30 a.m. UTC | #1
On 6/28/2019 4:46 AM, Ziyang Xuan wrote:
> This patch fixes ci/Intel-compilation issues for hinic PMD
> on 32-bits platform.
> 
> Signed-off-by: Ziyang Xuan <xuanziyang2@huawei.com>

Squashed into relevant commit in next-net, thanks.
  

Patch

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