Re: [PATCH] perf build: Add clang and rust target flags for loongarch

From: Huacai Chen

Date: Tue Apr 14 2026 - 04:17:12 EST


On Tue, Apr 14, 2026 at 4:05 PM WANG Rui <r@xxxxxx> wrote:
>
> From: Haiyong Sun <sunhaiyong@xxxxxxxxxxx>
>
> Add missing CLANG_TARGET_FLAGS_loongarch and RUST_TARGET_FLAGS_loongarch
> so that perf can be built with clang and enable rust cross compilation.
>
> Signed-off-by: Haiyong Sun <sunhaiyong@xxxxxxxxxxx>
> Signed-off-by: WANG Rui <r@xxxxxx>
Acked-by: Huacai Chen <chenhuacai@xxxxxxxxxxx>

> ---
> tools/perf/Makefile.config | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
> index 15fbba9f4..1340744a6 100644
> --- a/tools/perf/Makefile.config
> +++ b/tools/perf/Makefile.config
> @@ -27,6 +27,7 @@ CFLAGS += -fno-strict-aliasing
> ifeq ($(CC_NO_CLANG), 0)
> CLANG_TARGET_FLAGS_arm := arm-linux-gnueabi
> CLANG_TARGET_FLAGS_arm64 := aarch64-linux-gnu
> + CLANG_TARGET_FLAGS_loongarch := loongarch64-linux-gnu
> CLANG_TARGET_FLAGS_m68k := m68k-linux-gnu
> CLANG_TARGET_FLAGS_mips := mipsel-linux-gnu
> CLANG_TARGET_FLAGS_powerpc := powerpc64le-linux-gnu
> @@ -1167,6 +1168,7 @@ ifndef NO_RUST
> ifneq ($(CROSS_COMPILE),)
> RUST_TARGET_FLAGS_arm := arm-unknown-linux-gnueabi
> RUST_TARGET_FLAGS_arm64 := aarch64-unknown-linux-gnu
> + RUST_TARGET_FLAGS_loongarch := loongarch64-unknown-linux-gnu
> RUST_TARGET_FLAGS_m68k := m68k-unknown-linux-gnu
> RUST_TARGET_FLAGS_mips := mipsel-unknown-linux-gnu
> RUST_TARGET_FLAGS_powerpc := powerpc64le-unknown-linux-gnu
> --
> 2.53.0
>
>