From: Quentin Monnet <qmo@kernel.org>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Andrii Nakryiko <andrii@kernel.org>,
bpf@vger.kernel.org, kernel-team@meta.com
Subject: Re: [PATCH bpf-next] bpftool: Strip all -Wformat* flags from bootstrap libbpf build
Date: Thu, 2 Jul 2026 15:57:53 +0100 [thread overview]
Message-ID: <6a8fbf80-5672-4691-aa60-8f8b3b75aa96@kernel.org> (raw)
In-Reply-To: <CAEf4BzaDjuLTsoTFXpPMp33KbKHvXkDv0Gwf2T=JVQBqGgZ+5A@mail.gmail.com>
2026-07-01 11:15 UTC-0700 ~ Andrii Nakryiko <andrii.nakryiko@gmail.com>
> On Wed, Jul 1, 2026 at 5:54 AM Quentin Monnet <qmo@kernel.org> wrote:
>>
>> 2026-06-30 13:54 UTC-0700 ~ Andrii Nakryiko <andrii@kernel.org>
>>> Commit 9080b97689db ("bpftool: Pass host flags to bootstrap libbpf")
>>> started building the bootstrap libbpf with HOST_CFLAGS, stripping the
>>> warning options that are unsuitable for that build by filtering out
>>> -W -Wall -Wextra -Wformat -Wformat-signedness.
>>>
>>> HOST_CFLAGS inherits EXTRA_WARNINGS, which includes -Wformat-security
>>> and -Wformat-y2k. The filter drops -Wall and -Wformat (the latter being
>>> what actually enables -Wformat), but leaves those two -Wformat-* children
>>> in LIBBPF_BOOTSTRAP_CFLAGS. Building the bootstrap libbpf with it then
>>> warns:
>>>
>>> cc1: warning: '-Wformat-y2k' ignored without '-Wformat'
>>> cc1: warning: '-Wformat-security' ignored without '-Wformat'
>>>
>>> The warning is easy to miss in an in-tree build: tools/lib/bpf/Makefile
>>> re-adds -Wall via "override CFLAGS += -Wall", which re-enables -Wformat
>>> for the libbpf objects, so only libbpf's feature-detection probe (which
>>> uses the passed CFLAGS verbatim) leaks the two warnings. The standalone
>>> libbpf Makefile (github.com/libbpf/libbpf, used by the bpftool mirror)
>>> instead uses "CFLAGS ?= ... -Wall", which the passed-in CFLAGS overrides,
>>> so -Wall is never re-added and every bootstrap object warns.
>>>
>>> Use a -Wformat% wildcard in the filter-out so the orphaned children are
>>> removed together with the parent.
>>>
>>> Fixes: 9080b97689db ("bpftool: Pass host flags to bootstrap libbpf")
>>> Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
>>
>>
>> Looks good, thank you.
>>
>> Acked-by: Quentin Monnet <qmo@kernel.org>
>
> thanks, applied to bpf-next, please do another bpftool sync when you
> get a chance
Done now, it should be all sorted in the GitHub mirror. Thanks!
Quentin
next prev parent reply other threads:[~2026-07-02 14:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-30 20:54 [PATCH bpf-next] bpftool: Strip all -Wformat* flags from bootstrap libbpf build Andrii Nakryiko
2026-07-01 12:53 ` Quentin Monnet
2026-07-01 18:15 ` Andrii Nakryiko
2026-07-02 14:57 ` Quentin Monnet [this message]
2026-07-02 16:21 ` Andrii Nakryiko
2026-07-01 18:20 ` patchwork-bot+netdevbpf
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=6a8fbf80-5672-4691-aa60-8f8b3b75aa96@kernel.org \
--to=qmo@kernel.org \
--cc=andrii.nakryiko@gmail.com \
--cc=andrii@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=kernel-team@meta.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.