mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: bot+bpf-ci@kernel.org
To: ihor.solodrai@linux.dev,ast@kernel.org,andrii@kernel.org,daniel@iogearbox.net,eddyz87@gmail.com,olsajiri@gmail.com,yatsenko@meta.com,alexis.lothore@bootlin.com
Cc: ameryhung@gmail.com,bpf@vger.kernel.org,linux-kernel@vger.kernel.org,kernel-team@meta.com,ast@kernel.org,andrii@kernel.org,daniel@iogearbox.net,martin.lau@kernel.org,eddyz87@gmail.com,yonghong.song@linux.dev,clm@meta.com,ihor.solodrai@linux.dev
Subject: Re: [PATCH bpf v3 01/15] selftests/bpf: Pass through build flags to bpftool and resolve_btfids
Date: Fri, 20 Feb 2026 22:57:45 +0000 (UTC)	[thread overview]
Message-ID: <edac02ca77865be9cc18b013f5209a8fb0d8a4c443ce16dce8ad368a9ecefe05@mail.kernel.org> (raw)
In-Reply-To: <20260220222604.1155148-2-ihor.solodrai@linux.dev>

[-- Attachment #1: Type: text/plain, Size: 2174 bytes --]

> diff --git a/tools/bpf/resolve_btfids/Makefile b/tools/bpf/resolve_btfids/Makefile
> index 1733a6e93a07..ef083602b73a 100644
> --- a/tools/bpf/resolve_btfids/Makefile
> +++ b/tools/bpf/resolve_btfids/Makefile
> @@ -65,6 +65,9 @@ $(BPFOBJ): $(wildcard $(LIBBPF_SRC)/*.[ch] $(LIBBPF_SRC)/Makefile) | $(LIBBPF_OU
>  LIBELF_FLAGS := $(shell $(HOSTPKG_CONFIG) libelf --cflags 2>/dev/null)
>  LIBELF_LIBS  := $(shell $(HOSTPKG_CONFIG) libelf --libs 2>/dev/null || echo -lelf)
>
> +ZLIB_LIBS  := $(shell $(HOSTPKG_CONFIG) zlib --libs 2>/dev/null || echo -lz)
> +ZSTD_LIBS  := $(shell $(HOSTPKG_CONFIG) libzstd --libs 2>/dev/null || echo -lzstd)

The "|| echo -lzstd" fallback makes zstd an unconditional link
dependency. On systems where libzstd-dev is not installed, pkg-config
fails and the fallback provides -lzstd, but the linker cannot find the
library and the build fails.

bpftool handles the same transitive dependency conditionally via a
feature test:

tools/bpf/bpftool/Makefile:
    ifeq ($(feature-libelf-zstd),1)
    LIBS += -lzstd
    LIBS_BOOTSTRAP += -lzstd
    endif

Would it be safer to drop the fallback here so ZSTD_LIBS is empty
when zstd is not available?

    ZSTD_LIBS := $(shell $(HOSTPKG_CONFIG) libzstd --libs 2>/dev/null)

This would still link zstd when present (needed for the static linking
case where libelf.a pulls in ZSTD symbols from elf_compress.o), but
avoid breaking dynamic builds on systems without libzstd-dev.

[ ... ]


---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md

CI run summary: https://github.com/kernel-patches/bpf/actions/runs/22243753316

AI-authorship-score: low
AI-authorship-explanation: Human-characteristic typo in commit message, natural lore discussion with incremental debugging, and standard Makefile pattern reuse all indicate human authorship.
issues-found: 1
issue-severity-score: low
issue-severity-explanation: Unconditional zstd link fallback in resolve_btfids Makefile can break builds on systems without libzstd-dev, but the affected scenario is narrow and limited to the selftests build system.

  reply	other threads:[~2026-02-20 22:57 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-20 22:25 [PATCH bpf v3 00/15] selftests/bpf: Fixes for userspace ASAN Ihor Solodrai
2026-02-20 22:25 ` [PATCH bpf v3 01/15] selftests/bpf: Pass through build flags to bpftool and resolve_btfids Ihor Solodrai
2026-02-20 22:57   ` bot+bpf-ci [this message]
2026-02-21  4:23     ` Ihor Solodrai
2026-03-02 15:22       ` Vitaly Chikunov
2026-03-02 18:01         ` Ihor Solodrai
2026-03-02 20:27           ` Vitaly Chikunov
2026-03-02 22:42             ` Ihor Solodrai
2026-03-03  4:01               ` Vitaly Chikunov
2026-02-20 22:25 ` [PATCH bpf v3 02/15] resolve_btfids: Fix memory leaks reported by ASAN Ihor Solodrai
2026-02-20 22:25 ` [PATCH bpf v3 03/15] selftests/bpf: Add DENYLIST.asan Ihor Solodrai
2026-02-20 22:25 ` [PATCH bpf v3 04/15] selftests/bpf: Refactor bpf_get_ksyms() trace helper Ihor Solodrai
2026-02-20 22:25 ` [PATCH bpf v3 05/15] selftests/bpf: Fix memory leaks in tests Ihor Solodrai
2026-02-20 22:25 ` [PATCH bpf v3 06/15] selftests/bpf: Fix cleanup in check_fd_array_cnt__fd_array_too_big() Ihor Solodrai
2026-02-20 22:25 ` [PATCH bpf v3 07/15] veristat: Fix a memory leak for preset ENUMERATOR Ihor Solodrai
2026-02-20 22:25 ` [PATCH bpf v3 08/15] selftests/bpf: Fix use-after-free in xdp_metadata test Ihor Solodrai
2026-02-20 22:25 ` [PATCH bpf v3 09/15] selftests/bpf: Fix double thread join in uprobe_multi_test Ihor Solodrai
2026-02-20 22:25 ` [PATCH bpf v3 10/15] selftests/bpf: Fix resource leaks caused by missing cleanups Ihor Solodrai
2026-02-20 22:26 ` [PATCH bpf v3 11/15] selftests/bpf: Free bpf_object in test_sysctl Ihor Solodrai
2026-02-20 22:26 ` [PATCH bpf v3 12/15] selftests/bpf: Fix array bounds warning in jit_disasm_helpers Ihor Solodrai
2026-02-20 22:26 ` [PATCH bpf v3 13/15] selftests/bpf: Fix out-of-bounds array access bugs reported by ASAN Ihor Solodrai
2026-02-20 22:26 ` [PATCH bpf v3 14/15] selftests/bpf: Check BPFTOOL env var in detect_bpftool_path() Ihor Solodrai
2026-02-20 22:26 ` [PATCH bpf v3 15/15] selftests/bpf: Don't override SIGSEGV handler with ASAN Ihor Solodrai
2026-02-21  0:52   ` Eduard Zingerman

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=edac02ca77865be9cc18b013f5209a8fb0d8a4c443ce16dce8ad368a9ecefe05@mail.kernel.org \
    --to=bot+bpf-ci@kernel.org \
    --cc=alexis.lothore@bootlin.com \
    --cc=ameryhung@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=clm@meta.com \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=ihor.solodrai@linux.dev \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@kernel.org \
    --cc=olsajiri@gmail.com \
    --cc=yatsenko@meta.com \
    --cc=yonghong.song@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

all inboxes | Powered by JetHome®