DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Jiale, SongX" <songx.jiale@intel.com>
To: "Marchand, David" <david.marchand@redhat.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Subject: RE: [PATCH] buildtools: fix build with clang 17 and ASan
Date: Fri, 12 Jul 2024 02:29:31 +0000	[thread overview]
Message-ID: <CH0PR11MB5740320972AD4DD85830FD79E7A62@CH0PR11MB5740.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20240711113851.975368-1-david.marchand@redhat.com>

> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: Thursday, July 11, 2024 7:39 PM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Ali Alnubani <alialnu@nvidia.com>; Jiale, SongX
> <songx.jiale@intel.com>; Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
> Subject: [PATCH] buildtools: fix build with clang 17 and ASan
> 
> 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
> Cc: stable@dpdk.org
> 
> Reported-by: Ali Alnubani <alialnu@nvidia.com>
> Reported-by: Song Jiale <songx.jiale@intel.com>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
Tested-by: Jiale Song <songx.jiale@intel.com>

Can confirm it fixes the build failure in my environment.

Thanks.

  reply	other threads:[~2024-07-12  2:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-11 11:38 David Marchand
2024-07-12  2:29 ` Jiale, SongX [this message]
2024-07-12 11:25   ` David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CH0PR11MB5740320972AD4DD85830FD79E7A62@CH0PR11MB5740.namprd11.prod.outlook.com \
    --to=songx.jiale@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).