[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aR9qkB_XY-elMxSh@google.com>
Date: Thu, 20 Nov 2025 11:22:56 -0800
From: Namhyung Kim <namhyung@...nel.org>
To: hupu <hupu.gm@...il.com>
Cc: Leo Yan <leo.yan@....com>, acme@...nel.org, adrian.hunter@...el.com,
alexander.shishkin@...ux.intel.com, irogers@...gle.com,
jolsa@...nel.org, justinstitt@...gle.com,
linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org,
mark.rutland@....com, mingo@...hat.com, morbo@...gle.com,
nathan@...nel.org, nick.desaulniers+lkml@...il.com,
peterz@...radead.org
Subject: Re: [PATCH] perf build: Support passing extra Clang options via
EXTRA_BPF_FLAGS
Hello,
On Wed, Nov 19, 2025 at 05:43:41PM +0800, hupu wrote:
> RESEND
>
> On Tue, Nov 18, 2025 at 3:28 PM hupu <hupu.gm@...il.com> wrote:
> >
> > Hi Leo and Namhyung,
> >
> > On Tue, Nov 18, 2025 at 3:18 PM hupu <hupu.gm@...il.com> wrote:
> > >
> > > I then added KHDR_INCLUDES to BPF_INCLUDE, pointing it to the kernel’s
> > > self-contained header directory so that the build prefers headers
> > > provided by the kernel.
> > >
> > >
> > > diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
> > > index 47c906b807ef..65c6e871988b 100644
> > > --- a/tools/perf/Makefile.perf
> > > +++ b/tools/perf/Makefile.perf
> > > @@ -1202,7 +1202,8 @@ endif
> > >
> > > CLANG_OPTIONS = -Wall
> > > CLANG_SYS_INCLUDES = $(call get_sys_includes,$(CLANG),$(CLANG_TARGET_ARCH))
> > > -BPF_INCLUDE := -I$(SKEL_TMP_OUT)/.. -I$(LIBBPF_INCLUDE) $(CLANG_SYS_INCLUDES)
> > > +KHDR_INCLUDES := $(abspath $(OUTPUT)/../../usr/include)
> > > +BPF_INCLUDE := -I$(SKEL_TMP_OUT)/.. -I$(LIBBPF_INCLUDE)
> > > -I$(KHDR_INCLUDES) $(CLANG_SYS_INCLUDES)
I think your patch was wrapped around.
> > > TOOLS_UAPI_INCLUDE := -I$(srctree)/tools/include/uapi
> > >
> > > ifneq ($(WERROR),0)
> > >
> > >
> > > With this change verified, perf compiles successfully even without
> > > explicitly specifying the cross-toolchain sysroot in the compile
> > > command.
I'm not familiar with the usr directory in the kernel source. Will it
contain some generated headers?
> > >
> >
> > As an additional suggestion, I’d prefer to keep both the above patch
> > and the previously discussed PATCH v3, which would mean submitting two
> > PRs. From my perspective, allowing users to pass custom compilation
> > options via EXTRA_BPF_FLAGS is more flexible than only configuring
> > headers, so I’d like to hear your thoughts.
Yep, I'm ok with the extra flag variable.
Thanks,
Namhyung
Powered by blists - more mailing lists