From: Quentin Monnet <qmo@kernel.org>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Mykyta Yatsenko <mykyta.yatsenko5@gmail.com>,
bpf@vger.kernel.org, ast@kernel.org, andrii@kernel.org,
daniel@iogearbox.net, kafai@meta.com, kernel-team@meta.com,
Mykyta Yatsenko <yatsenko@meta.com>
Subject: Re: [PATCH bpf-next v2] bpftool: Allow explicitly skip llvm dependency
Date: Sat, 31 Jan 2026 00:48:34 +0100 [thread overview]
Message-ID: <1d4546ca-8849-464d-9080-ef77602134c7@kernel.org> (raw)
In-Reply-To: <CAEf4BzY16OkoUQZ-Vaywb0oAL=UGY=8FVcBWLVM8oe=-bQ=4xg@mail.gmail.com>
2026-01-30 12:46 UTC-0800 ~ Andrii Nakryiko <andrii.nakryiko@gmail.com>
> On Thu, Jan 29, 2026 at 9:34 AM Quentin Monnet <qmo@kernel.org> wrote:
>>
>> 2026-01-28 23:34 UTC+0000 ~ Mykyta Yatsenko <mykyta.yatsenko5@gmail.com>
>>> From: Mykyta Yatsenko <yatsenko@meta.com>
>>>
>>> BPF selftests depend on the bpftool. In some environments we may link
>>> bpftool to llvm dynamically and then try to run somewhere where llvm
>>> library is not available.
>>> It's simpler to avoid llvm linking altogether in those cases, this
>>> change allows to do it.
>>>
>>> Signed-off-by: Mykyta Yatsenko <yatsenko@meta.com>
>>
>>
>> Hi Mykyta, thanks for the patch. Do you have any other solution to make
>> it work on your environment? We've been rejecting similar changes in the
>> past, because we don't want to encourage people to strip away the
>> disassembler when shipping bpftool [0], so I'd rather avoid adding this
>> if you have another workaround available.
>
> LLVM is a huge and somewhat problematic dependency, so I think it
> makes sense to allow to opt-out of it. Of course this shouldn't be
> abused by distro packagers and they should strive to provide
> fully-featured build of bpftool. We don't have full control over this,
> but let's hope they won't cut corners (either way they can always
> apply some ugly local patch, if they decide to cut LLVM dependency).
>
> But for a lot of environments this might not be worthwhile to wire up
> LLVM libs. I haven't checked if this is the problem for bpftool's
> bootstrap variant, but if LLVM gets pulled in for that one, it's
> especially bad :)
Hi Andrii,
The bootstrap version doesn't include "bpftool prog" commands, so it
doesn't link against any of the disassembling libraries.
As for opting out from the LLVM disassembler, I understand the lib is an
issue because of the size or when compiling a binary supposed to run on
a different machine, although I do fear this won't help with getting
bpftool shipped with the JIT disassembler.
But if really you want to do this, at least let's do it fully and give
more control for the disassembler dependencies: I think it shouldn't be
just LLVM in this case, there should be a way to opt-out from libbfd as
well, which was problematic for other reasons in the first place, and
probably some mechanism to tell whether to use libbfd or LLVM for the
disassembler when the two are available on the machine.
Quentin
next prev parent reply other threads:[~2026-01-30 23:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-28 23:34 [PATCH bpf-next v2] bpftool: Allow explicitly skip llvm dependency Mykyta Yatsenko
2026-01-29 17:34 ` Quentin Monnet
2026-01-29 17:50 ` Mykyta Yatsenko
2026-01-30 20:46 ` Andrii Nakryiko
2026-01-30 23:48 ` Quentin Monnet [this message]
2026-02-04 1:17 ` Andrii Nakryiko
2026-02-04 14:24 ` Quentin Monnet
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=1d4546ca-8849-464d-9080-ef77602134c7@kernel.org \
--to=qmo@kernel.org \
--cc=andrii.nakryiko@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=kafai@meta.com \
--cc=kernel-team@meta.com \
--cc=mykyta.yatsenko5@gmail.com \
--cc=yatsenko@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox