DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] build: add meson support for icc
@ 2019-02-26 14:18 Andrius Sirvys
  2019-02-26 14:26 ` Bruce Richardson
  2019-02-26 17:44 ` Thomas Monjalon
  0 siblings, 2 replies; 3+ messages in thread
From: Andrius Sirvys @ 2019-02-26 14:18 UTC (permalink / raw)
  To: bruce.richardson; +Cc: dev, Andrius Sirvys

When building with mason, checks if the compiler is icc. If they match,
the warning_flags are changed to ensure icc compilation is successful.

Disabled error 3656: "variable may be used before its value is set"
in librte_telemetry, bnx2x, ixgbe and sfc as they were false positives.

Signed-off-by: Andrius Sirvys <andrius.sirvys@intel.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 config/meson.build               | 22 +++++++++++++++++-----
 drivers/net/bnx2x/meson.build    |  1 +
 drivers/net/ixgbe/meson.build    |  3 +++
 drivers/net/sfc/meson.build      |  3 +++
 lib/librte_telemetry/meson.build |  1 +
 5 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/config/meson.build b/config/meson.build
index db32499..34be1ee 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -85,11 +85,23 @@ endif
 add_project_arguments('-include', 'rte_config.h', language: 'c')
 
 # enable extra warnings and disable any unwanted warnings
-warning_flags = [
-	'-Wsign-compare',
-	'-Wcast-qual',
-	'-Wno-address-of-packed-member'
-]
+icc_warn_uninit = []
+if cc.get_id()=='intel'
+# variable may be used before its value is set
+	icc_warn_uninit = ['-diag-disable 3656']
+	warning_flags = [
+		'-diag-disable 188', # enumerated type mixed with another type
+		'-diag-disable 1338', # arithmetic on pointer to void or function type
+		'-diag-disable 279', # controlling expression is constant
+	]
+else
+	warning_flags = [
+		'-Wsign-compare',
+		'-Wcast-qual',
+		'-Wno-address-of-packed-member'
+	]
+endif
+
 if cc.sizeof('void *') == 4
 # for 32-bit, don't warn about casting a 32-bit pointer to 64-bit int - it's fine!!
 	warning_flags += '-Wno-pointer-to-int-cast'
diff --git a/drivers/net/bnx2x/meson.build b/drivers/net/bnx2x/meson.build
index e3c6888..d0e8b6f 100644
--- a/drivers/net/bnx2x/meson.build
+++ b/drivers/net/bnx2x/meson.build
@@ -5,6 +5,7 @@ dep = cc.find_library('z', required: false)
 build = dep.found()
 ext_deps += dep
 cflags += '-DZLIB_CONST'
+cflags += icc_warn_uninit
 sources = files('bnx2x.c',
 	'bnx2x_ethdev.c',
 	'bnx2x_rxtx.c',
diff --git a/drivers/net/ixgbe/meson.build b/drivers/net/ixgbe/meson.build
index 544a141..33e5d58 100644
--- a/drivers/net/ixgbe/meson.build
+++ b/drivers/net/ixgbe/meson.build
@@ -5,6 +5,9 @@ version = 2
 
 cflags += ['-DRTE_LIBRTE_IXGBE_BYPASS']
 
+# Flags for icc compiler
+cflags += icc_warn_uninit
+
 allow_experimental_apis = true
 
 subdir('base')
diff --git a/drivers/net/sfc/meson.build b/drivers/net/sfc/meson.build
index 2d34e86..b3424d4 100644
--- a/drivers/net/sfc/meson.build
+++ b/drivers/net/sfc/meson.build
@@ -30,6 +30,9 @@ extra_flags += [
 	'-Wbad-function-cast'
 ]
 
+# Flags for icc compiler
+extra_flags += icc_warn_uninit
+
 foreach flag: extra_flags
 	if cc.has_argument(flag)
 		cflags += flag
diff --git a/lib/librte_telemetry/meson.build b/lib/librte_telemetry/meson.build
index 9492f54..19726e3 100644
--- a/lib/librte_telemetry/meson.build
+++ b/lib/librte_telemetry/meson.build
@@ -5,6 +5,7 @@ sources = files('rte_telemetry.c', 'rte_telemetry_parser.c', 'rte_telemetry_pars
 headers = files('rte_telemetry.h', 'rte_telemetry_internal.h', 'rte_telemetry_parser.h', 'rte_telemetry_parser_test.h')
 deps += ['metrics', 'ethdev']
 cflags += '-DALLOW_EXPERIMENTAL_API'
+cflags += icc_warn_uninit
 
 jansson = cc.find_library('jansson', required: false)
 if jansson.found()
-- 
2.7.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] build: add meson support for icc
  2019-02-26 14:18 [dpdk-dev] [PATCH] build: add meson support for icc Andrius Sirvys
@ 2019-02-26 14:26 ` Bruce Richardson
  2019-02-26 17:44 ` Thomas Monjalon
  1 sibling, 0 replies; 3+ messages in thread
From: Bruce Richardson @ 2019-02-26 14:26 UTC (permalink / raw)
  To: Andrius Sirvys; +Cc: dev

On Tue, Feb 26, 2019 at 02:18:09PM +0000, Andrius Sirvys wrote:
> When building with mason, checks if the compiler is icc. If they match,
> the warning_flags are changed to ensure icc compilation is successful.
> 
> Disabled error 3656: "variable may be used before its value is set"
> in librte_telemetry, bnx2x, ixgbe and sfc as they were false positives.
> 
> Signed-off-by: Andrius Sirvys <andrius.sirvys@intel.com>
> Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---

Looks ok to me.

Acked-by: Bruce Richardson <bruce.richardson@intel.com>

If you are up for it, could you also do an additional patch to add an icc
build to "test-meson-builds.sh" if icc is found on the system?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] build: add meson support for icc
  2019-02-26 14:18 [dpdk-dev] [PATCH] build: add meson support for icc Andrius Sirvys
  2019-02-26 14:26 ` Bruce Richardson
@ 2019-02-26 17:44 ` Thomas Monjalon
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2019-02-26 17:44 UTC (permalink / raw)
  To: Andrius Sirvys; +Cc: dev, bruce.richardson, ferruh.yigit

26/02/2019 15:18, Andrius Sirvys:
> When building with mason, checks if the compiler is icc. If they match,
> the warning_flags are changed to ensure icc compilation is successful.
> 
> Disabled error 3656: "variable may be used before its value is set"
> in librte_telemetry, bnx2x, ixgbe and sfc as they were false positives.
> 
> Signed-off-by: Andrius Sirvys <andrius.sirvys@intel.com>
> Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>

I'm really not sure about supporting icc.
It may be hard to get a license for icc.
And it is not available as a simple package.
It means we are adding code that the community cannot test.
I think we should rely on free compilers only.

PS: I'm not even talking about the suspicious verification done
by the installers of the suites including icc.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-02-26 17:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-26 14:18 [dpdk-dev] [PATCH] build: add meson support for icc Andrius Sirvys
2019-02-26 14:26 ` Bruce Richardson
2019-02-26 17:44 ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).