From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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] + '>' -- 2.34.1 --------------------------------------------------------------------- Intel Technology Poland sp. z o.o. ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN. Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu ustawy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w transakcjach handlowych. Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione. This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.