Re: [PATCH v2 2/2] perf build: compile BPF skeletons with -mcpu=v3

From: Arnaldo Carvalho de Melo

Date: Thu Jun 04 2026 - 09:49:04 EST


On Sat, May 30, 2026 at 03:39:32PM -0700, Ian Rogers wrote:
> On Sat, May 30, 2026 at 12:55 PM Suchit Karunakaran
> <suchitkarunakaran@xxxxxxxxx> wrote:
> >
> > The lock_contention BPF program uses __sync_val_compare_and_swap()
> > to atomically update the max_time and min_time fields in
> > contention_data. This builtin lowers to the BPF_CMPXCHG instruction,
> > which is only available in BPF ISA v3. Without an explicit -mcpu flag,
> > Clang targets BPF v1/v2 by default on older toolchains (Clang < 18),
> > causing build errors when v3 instructions are emitted.
> >
> > Add -mcpu=v3 to CLANG_OPTIONS, which is used exclusively in the BPF
> > skeleton compilation rule.
> >
> > Signed-off-by: Suchit Karunakaran <suchitkarunakaran@xxxxxxxxx>
>
> Acked-by: Ian Rogers <irogers@xxxxxxxxxx>

Thanks, applied to perf-tools-next, for v7.2.

- Arnaldo