From patchwork Fri Apr 12 11:13:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Brzezinka X-Patchwork-Id: 139242 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 81F0B43E51; Fri, 12 Apr 2024 13:13:23 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7012040685; Fri, 12 Apr 2024 13:13:23 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by mails.dpdk.org (Postfix) with ESMTP id D9502400D6 for ; Fri, 12 Apr 2024 13:13:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712920402; x=1744456402; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=XquGDLuqD33GUL9v6yBWUlcBnNG03+c9yEPeQlVZzME=; b=BfOJj1zqcI5gcx5cPUTofywGlTtMwJdFVrBojM7Tjz12cc7z36O+4ZIc CSQ9Qa+hrEnzX05esv4YFlQf0njUD6dkJaTDpeXU5o+KH5IZhOGSAPmGi 9ouHFIk+hBGcQwQh4zEeTy9Ilk+mUoGxfx6BwIDPvqiWdyCYCxd6u+E3M wh/v4QgUf9oPebmxMmKTiyWDbV/1pSfdLY88FzWn1cdNVHTwojz/uxuRY ubpPT4iqnNdatWZ4gZDueqivGjaUh/RTGwBm4qkbAguhUQCY3ByjevEM2 yFUJC2bTbaoyNcpUflp+hH4rKD+HeNEt3UI2WcXa+CnRV6ixq+FeFCTlk Q==; X-CSE-ConnectionGUID: 0K7aHginTimRbddu827r1Q== X-CSE-MsgGUID: w7lRd4rsQeeHdjd2MF/i6Q== X-IronPort-AV: E=McAfee;i="6600,9927,11041"; a="25886846" X-IronPort-AV: E=Sophos;i="6.07,195,1708416000"; d="scan'208";a="25886846" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2024 04:13:21 -0700 X-CSE-ConnectionGUID: /cnAjV+mSbasVsCFgnkgbA== X-CSE-MsgGUID: mJGwzbMzRrKUoowQOIMdQg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,195,1708416000"; d="scan'208";a="52176535" Received: from sbrzez.igk.intel.com ([10.211.11.150]) by orviesa002.jf.intel.com with ESMTP; 12 Apr 2024 04:13:19 -0700 From: Sebastian Brzezinka To: dev@dpdk.org Cc: Alexey Marchuk , Sebastian Brzezinka Subject: [PATCH 1/2] meson/mlx5: Suppress -Wunused-value diagnostic Date: Fri, 12 Apr 2024 13:13:16 +0200 Message-Id: <20240412111317.3530529-1-sebastian.brzezinka@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Alexey Marchuk mlx5 common library checks if several symbols/definitions are presented in system header files. If some are not presented, they will be enabled by mlx5_glue library. The problem appears with clang and '-Werror' - code generated by meson is not compiled due to unused variable: Code: #include int main(void) { /* If it's not defined as a macro, try to use as a symbol */ #ifndef mlx5dv_create_flow_action_packet_reformat mlx5dv_create_flow_action_packet_reformat; #endif return 0; } Compiler stdout: Compiler stderr: /hpc/local/work/alexeymar/repo/spdk/dpdk/build-tmp/meson-private/tmp5obnak86/testfile.c:6:17: error: expression result unused [-Werror,-Wunused-value] mlx5dv_create_flow_action_packet_reformat; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ As result, almost all symbols are enabled in mlx5_glue while they exist is system headers. As result, we get multiple symbols redefenitions when we compile mlx5_common. As a solution for this problem we can suppress -Wunused-vaurable using pragma DPDK 23.11 note: Starting with commit below, all cflags are passed to the has_header_symbol(). (33d6694) build: use C11 standard To make sure that the symbol is properly detected, the pedantic flags needs to be removed. Signed-off-by: Alexey Marchuk Signed-off-by: Sebastian Brzezinka --- drivers/common/mlx5/linux/meson.build | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/common/mlx5/linux/meson.build b/drivers/common/mlx5/linux/meson.build index cdee40c553..f3b8e5741b 100644 --- a/drivers/common/mlx5/linux/meson.build +++ b/drivers/common/mlx5/linux/meson.build @@ -209,7 +209,11 @@ if libmtcr_ul_found endif foreach arg:has_sym_args - mlx5_config.set(arg[0], cc.has_header_symbol(arg[1], arg[2], dependencies: libs, args: cflags)) + file_prefix = '#pragma clang diagnostic ignored "-Wunused-value"' + cflags += [ + '-Wno-pedantic', + ] + mlx5_config.set(arg[0], cc.has_header_symbol(arg[1], arg[2], prefix : file_prefix, dependencies: libs, args: cflags)) endforeach foreach arg:has_member_args file_prefix = '#include <' + arg[1] + '>'