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 3AEC445610; Fri, 12 Jul 2024 13:26:05 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 80F0B40662; Fri, 12 Jul 2024 13:26:04 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 18D2D40261 for ; Fri, 12 Jul 2024 13:26:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720783562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Haft1nZEuage0dl6/BS0s/NumR5o1Saswld5fK6QDLU=; b=R3ZMT7V3GnL0gvt/xBV1/zh7W6hqiZp51sCcGwc1D3UfpcNzBALU5MwHX3XAFLA5EzwCJr zJOq+DlmosrtCCYOqyWeKTSEaTJdr7rV+JPUScpocRQgrN5IluQ3QWnnXOAqHaxclY1cjV 77k5X0ExMLqga1E4PlbSW1l70X/0svw= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-591-cqEGdRDGOf6kU9tfRiL1GQ-1; Fri, 12 Jul 2024 07:26:01 -0400 X-MC-Unique: cqEGdRDGOf6kU9tfRiL1GQ-1 Received: by mail-lj1-f199.google.com with SMTP id 38308e7fff4ca-2ee87e69b53so18443901fa.0 for ; Fri, 12 Jul 2024 04:26:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720783559; x=1721388359; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Haft1nZEuage0dl6/BS0s/NumR5o1Saswld5fK6QDLU=; b=J8JpuAPTz9VauyD28ZO751zb0tKJxKlGtRu1qDx8DO56fz/MlyuU6H1xRKvY/0adHn ugkGnl2KLOhvTDit5QxvYSO7dQgwUGrcWjeKpriYLsgFkigFeSt8XS4O4n098zyZFNaW P7R/qEuNPBy3ys8i6A7L0ziLF4sbJOHL65Nme56A9/2QTshr9KbmCQsUhW/Lc+DqyqZO HJknjxrA2uyLbqKAvWGxI98oJPga8PDIEENWv4hUy1KoYJX1hOPyvdKIM+FqMr1TMe3N B+PmurCz2487gw0+Ioh4+n2vXPlMloEvifPjE90QEAIwyDHqTv93miefykC40ExH8/jS OFbg== X-Gm-Message-State: AOJu0Ywf6n5V0m/YecRmZx83KZAU7hsOK0NXuH8kG+UNwlRkbFPS8JTr 6qrOsBUvp/KLFUhqnnakb53Vr5Oh3HEDOi0JnCsHZmO7Yz1/uji1k05auTJFqdie0nOmJXCRsBJ U8OR3tAUp4ZOeiivJ1z9Hi74CIFuLA+CpBPPxgrW2dI3dA9HCM7Tx5crlfxjjBkHqI5lK0DqjLT ks4xPMl7W6M3tCTA0= X-Received: by 2002:a2e:a36c:0:b0:2ec:51b5:27be with SMTP id 38308e7fff4ca-2eeb30e3c73mr83683301fa.12.1720783559187; Fri, 12 Jul 2024 04:25:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF9NecbPn5ZHI6680xukujVGuXdqxpr/iWEEj8O4sv9XjJpq/Tutymyug7tE3qBmaBJ1DQ7yIsIh6HNOVNDb/o= X-Received: by 2002:a2e:a36c:0:b0:2ec:51b5:27be with SMTP id 38308e7fff4ca-2eeb30e3c73mr83683191fa.12.1720783558790; Fri, 12 Jul 2024 04:25:58 -0700 (PDT) MIME-Version: 1.0 References: <20240711113851.975368-1-david.marchand@redhat.com> In-Reply-To: From: David Marchand Date: Fri, 12 Jul 2024 13:25:47 +0200 Message-ID: Subject: Re: [PATCH] buildtools: fix build with clang 17 and ASan To: David Marchand Cc: "dev@dpdk.org" , dpdk stable , Ali Alnubani , Dmitry Kozlyuk , "Jiale, SongX" X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 On Fri, Jul 12, 2024 at 4:29=E2=80=AFAM Jiale, SongX wrote: > > 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 cr= eates > > 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)) =3D > > "PMD_INFO_STRING=3D {\"name\": \"\", \"pci_ids\": []}"; > > build/drivers/rte_net_null.pmd.c:const char _pmd_info[] > > __attribute__((used)) =3D > > "PMD_INFO_STRING=3D {\"name\": \"\", \"pci_ids\": []}"; > > > > A simple reproducer: > > $ CC=3Dclang meson setup build -Denable_apps=3Dtest-pmd -Ddisable_libs= =3D* \ > > -Denable_drivers=3Dnet/null,net/af_packet -Dtests=3Dfalse \ > > -Db_lundef=3Dfalse -Db_sanitize=3Daddress > > > > $ 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 > > Cc: stable@dpdk.org > > > > Reported-by: Ali Alnubani > > Reported-by: Song Jiale > > Signed-off-by: David Marchand > Tested-by: Jiale Song Applied, thanks. --=20 David Marchand