Re: [PATCH v3 0/9] perf build: Support building with Clang

Arnaldo Carvalho de Melo
2025-10-06T19:50:13Z

On Mon, Oct 06, 2025 at 05:21:22PM +0100, Leo Yan wrote:
> This series adds support for building perf with Clang, following the
> discussion in [1]. Because the Android NDK uses Clang by default,
> enabling Clang builds naturally covers Android as well.
>
> The series is organized as follows:
>
> - Patches 1~2: Fix two bugs found with Clang.
> - Patches 3~7: Correct CROSS_ARCH, Disable thread safety analysis for
> perl header, and dismiss Clang build warnings.
> - Patches 8~9: Enable Clang in the Makefile and update the
> documentation.
>
> Testing:
>
> Tested with linux-tools-container-builds [2], which based on Arnaldo's
> build test container but with several fixes for cross building with
> Clang:
>
> - All clang native builds on x86_64 have passed.
> - The cross builds for arm64/mips/mips64/mipsel/riscv64 have passed.
>
> Only a pity thing is I cannot build successfully with clang for
> ubuntu:20.04-x-powerpc64el (in below log, it only builds with GCC).
> The cross config does not work well on Ubuntu 20.04 due to failure
> "No gnu/libc-version.h found, please install glibc-dev[el]". I confirmed
> that powerpc64el cross build can make success on Ubuntu 24.04, the
> failure on Ubuntu 20.04 should not be caused by perf build.

Thaanks, applied, testing it.

- Arnaldo