lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251125163920.GG724103@e132581.arm.com>
Date: Tue, 25 Nov 2025 16:39:20 +0000
From: Leo Yan <leo.yan@....com>
To: hupu <hupu.gm@...il.com>
Cc: namhyung@...nel.org, 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: [RFC] perf build: Use self-contained headers from kernel source
 when compiling

On Mon, Nov 24, 2025 at 03:23:10PM +0800, hupu wrote:
> When building perf, switch to using the self-contained headers provided
> in the kernel source tree to avoid build failures caused by missing
> architecture-specific headers. For example, the build may fail with
> errors like:
> 
> /usr/include/linux/ioctl.h:5:10: fatal error: 'asm/ioctl.h' file not
> found
>     5 | #include <asm/ioctl.h>
>       |          ^~~~~~~~~~~~~
> 
> This issue may occur because system-installed headers are incomplete,
> incompatible with the kernel version being built, or the corresponding
> architecture-specific headers are not installed at all. Using the
> self-contained headers from the kernel source ensures a consistent and
> compatible build environment.
> 
> Signed-off-by: hupu <hupu.gm@...il.com>
> ---
>  tools/perf/Makefile.perf | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
> index 47c906b807ef..eaccaae87e3c 100644
> --- a/tools/perf/Makefile.perf
> +++ b/tools/perf/Makefile.perf
> @@ -1202,7 +1202,9 @@ 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)

This doesn't work if use the commands:

  make -j `nproc` Image O=$OUT
  make headers_install O=$OUT
  make O=$OUT -C tools/perf VF=1 CORESIGHT=1 DEBUG=1

Maybe it is good to search possible paths:

  $(abspath ../../usr/include)    => Build in local folder
  $(abspath $(OUTPUT)usr/include) => Build in a specified folder

> +BPF_INCLUDE := -I$(SKEL_TMP_OUT)/.. -I$(LIBBPF_INCLUDE) \
> +		-I$(KHDR_INCLUDES) $(CLANG_SYS_INCLUDES)

Why the issue only happens for eBPF skel build but not for perf binary
build?  As I said in another reply, I'd consolidate options for both
cases.

Thanks,
Leo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ