[PATCH] perf build: Add rust target flag for loongarch cross compile

Li Fangxu posted 1 patch 1 month, 1 week ago
tools/perf/Makefile.config | 2 ++
1 file changed, 2 insertions(+)
[PATCH] perf build: Add rust target flag for loongarch cross compile
Posted by Li Fangxu 1 month, 1 week ago
From: lifangxu <lifangxu@kylinos.cn>

Based on commit 30f998c992c9 ("tools build: Fix rust cross
compilation"), add rust target flags for loongarch cross tool to fix
perf compilation error:
*** Unknown rust cross compilation architecture loongarch. Stop.

Signed-off-by: lifangxu <lifangxu@kylinos.cn>
---
 tools/perf/Makefile.config | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 0ba307e78fe1..42c0ef213750 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -1149,6 +1149,8 @@ ifndef NO_RUST
     RUST_TARGET_FLAGS_s390	:= s390x-unknown-linux-gnu
     RUST_TARGET_FLAGS_x86	:= x86_64-unknown-linux-gnu
     RUST_TARGET_FLAGS_x86_64	:= x86_64-unknown-linux-gnu
+    RUST_TARGET_FLAGS_loongarch := loongarch64-unknown-linux-gnu
+
 
     ifeq ($(RUST_TARGET_FLAGS_$(ARCH)),)
       $(error Unknown rust cross compilation architecture $(ARCH))
-- 
2.43.0
Re: [PATCH] perf build: Add rust target flag for loongarch cross compile
Posted by WANG Rui 1 month, 1 week ago
Hi,

On Fri, Aug 21, 2026 at 11:29 AM Li Fangxu <lifangxu22@gmail.com> wrote:
>
> From: lifangxu <lifangxu@kylinos.cn>
>
> Based on commit 30f998c992c9 ("tools build: Fix rust cross
> compilation"), add rust target flags for loongarch cross tool to fix
> perf compilation error:
> *** Unknown rust cross compilation architecture loongarch. Stop.
>
> Signed-off-by: lifangxu <lifangxu@kylinos.cn>
> ---
>  tools/perf/Makefile.config | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
> index 0ba307e78fe1..42c0ef213750 100644
> --- a/tools/perf/Makefile.config
> +++ b/tools/perf/Makefile.config
> @@ -1149,6 +1149,8 @@ ifndef NO_RUST
>      RUST_TARGET_FLAGS_s390     := s390x-unknown-linux-gnu
>      RUST_TARGET_FLAGS_x86      := x86_64-unknown-linux-gnu
>      RUST_TARGET_FLAGS_x86_64   := x86_64-unknown-linux-gnu
> +    RUST_TARGET_FLAGS_loongarch := loongarch64-unknown-linux-gnu

This duplicates the earlier patch, which was already Acked:

https://lore.kernel.org/loongarch/20260414080500.320095-1-r@hev.cc/

Best,
Rui

> +
>
>      ifeq ($(RUST_TARGET_FLAGS_$(ARCH)),)
>        $(error Unknown rust cross compilation architecture $(ARCH))
> --
> 2.43.0
>
>
Re: [PATCH] perf build: Add rust target flag for loongarch cross compile
Posted by Li Fangxu 1 month, 1 week ago
Thanks for pointing that out, Rui. 

Please disregard my submission.

Best,
Fangxu