* [PATCH] perf build: Add rust target flag for loongarch cross compile
@ 2026-08-21 3:27 Li Fangxu
2026-08-21 3:35 ` sashiko-bot
2026-08-21 6:56 ` WANG Rui
0 siblings, 2 replies; 4+ messages in thread
From: Li Fangxu @ 2026-08-21 3:27 UTC (permalink / raw)
To: acme, namhyung, chenhuacai
Cc: peterz, mingo, git, linux-perf-users, loongarch, linux-kernel,
lifangxu
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] perf build: Add rust target flag for loongarch cross compile
2026-08-21 3:27 [PATCH] perf build: Add rust target flag for loongarch cross compile Li Fangxu
@ 2026-08-21 3:35 ` sashiko-bot
2026-08-21 6:56 ` WANG Rui
1 sibling, 0 replies; 4+ messages in thread
From: sashiko-bot @ 2026-08-21 3:35 UTC (permalink / raw)
To: Li Fangxu; +Cc: linux-perf-users
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Missing RUST_TARGET_FLAGS alias for loongarch64.
--
--- Patch [1]: [PATCH] perf build: Add rust target flag for loongarch cross compile ---
commit b2d0a9ab160e1b008ff911474976ee4d8ac95e11
Author: lifangxu <lifangxu@kylinos.cn>
perf build: Add rust target flag for loongarch cross compile
This commit adds the loongarch rust target flag to fix perf cross
compilation errors for the architecture.
> diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
> index 0ba307e78fe1f..42c0ef2137502 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
> +
[Severity: Low]
Should there also be an alias for loongarch64 defined here?
Since tools/scripts/Makefile.arch accepts ARCH=loongarch64 but this
makefile config evaluates $(ARCH) directly, a build invoked with
ARCH=loongarch64 will evaluate RUST_TARGET_FLAGS_$(ARCH) as
RUST_TARGET_FLAGS_loongarch64.
Will this cause the build to fail with the unknown architecture error
because that specific alias is missing?
>
> ifeq ($(RUST_TARGET_FLAGS_$(ARCH)),)
> $(error Unknown rust cross compilation architecture $(ARCH))
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260821032702.4258-1-lifangxu22@gmail.com?part=1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] perf build: Add rust target flag for loongarch cross compile
2026-08-21 3:27 [PATCH] perf build: Add rust target flag for loongarch cross compile Li Fangxu
2026-08-21 3:35 ` sashiko-bot
@ 2026-08-21 6:56 ` WANG Rui
2026-08-21 10:38 ` Li Fangxu
1 sibling, 1 reply; 4+ messages in thread
From: WANG Rui @ 2026-08-21 6:56 UTC (permalink / raw)
To: Li Fangxu
Cc: acme, namhyung, chenhuacai, peterz, mingo, git, linux-perf-users,
loongarch, linux-kernel, lifangxu
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
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] perf build: Add rust target flag for loongarch cross compile
2026-08-21 6:56 ` WANG Rui
@ 2026-08-21 10:38 ` Li Fangxu
0 siblings, 0 replies; 4+ messages in thread
From: Li Fangxu @ 2026-08-21 10:38 UTC (permalink / raw)
To: r
Cc: acme, chenhuacai, git, lifangxu22, linux-kernel, linux-perf-users,
loongarch, mingo, namhyung, peterz
Thanks for pointing that out, Rui.
Please disregard my submission.
Best,
Fangxu
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-08-21 10:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-21 3:27 [PATCH] perf build: Add rust target flag for loongarch cross compile Li Fangxu
2026-08-21 3:35 ` sashiko-bot
2026-08-21 6:56 ` WANG Rui
2026-08-21 10:38 ` Li Fangxu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox