Re: [PATCH 1/2] tools/build: Add a feature test for libopenssl

From: Namhyung Kim

Date: Thu Dec 04 2025 - 02:52:30 EST


Hi Ian,

On Wed, Dec 03, 2025 at 04:34:56PM -0800, Ian Rogers wrote:
> On Wed, Dec 3, 2025 at 3:29 PM Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
> >
> > It's used by bpftool and the kernel build. Let's add a feature test so
> > that perf can decide what to do based on the availability.
>
> It seems strange to add a feature test that bpftool is missing and
> then use it only in the perf build. The signing of bpf programs isn't
> something I think we need for skeleton support in perf. I like the
> feature test, could we add it and use it in bpftool? The only two
> functions using openssl appear to be:
>
> __u32 register_session_key(const char *key_der_path)
> int bpftool_prog_sign(struct bpf_load_and_run_opts *opts)
>
> so we can do the whole feature test then #ifdef HAVE_FEATURE... stub
> static inline versions of the functions game?
>
> Perhaps we only need the bootstrap version of bpftool in perf and we
> can just avoid dependencies that way. Looking at bpftool's build I see
> that sign.o/c with those functions in is part of the bootstrap version
> of bpftool :-(

BPF folks said it's a required library and they don't want to build
without it.

https://lore.kernel.org/linux-perf-users/e44f70bf-8f50-4a4b-97b8-eaf988aabced@xxxxxxxxxx/

Thanks,
Namhyung