Re: [PATCH] perf build: Support passing extra Clang options via EXTRA_BPF_FLAGS
From: hupu
Date: Tue Nov 25 2025 - 07:52:45 EST
Hi Namhyung,
Thank you very much for your valuable suggestion.
On Tue, Nov 25, 2025 at 4:13 PM Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
> >
> > +CLANG_OPTIONS += $(EXTRA_BPF_FLAGS)
>
> While it seems CLANG_OPTIONS is used only for BPF skeletons, I think
> it's better to add it directly to the below lines instead of adding it
> to CLANG_OPTIONS like following.
>
> > +
> > $(SKEL_TMP_OUT)/%.bpf.o: $(OUTPUT)PERF-VERSION-FILE util/bpf_skel/perf_version.h | $(SKEL_TMP_OUT)
> > $(SKEL_TMP_OUT)/%.bpf.o: util/bpf_skel/%.bpf.c $(LIBBPF) $(SKEL_OUT)/vmlinux.h
> > $(QUIET_CLANG)$(CLANG) -g -O2 -fno-stack-protector --target=bpf \
>
> $(CLANG_OPTIONS) $(EXTRA_BPF_FLAGS) $(BPF_INCLUDE) $(TOOLS_UAPI_INCLUDE) \
>
I agree that this approach makes the logic clearer, and I will update
the v4 patch to follow your recommendation.
Thanks again for your review and guidance.
Thanks,
hupu