[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADHxFxROMe++VB17J3UgOxSoEhJ7bNagBHO6gRQQPpAELc1ocw@mail.gmail.com>
Date: Tue, 18 Nov 2025 15:28:47 +0800
From: hupu <hupu.gm@...il.com>
To: Leo Yan <leo.yan@....com>, Namhyung Kim <namhyung@...nel.org>
Cc: 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
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)
> 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.
>
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.
Thanks,
hupu
Powered by blists - more mailing lists