Skip to contentSkip to conversation

perf build: Add clang and rust target flags for loongarch

PATCH In review WANG Rui 4 participants 4 messages Apr 14

Subsystems (3)
lore
Share & tools
lore

WANG Rui

author
#0 lore raw

PATCH 1/1 perf build: Add clang and rust target flags for loongarch

From: Haiyong Sun <[email protected]>

Add missing CLANG_TARGET_FLAGS_loongarch and RUST_TARGET_FLAGS_loongarch so that perf can be built with clang and enable rust cross compilation.

---
 tools/perf/Makefile.config | 2 ++
 1 file changed, 2 insertions(+)
tools/perf/Makefile.config +2 -0
index 15fbba9f4..1340744a6 100644
@@ -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
Signature · 1 line
2.53.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · WANG Rui

From: Haiyong Sun <[email protected]>

Add missing CLANG_TARGET_FLAGS_loongarch and RUST_TARGET_FLAGS_loongarch so that perf can be built with clang and enable rust cross compilation.

Quoted 28 lines
---
 tools/perf/Makefile.config | 2 ++
 1 file changed, 2 insertions(+)
tools/perf/Makefile.config +2 -1
index 15fbba9f4..1340744a6 100644
@@ -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

Acked-by on v1 1/1
#2 lore raw
In reply to WANG Rui
Quoted 8 lines · WANG Rui

From: Haiyong Sun <[email protected]>

Add missing CLANG_TARGET_FLAGS_loongarch and RUST_TARGET_FLAGS_loongarch so that perf can be built with clang and enable rust cross compilation.

FWIW, sounds good. I guess the commit that added the list should have had it to begin with? Cc Dmitrii.

Cheers,
Miguel

Acked-by
#3 lore raw
Quoted 4 lines · Miguel Ojeda

FWIW, sounds good. I guess the commit that added the list should have had it to begin with? Cc Dmitrii.

Yep, it should have -- as far as I can tell perf supports loongarch in all the other ways. Unfortunately I based my patch on CLANG_TARGET_FLAGS, which turned out to be missing this arch as well.