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 C4D0F455AD for ; Mon, 15 Jul 2024 17:29:24 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BFAFB40DD0; Mon, 15 Jul 2024 17:29:24 +0200 (CEST) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by mails.dpdk.org (Postfix) with ESMTP id 1585E402DD for ; Mon, 15 Jul 2024 17:29:23 +0200 (CEST) Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-3678aa359b7so3330775f8f.1 for ; Mon, 15 Jul 2024 08:29:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721057363; x=1721662163; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hPpqVNfqWuIWWBFI3jhjCD2fBkd3JbJCOzYYJ4XwtnY=; b=hgE4kjEpnKfxHpX2YXBSOIgBSFlgIKwtAT6bKjvUapYgzMq1tVze6nuvd38VzUnJah +n7mxV761Y2dPIAzhc2xqJBD9maz3957A9WLrbvjcl5KszA/XlgibJzC4CEbqqaBOjQu sMVXxsQjfwhrXkZ7PwwQhDXzPw99blgMq5Jp3bZbP9ZJC5K59/Zzub1MqB1KXkNXgBxz WCGJc8LTIG/shGx7eXVX/w+jvH+UsfChTtuFetz6sZeR0PAqV3QA4p+7DUxICc/CMh+7 Ii/yACBkh1pPokaM3g4I77P4YytTffrFkRpNEBHehFT9KmRNdE4YXjQH1TfbtD7QR+jp /Knw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721057363; x=1721662163; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hPpqVNfqWuIWWBFI3jhjCD2fBkd3JbJCOzYYJ4XwtnY=; b=FMlnmH5qEop25IJHo4qS4M4WSox31HiA6eKT+SJMbR5W5wuwiijd+ZCNxugtvO2arC 0dlQOflOfaP7nq9uGqqmYp0VLfuP5UXFYgubBKSuALRopG8iRcMYrwb3rWcdoOl2Aeu7 mzRXhveK4IjSBJ7KTubFlZkVify+jy6XwQ5uqHgMn830bwi9ukFsRgYYljeBeNQfhIXC HPzcFBUwgXwV5NEGNrGCOJ20oyh7PJJNiWUAQ7FVKcq9WS153a4FN7sr4yQX3RVoUt9h FHIAk9pVtxGAD/nyrKldPAqxVqxaOH5/xmDjyCyYuLFHpqvi+wvm0VuLSxIX+M+Qlbvc Fx5g== X-Forwarded-Encrypted: i=1; AJvYcCWFzCsZjCD64Gx2FHU/M/Ky0e2Raaiw77Ev8tHARzYtYGHFFahyxGFcpU5hRfCwX3IZ7e6iWeE+vvVrau40PEs= X-Gm-Message-State: AOJu0Yze+C+k+dRUByezYMMx9FhicM0J0p0DtAnsqEV4PW8fgfp7WopY jJZxN/Tcb9SGhnQX5opfsIeN/fDGALZ1LmhHjI/ANBiOWezicdej3OEDpdDQ7Do= X-Google-Smtp-Source: AGHT+IF+wBRyATYDSetIwpach1wQewrBPwmsI76/2HI2iwq3Gg4htU+CLP2Doxolqhm1cU3vlFT6ow== X-Received: by 2002:a05:6000:1363:b0:360:7856:fa62 with SMTP id ffacd0b85a97d-367ff6f2ba9mr7967803f8f.15.1721057362742; Mon, 15 Jul 2024 08:29:22 -0700 (PDT) Received: from localhost ([2a01:4b00:d036:ae00:7aef:1aaa:3dff:d546]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427a5e8387fsm91402205e9.20.2024.07.15.08.29.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jul 2024 08:29:22 -0700 (PDT) From: luca.boccassi@gmail.com To: David Marchand Cc: Ali Alnubani , Song Jiale , dpdk stable Subject: patch 'buildtools: fix build with clang 17 and ASan' has been queued to stable release 22.11.6 Date: Mon, 15 Jul 2024 16:26:21 +0100 Message-Id: <20240715152704.2229503-43-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240715152704.2229503-1-luca.boccassi@gmail.com> References: <20240624235907.885628-81-luca.boccassi@gmail.com> <20240715152704.2229503-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 22.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/17/24. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/f7dcc5e44f9a545a5e3edfaa15a2e03516dd25f1 Thanks. Luca Boccassi --- >From f7dcc5e44f9a545a5e3edfaa15a2e03516dd25f1 Mon Sep 17 00:00:00 2001 From: David Marchand Date: Thu, 11 Jul 2024 11:35:36 +0200 Subject: [PATCH] buildtools: fix build with clang 17 and ASan [ upstream commit e1d8a879abac499a66801bb8238d59ba52f4fc6b ] ASan included in clang 17 and later suffixes symbols. $ nm build/drivers/libtmp_rte_net_null.a | grep this_pmd 0000000000000000 r this_pmd_name3 0000000000000000 n this_pmd_name3.f2cd16678ab09dba8fd23405d8d11fce This breaks the detection of driver symbols in pmdinfogen which then creates duplicate symbols "_pmd_info" in many drivers. Such duplicate symbols trigger a link error. $ grep -w _pmd_info build/drivers/rte_net_*.pmd.c build/drivers/rte_net_af_packet.pmd.c:const char _pmd_info[] __attribute__((used)) = "PMD_INFO_STRING= {\"name\": \"\", \"pci_ids\": []}"; build/drivers/rte_net_null.pmd.c:const char _pmd_info[] __attribute__((used)) = "PMD_INFO_STRING= {\"name\": \"\", \"pci_ids\": []}"; A simple reproducer: $ CC=clang meson setup build -Denable_apps=test-pmd -Ddisable_libs=* \ -Denable_drivers=net/null,net/af_packet -Dtests=false \ -Db_lundef=false -Db_sanitize=address $ ninja -C build Before this patch, the pmdinfogen script was relying on a symbol name starting with this_pmd_name. On the other hand, what this script needs is symbols whose names are this_pmd_name ## __COUNTER__, see below an example for PCI driver symbols (the same applies to other buses). $ git grep -w RTE_PMD_EXPORT_NAME drivers/bus/pci/bus_pci_driver.h drivers/bus/pci/bus_pci_driver.h:RTE_PMD_EXPORT_NAME(nm, __COUNTER__) $ git grep -B1 this_pmd_name lib/eal/ lib/eal/include/rte_dev.h-#define RTE_PMD_EXPORT_NAME(name, idx) \ lib/eal/include/rte_dev.h:static const char RTE_PMD_EXPORT_NAME_ARRAY(this_pmd_name, idx) \ $ git grep define.RTE_PMD_EXPORT_NAME_ARRAY lib/eal/include/rte_dev.h lib/eal/include/rte_dev.h:#define RTE_PMD_EXPORT_NAME_ARRAY(n, idx) n##idx[] Adjust the symbol filter for both ELF and COFF implementations. Bugzilla ID: 1466 Reported-by: Ali Alnubani Reported-by: Song Jiale Signed-off-by: David Marchand Tested-by: Song Jiale --- buildtools/pmdinfogen.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/buildtools/pmdinfogen.py b/buildtools/pmdinfogen.py index 2a44f17bda..dfb89500c0 100755 --- a/buildtools/pmdinfogen.py +++ b/buildtools/pmdinfogen.py @@ -6,6 +6,7 @@ import argparse import ctypes import json +import re import sys import tempfile @@ -66,11 +67,11 @@ class ELFImage: return [symbol] return None - def find_by_prefix(self, prefix): - prefix = prefix.encode("utf-8") if self._legacy_elftools else prefix + def find_by_pattern(self, pattern): + pattern = pattern.encode("utf-8") if self._legacy_elftools else pattern for i in range(self._symtab.num_symbols()): symbol = self._symtab.get_symbol(i) - if symbol.name.startswith(prefix): + if re.match(pattern, symbol.name): yield ELFSymbol(self._image, symbol) @@ -97,9 +98,9 @@ class COFFImage: def is_big_endian(self): return False - def find_by_prefix(self, prefix): + def find_by_pattern(self, pattern): for symbol in self._image.symbols: - if symbol.name.startswith(prefix): + if re.match(pattern, symbol.name): yield COFFSymbol(self._image, symbol) def find_by_name(self, name): @@ -199,7 +200,7 @@ class Driver: def load_drivers(image): drivers = [] - for symbol in image.find_by_prefix("this_pmd_name"): + for symbol in image.find_by_pattern("^this_pmd_name[0-9]+$"): drivers.append(Driver.load(image, symbol)) return drivers -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-07-15 16:19:36.833194817 +0100 +++ 0043-buildtools-fix-build-with-clang-17-and-ASan.patch 2024-07-15 16:19:34.564206378 +0100 @@ -1 +1 @@ -From e1d8a879abac499a66801bb8238d59ba52f4fc6b Mon Sep 17 00:00:00 2001 +From f7dcc5e44f9a545a5e3edfaa15a2e03516dd25f1 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit e1d8a879abac499a66801bb8238d59ba52f4fc6b ] + @@ -49 +50,0 @@ -Cc: stable@dpdk.org