From: "Mukesh Kumar Chaurasiya (IBM)" <mkchauras@gmail.com>
To: maddy@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com,
chleroy@kernel.org, peterz@infradead.org, jpoimboe@kernel.org,
jbaron@akamai.com, aliceryhl@google.com, rostedt@goodmis.org,
ardb@kernel.org, ojeda@kernel.org, boqun@kernel.org,
gary@garyguo.net, bjorn3_gh@protonmail.com, lossin@kernel.org,
a.hindborg@kernel.org, tmgross@umich.edu, dakr@kernel.org,
nathan@kernel.org, nick.desaulniers+lkml@gmail.com,
morbo@google.com, justinstitt@google.com,
daniel.almeida@collabora.com, fujita.tomonori@gmail.com,
viresh.kumar@linaro.org, prafulrai522@gmail.com,
gregkh@linuxfoundation.org, arnd@arndb.de, tamird@kernel.org,
mark.rutland@arm.com, mkchauras@gmail.com, lyude@redhat.com,
lina+kernel@asahilina.net, linuxppc-dev@lists.ozlabs.org,
linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org,
llvm@lists.linux.dev
Cc: Link Mauve <linkmauve@linkmauve.fr>,
Venkat Rao Bagalkote <venkat88@linux.ibm.com>
Subject: [PATCH V15 7/7] powerpc: Enable Rust for ppc64le
Date: Sun, 26 Apr 2026 16:29:32 +0530 [thread overview]
Message-ID: <20260426105932.2270364-8-mkchauras@gmail.com> (raw)
In-Reply-To: <20260426105932.2270364-1-mkchauras@gmail.com>
Enabling rust support for ppc64le.
Tested on pseries Power11:
╰─❯ dmesg | grep rust
[ 0.225728] Initialise system trusted keyrings
[ 0.270961] rust_minimal: Rust minimal sample (init)
[ 0.270968] rust_minimal: Am I built-in? true
[ 0.270974] rust_minimal: test_parameter: 1
[ 0.270983] rust_misc_device: Initialising Rust Misc Device Sample
[ 0.271012] rust_print: Rust printing macros sample (init)
[ 0.271019] rust_print: Emergency message (level 0) without args
[ 0.271023] rust_print: Alert message (level 1) without args
[ 0.271026] rust_print: Critical message (level 2) without args
[ 0.271030] rust_print: Error message (level 3) without args
[ 0.271033] rust_print: Warning message (level 4) without args
[ 0.271037] rust_print: Notice message (level 5) without args
[ 0.271040] rust_print: Info message (level 6) without args
[ 0.271043] rust_print: A line that is continued without args
[ 0.271054] rust_print: Emergency message (level 0) with args
[ 0.271064] rust_print: Alert message (level 1) with args
[ 0.271072] rust_print: Critical message (level 2) with args
[ 0.271077] rust_print: Error message (level 3) with args
[ 0.271083] rust_print: Warning message (level 4) with args
[ 0.271091] rust_print: Notice message (level 5) with args
[ 0.271097] rust_print: Info message (level 6) with args
[ 0.271102] rust_print: A line that is continued with args
[ 0.271110] rust_print: 1
[ 0.271113] rust_print: "hello, world"
[ 0.271121] rust_print: [samples/rust/rust_print_main.rs:35:5] c = "hello, world"
[ 0.271129] rust_print: Arc<dyn Display> says 42
[ 0.271130] rust_print: Arc<dyn Display> says hello, world
[ 0.271136] rust_print: "hello, world"
[ 0.271198] usbcore: registered new interface driver rust_driver_usb
[ 0.271207] rust_faux_driver: Initialising Rust Faux Device Sample
[ 0.271227] faux_driver rust-faux-sample-device: Hello from faux device!
[ 0.271297] rust_configfs: Rust configfs sample (init)
Reviewed-by: Link Mauve <linkmauve@linkmauve.fr>
Tested-by: Link Mauve <linkmauve@linkmauve.fr>
Reviewed-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
Tested-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
Link: https://github.com/Rust-for-Linux/linux/issues/105
Link: https://github.com/linuxppc/issues/issues/451
Acked-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Mukesh Kumar Chaurasiya (IBM) <mkchauras@gmail.com>
---
arch/powerpc/Kconfig | 1 +
arch/powerpc/Makefile | 7 ++++++-
rust/Makefile | 6 ++++++
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 4ac897b650d4..2e3065bce9cd 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -286,6 +286,7 @@ config PPC
select HAVE_RELIABLE_STACKTRACE
select HAVE_RSEQ
select HAVE_RUST if PPC32
+ select HAVE_RUST if PPC64 && CPU_LITTLE_ENDIAN
select HAVE_SAMPLE_FTRACE_DIRECT if HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
select HAVE_SAMPLE_FTRACE_DIRECT_MULTI if HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
select HAVE_SETUP_PER_CPU_AREA if PPC64
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 589613eaa5dc..9385db478c59 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -61,7 +61,12 @@ else
KBUILD_LDFLAGS_MODULE += $(objtree)/arch/powerpc/lib/crtsavres.o
endif
-KBUILD_RUSTFLAGS += --target=powerpc-unknown-linux-gnu
+ifdef CONFIG_PPC64
+KBUILD_RUSTFLAGS += --target=powerpc64le-unknown-linux-gnu
+KBUILD_RUSTFLAGS += -Ctarget-feature=-mma,-vsx,-hard-float,-altivec
+else
+KBUILD_RUSTFLAGS += --target=powerpc-unknown-linux-gnu
+endif
ifdef CONFIG_CPU_LITTLE_ENDIAN
KBUILD_CPPFLAGS += -mlittle-endian
diff --git a/rust/Makefile b/rust/Makefile
index 54096ce8a675..068b6fc3e0aa 100644
--- a/rust/Makefile
+++ b/rust/Makefile
@@ -408,7 +408,13 @@ BINDGEN_TARGET_x86 := x86_64-linux-gnu
BINDGEN_TARGET_arm64 := aarch64-linux-gnu
BINDGEN_TARGET_arm := arm-linux-gnueabi
BINDGEN_TARGET_loongarch := loongarch64-linux-gnusf
+
+ifdef CONFIG_PPC64
+BINDGEN_TARGET_powerpc := powerpc64le-linux-gnu
+else
BINDGEN_TARGET_powerpc := powerpc-linux-gnu
+endif
+
BINDGEN_TARGET_um := $(BINDGEN_TARGET_$(SUBARCH))
BINDGEN_TARGET := $(BINDGEN_TARGET_$(SRCARCH))
--
2.53.0
next prev parent reply other threads:[~2026-04-26 11:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-26 10:59 [PATCH V15 0/7] Rust support for powerpc Mukesh Kumar Chaurasiya (IBM)
2026-04-26 10:59 ` [PATCH V15 1/7] rust: Fix "multiple candidates for rmeta dependency core" error Mukesh Kumar Chaurasiya (IBM)
2026-04-26 10:59 ` [PATCH V15 2/7] dma-resv: Fix undefined symbol when CONFIG_DMA_SHARED_BUFFER is disabled Mukesh Kumar Chaurasiya (IBM)
2026-04-27 13:39 ` Gary Guo
2026-04-26 10:59 ` [PATCH V15 3/7] powerpc/jump_label: adjust inline asm to be consistent Mukesh Kumar Chaurasiya (IBM)
2026-04-26 10:59 ` [PATCH V15 4/7] rust/powerpc: Set min rustc version for powerpc Mukesh Kumar Chaurasiya (IBM)
2026-04-26 10:59 ` [PATCH V15 5/7] rust: Make __udivdi3() and __umoddi3() panic Mukesh Kumar Chaurasiya (IBM)
2026-04-26 10:59 ` [PATCH V15 6/7] rust: Add PowerPC support Mukesh Kumar Chaurasiya (IBM)
2026-04-29 5:18 ` Mukesh Kumar Chaurasiya
2026-04-29 12:51 ` Miguel Ojeda
2026-04-26 10:59 ` Mukesh Kumar Chaurasiya (IBM) [this message]
2026-04-29 5:17 ` [PATCH V15 7/7] powerpc: Enable Rust for ppc64le Mukesh Kumar Chaurasiya
2026-04-29 12:52 ` Miguel Ojeda
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260426105932.2270364-8-mkchauras@gmail.com \
--to=mkchauras@gmail.com \
--cc=a.hindborg@kernel.org \
--cc=aliceryhl@google.com \
--cc=ardb@kernel.org \
--cc=arnd@arndb.de \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=chleroy@kernel.org \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=fujita.tomonori@gmail.com \
--cc=gary@garyguo.net \
--cc=gregkh@linuxfoundation.org \
--cc=jbaron@akamai.com \
--cc=jpoimboe@kernel.org \
--cc=justinstitt@google.com \
--cc=lina+kernel@asahilina.net \
--cc=linkmauve@linkmauve.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=llvm@lists.linux.dev \
--cc=lossin@kernel.org \
--cc=lyude@redhat.com \
--cc=maddy@linux.ibm.com \
--cc=mark.rutland@arm.com \
--cc=morbo@google.com \
--cc=mpe@ellerman.id.au \
--cc=nathan@kernel.org \
--cc=nick.desaulniers+lkml@gmail.com \
--cc=npiggin@gmail.com \
--cc=ojeda@kernel.org \
--cc=peterz@infradead.org \
--cc=prafulrai522@gmail.com \
--cc=rostedt@goodmis.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tamird@kernel.org \
--cc=tmgross@umich.edu \
--cc=venkat88@linux.ibm.com \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.