[v3] buildtools: fix invalid symbols
Checks
Commit Message
In scenarios where a higher clang compiler is used and ASAN is enabled,
the generated ELF file will additionally insert undefined debug symbols
with the same prefix. This causes duplicate C code to be generated.
This patch fixes this issue by skipping the unspecified symbol type.
Fixes: 6c4bf8f42432 ("buildtools: add Python pmdinfogen")
Cc: stable@dpdk.org
Signed-off-by: Mingjin Ye <mingjinx.ye@intel.com>
---
buildtools/pmdinfogen.py | 3 +++
1 file changed, 3 insertions(+)
Comments
> -----Original Message-----
> From: Mingjin Ye <mingjinx.ye@intel.com>
> Sent: Friday, July 5, 2024 11:26 AM
> To: dev@dpdk.org
> Cc: david.marchand@redhat.com; Ali Alnubani <alialnu@nvidia.com>; Mingjin Ye
> <mingjinx.ye@intel.com>; stable@dpdk.org; Dmitry Kozlyuk
> <dmitry.kozliuk@gmail.com>
> Subject: [PATCH v3] buildtools: fix invalid symbols
>
> In scenarios where a higher clang compiler is used and ASAN is enabled,
> the generated ELF file will additionally insert undefined debug symbols
> with the same prefix. This causes duplicate C code to be generated.
>
> This patch fixes this issue by skipping the unspecified symbol type.
>
> Fixes: 6c4bf8f42432 ("buildtools: add Python pmdinfogen")
> Cc: stable@dpdk.org
>
> Signed-off-by: Mingjin Ye <mingjinx.ye@intel.com>
> ---
Can confirm it fixes the build failure in my environment, thanks Mingjin.
Tested-by: Ali Alnubani <alialnu@nvidia.com>
Regards,
Ali
> -----Original Message-----
> From: Mingjin Ye <mingjinx.ye@intel.com>
> Sent: Friday, July 5, 2024 4:26 PM
> To: dev@dpdk.org
> Cc: Marchand, David <david.marchand@redhat.com>; alialnu@nvidia.com;
> Ye, MingjinX <mingjinx.ye@intel.com>; stable@dpdk.org; Dmitry Kozlyuk
> <dmitry.kozliuk@gmail.com>
> Subject: [PATCH v3] buildtools: fix invalid symbols
>
> In scenarios where a higher clang compiler is used and ASAN is enabled, the
> generated ELF file will additionally insert undefined debug symbols with the
> same prefix. This causes duplicate C code to be generated.
>
> This patch fixes this issue by skipping the unspecified symbol type.
>
> Fixes: 6c4bf8f42432 ("buildtools: add Python pmdinfogen")
> Cc: stable@dpdk.org
>
> Signed-off-by: Mingjin Ye <mingjinx.ye@intel.com>
> ---
Tested-by: Jiale Song <songx.jiale@intel.com>
On Fri, Jul 5, 2024 at 10:49 AM Mingjin Ye <mingjinx.ye@intel.com> wrote:
>
> In scenarios where a higher clang compiler is used and ASAN is enabled,
> the generated ELF file will additionally insert undefined debug symbols
> with the same prefix. This causes duplicate C code to be generated.
>
> This patch fixes this issue by skipping the unspecified symbol type.
You did not reply to my comments on v3 and here we have a new hack.
This hack is ugly and not future proof (I can imagine some other
symbols may appear in the future. If those symbols are not of type
"STT_NOTYPE" we will have to find another filter at this point...).
Please have a try with:
https://patchwork.dpdk.org/project/dpdk/patch/20240711113851.975368-1-david.marchand@redhat.com/
Thanks.
@@ -70,6 +70,9 @@ def find_by_prefix(self, prefix):
prefix = prefix.encode("utf-8") if self._legacy_elftools else prefix
for i in range(self._symtab.num_symbols()):
symbol = self._symtab.get_symbol(i)
+ # Skip unspecified symbol type
+ if symbol.entry.st_info['type'] == "STT_NOTYPE":
+ continue
if symbol.name.startswith(prefix):
yield ELFSymbol(self._image, symbol)