From: sashiko-bot@kernel.org
To: "Ian Rogers" <irogers@google.com>
Cc: bpf@vger.kernel.org, linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v1 1/7] tools build: Add feature check for elfutils libasm
Date: Tue, 09 Jun 2026 05:28:42 +0000 [thread overview]
Message-ID: <20260609052842.78E3B1F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260609051759.405027-2-irogers@google.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] The `ASMLIBS` definition lacks required dependencies (`-lebl` and `-ldl`) for static builds and older `elfutils` versions, and relies on an unexported symbol in newer versions, guaranteeing spurious feature test failures.
- [Medium] Passing `NULL` to the third parameter of `disasm_begin` triggers a `-Wint-conversion` error, spuriously failing the feature test.
--
commit aae74fddf97207e82eca20f4dc0b26d8dfeda751
Author: Ian Rogers <irogers@google.com>
tools build: Add feature check for elfutils libasm
This commit introduces a build-time feature test for the elfutils libasm
library in the shared tools/build system. It adds the test program and
updates the Makefiles to attempt building it to detect support.
> diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
> index 62909a9c799d3..f0f39a2ab2035 100644
> --- a/tools/build/feature/Makefile
> +++ b/tools/build/feature/Makefile
[ ... ]
> @@ -184,6 +185,11 @@ ifeq ($(findstring -static,${LDFLAGS}),-static)
> DWARFLIBS += -ldl
> endif
>
> +ASMLIBS := -lasm -ldw -lelf
> +ifeq ($(findstring -static,${LDFLAGS}),-static)
> + ASMLIBS += -lz -llzma -lbz2 -lzstd
> +endif
[Severity: Medium]
Does this ASMLIBS definition miss required legacy dependencies? For static
builds on older elfutils versions, omitting -lebl and -ldl here might cause
the feature test to fail to link, silently disabling the libasm feature.
> diff --git a/tools/build/feature/test-libasm.c b/tools/build/feature/test-libasm.c
> new file mode 100644
> index 0000000000000..f3598ad1cc9e1
> --- /dev/null
> +++ b/tools/build/feature/test-libasm.c
> @@ -0,0 +1,19 @@
> +// SPDX-License-Identifier: GPL-2.0
> +#include <stddef.h>
> +#include <elfutils/libasm.h>
> +#include <gelf.h>
> +
> +typedef struct ebl Ebl;
> +extern Ebl *ebl_openbackend (Elf *elf);
> +extern void ebl_closebackend (Ebl *ebl);
> +
> +int main(void)
> +{
> + Elf *elf = elf_begin(0, ELF_C_READ, NULL);
> + Ebl *ebl = ebl_openbackend(elf);
[Severity: Medium]
Is it safe to rely on ebl_openbackend() here? Modern versions of elfutils
(>= 0.177) do not export ebl_openbackend dynamically. Could this cause
unintended linker errors and spuriously fail the feature test?
> + DisasmCtx_t *ctx = disasm_begin(ebl, elf, NULL);
[Severity: Medium]
Does passing NULL as the third parameter here trigger a -Wint-conversion
compiler warning? Since the feature test is compiled with -Werror, expecting
an integer or boolean but receiving a pointer will cause a build failure
and silently disable the libasm feature.
> + disasm_end(ctx);
> + ebl_closebackend(ebl);
> + elf_end(elf);
> + return 0;
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260609051759.405027-1-irogers@google.com?part=1
next prev parent reply other threads:[~2026-06-09 5:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-09 5:17 [PATCH v1 0/7] perf annotate: Add elfutils libasm disassembler backend Ian Rogers
2026-06-09 5:17 ` [PATCH v1 1/7] tools build: Add feature check for elfutils libasm Ian Rogers
2026-06-09 5:28 ` sashiko-bot [this message]
2026-06-09 5:17 ` [PATCH v1 2/7] perf build: Add build support and capability " Ian Rogers
2026-06-09 5:28 ` sashiko-bot
2026-06-09 5:17 ` [PATCH v1 3/7] perf annotate: Implement elfutils libasm disassembler backend Ian Rogers
2026-06-09 5:30 ` sashiko-bot
2026-06-09 5:17 ` [PATCH v1 4/7] perf annotate: Add --disassembler command-line option Ian Rogers
2026-06-09 5:17 ` [PATCH v1 5/7] perf test: Enhance annotate test coverage and isolate config Ian Rogers
2026-06-09 5:28 ` sashiko-bot
2026-06-09 5:17 ` [PATCH v1 6/7] perf annotate: Support BPF JIT disassembly via genelf Ian Rogers
2026-06-09 5:33 ` sashiko-bot
2026-06-09 5:17 ` [PATCH v1 7/7] perf test: Add BPF JIT annotation test coverage for all disassemblers Ian Rogers
2026-06-09 5:36 ` sashiko-bot
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=20260609052842.78E3B1F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=irogers@google.com \
--cc=linux-perf-users@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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