From patchwork Fri Apr 5 11:13:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Brzezinka X-Patchwork-Id: 139116 X-Patchwork-Delegate: rasland@nvidia.com 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 CF6A743E00; Fri, 5 Apr 2024 13:13:19 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BD7E3402D4; Fri, 5 Apr 2024 13:13:19 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) by mails.dpdk.org (Postfix) with ESMTP id BDEA6402CE for ; Fri, 5 Apr 2024 13:13:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712315598; x=1743851598; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=WGUz4QKtj8EBIOWu7nVxdT14EtZ0T7rGo618OMwqPW4=; b=UnfBSF69DITLQlhdD6uBvTPRxXNPn9DmPKCxjlPzKZ1mekUP+afiE6kt oaRIHrcSEd7OmJHS47NxFqZBv9lYT8nmoYbbQI9expTA+XbfZwmLQnRzd dWaX6uJmsClnE2ZZNDzEZCLo2UwFTXNSIaEbdMliEExf5gGwSTszVzulU 37YbB/DWnTzNKsZ671eF3FUSu2IXtdSTcywagDgsjqNKUnXxaSgpMR+9Z ZfcUc/lF5qivzCjJs3/NH8rDf0HS3ZSTDaBJ0C2Mluj+3TotOKK4hBbRR EueD+bC2Hq5mMQ7W83Bj0Ntjb0KlGzfsZzn8wxclZ9cegokmtjN6ReMhH Q==; X-CSE-ConnectionGUID: o3pT7LBFR6G2xczKBqJ1xw== X-CSE-MsgGUID: r2vvf+cPTDKcce+3Rye82w== X-IronPort-AV: E=McAfee;i="6600,9927,11034"; a="11415260" X-IronPort-AV: E=Sophos;i="6.07,181,1708416000"; d="scan'208";a="11415260" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Apr 2024 04:13:17 -0700 X-CSE-ConnectionGUID: wTmybQWRQdWFnyeZq9jBZg== X-CSE-MsgGUID: pyS7NcK6TpW8y0aHEUk5ZQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,181,1708416000"; d="scan'208";a="19051974" Received: from sbrzez.igk.intel.com ([10.211.11.150]) by fmviesa010.fm.intel.com with ESMTP; 05 Apr 2024 04:13:15 -0700 From: Sebastian Brzezinka To: dev@dpdk.org Cc: Alexey Marchuk , Sebastian Brzezinka Subject: [PATCH] meson/mlx5: Suppress -Wunused-value diagnostic Date: Fri, 5 Apr 2024 13:13:10 +0200 Message-Id: <20240405111310.3280084-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 bellow, 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 b3a64547c5..84b2c64041 100644 --- a/drivers/common/mlx5/linux/meson.build +++ b/drivers/common/mlx5/linux/meson.build @@ -231,7 +231,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] + '>'