Re: [RFC] perf build: Allow passing extra Clang flags via EXTRA_CLANG_FLAGS

From: Leo Yan

Date: Wed Oct 15 2025 - 05:30:40 EST


Hi hupu,

On Tue, Oct 14, 2025 at 10:31:55AM +0800, hupu wrote:

[...]

> > I am not 100% sure, could you execute install kernel headers and then
> > build perf ?
> >
> > make headers_install
> >
>
> I am currently building perf for arm64 in an Ubuntu environment using
> a cross toolchain, rather than compiling the entire perf directly with
> Clang. Clang is only invoked during the build process when the BPF
> option is enabled — as shown below where bpf is detected as on:

Have you installed the GCC cross packages ?

$ sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
$ sudo apt-get install libc6-dev-aarch64-cross linux-libc-dev-aarch64-cross
$ sudo apt-get install libc6-dev-arm64-cross linux-libc-dev-arm64-cross

My understanding is arm64 cross compilation tries to find headers in the
path /usr/aarch64-linux-gnu/include/ (I confirmed this on Ubuntu/Debian
distros). After install GCC cross packages, the headers should appear
in the folder.

Thanks,
Leo