Re: [PATCH v4 0/5] perf build: Support building BPF skeletons with bpf-gcc
From: Namhyung Kim
Date: Thu Nov 19 2026 - 22:54:28 EST
On Wed, 11 Nov 2026 17:15:09 -0800, Ian Rogers wrote:
> Currently the perf build requires clang (>= 12.0.1) to compile BPF
> skeleton programs (.bpf.c -> .bpf.o). bpf-gcc (>= 14.0.0) also supports
> BPF CO-RE and BTF generation and is already supported in
> tools/testing/selftests/bpf/Makefile.
>
> This series updates the perf build to support both clang and bpf-gcc,
> broken into small bisectable commits:
> - Patch 1 fixes version-ge3 and version-lt3 in tools/scripts/utilities.mak
> so empty or fewer-than-3-component version strings do not shift awk
> fields across arguments.
> - Patch 2 syncs bpf_skel.mak's get_sys_includes with
> tools/testing/selftests/bpf/Makefile for LoongArch and MIPS.
> - Patch 3 updates Makefile.config, Makefile.perf, and bpf_skel.mak to
> prefer bpf-gcc when building perf with GCC (CC_NO_CLANG=1) and clang
> when building with Clang/LLVM (CC_NO_CLANG=0), while respecting
> explicit BPF_GCC=... or CLANG=... command-line overrides and falling
> back to whichever compiler is available.
> - Patch 4 introduces tools/build/Makefile.feature in
> tools/perf/tests/make and switches the existing libbfd and llvm probes
> to reuse libbfd-threadsafe and llvm-perf.
> - Patch 5 adds make_bpf_skel_clang and make_bpf_skel_bpf_gcc build-test
> targets to tools/perf/tests/make and verifies with
> 'perf check -q feature bpf_skeletons' that BPF skeleton support is
> enabled (or disabled with exit code 1 for make_no_bpf_skel) as
> expected.
>
> [...]
Applied to perf-tools-next, thanks!
Best regards
Namhyung