From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 48C093256 for ; Tue, 26 Feb 2019 15:18:23 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Feb 2019 06:18:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,415,1544515200"; d="scan'208";a="125340575" Received: from silpixa00380299.ir.intel.com ([10.237.223.68]) by fmsmga007.fm.intel.com with ESMTP; 26 Feb 2019 06:18:21 -0800 From: Andrius Sirvys To: bruce.richardson@intel.com Cc: dev@dpdk.org, Andrius Sirvys Date: Tue, 26 Feb 2019 14:18:09 +0000 Message-Id: <1551190689-139613-1-git-send-email-andrius.sirvys@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] build: add meson support for icc X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 14:18:23 -0000 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 Tested-by: Ferruh Yigit --- 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