diff mbox series

[v2,2/2] python3-maturin: Fix build on riscv32

Message ID 20250406181028.2326927-2-raj.khem@gmail.com
State New
Headers show
Series [v4,1/2] cargo-c,rust: Fix build on risv32 | expand

Commit Message

Khem Raj April 6, 2025, 6:10 p.m. UTC
There is a libc patch needed to fix rustix 0.38.x build
It is already submitted to libc upstream but until its applied
it needs to be patched

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
v2: Right fix is in libc not rustix, update the patch accordingly

 ...l-codes-on-riscv32gc-unknown-linux-g.patch | 36 +++++++++++++++++++
 .../python/python3-maturin_1.8.3.bb           |  1 +
 2 files changed, 37 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python3-maturin/0001-Define-more-ioctl-codes-on-riscv32gc-unknown-linux-g.patch
diff mbox series

Patch

diff --git a/meta/recipes-devtools/python/python3-maturin/0001-Define-more-ioctl-codes-on-riscv32gc-unknown-linux-g.patch b/meta/recipes-devtools/python/python3-maturin/0001-Define-more-ioctl-codes-on-riscv32gc-unknown-linux-g.patch
new file mode 100644
index 00000000000..84e0b5d4f88
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-maturin/0001-Define-more-ioctl-codes-on-riscv32gc-unknown-linux-g.patch
@@ -0,0 +1,36 @@ 
+From 7da2aecff6de042424b0e54b631bfcdbccdcfc89 Mon Sep 17 00:00:00 2001
+From: Dan Gohman <dev@sunfishcode.online>
+Date: Sun, 6 Apr 2025 05:22:49 -0700
+Subject: [PATCH] Define more ioctl codes on riscv32gc-unknown-linux-gnu
+
+Define ioctl codes including `FICLONE` and `FS_IOC32_GETVERSION` on
+riscv32gc-unknown-linux-gnu.
+
+Upstream-Status: Submitted [https://github.com/rust-lang/libc/pull/4382]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/unix/linux_like/linux/arch/generic/mod.rs | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/unix/linux_like/linux/arch/generic/mod.rs b/src/unix/linux_like/linux/arch/generic/mod.rs
+index 10953fe..e9fd7fc 100644
+--- a/src/unix/linux_like/linux/arch/generic/mod.rs
++++ b/src/unix/linux_like/linux/arch/generic/mod.rs
+@@ -122,6 +122,7 @@ cfg_if! {
+         target_arch = "x86_64",
+         target_arch = "arm",
+         target_arch = "aarch64",
++        target_arch = "riscv32",
+         target_arch = "riscv64",
+         target_arch = "s390x",
+         target_arch = "csky",
+@@ -258,7 +259,8 @@ cfg_if! {
+     if #[cfg(any(
+         target_arch = "x86",
+         target_arch = "arm",
+-        target_arch = "csky"
++        target_arch = "csky",
++        target_arch = "riscv32"
+     ))] {
+         pub const FS_IOC_GETFLAGS: Ioctl = 0x80046601;
+         pub const FS_IOC_SETFLAGS: Ioctl = 0x40046602;
diff --git a/meta/recipes-devtools/python/python3-maturin_1.8.3.bb b/meta/recipes-devtools/python/python3-maturin_1.8.3.bb
index 17c8fb7083b..3ec4d0c103b 100644
--- a/meta/recipes-devtools/python/python3-maturin_1.8.3.bb
+++ b/meta/recipes-devtools/python/python3-maturin_1.8.3.bb
@@ -5,6 +5,7 @@  LICENSE = "MIT | Apache-2.0"
 LIC_FILES_CHKSUM = "file://license-apache;md5=1836efb2eb779966696f473ee8540542 \
                     file://license-mit;md5=85fd3b67069cff784d98ebfc7d5c0797"
 
+SRC_URI += "file://0001-Define-more-ioctl-codes-on-riscv32gc-unknown-linux-g.patch;patchdir=${CARGO_VENDORING_DIRECTORY}/libc-0.2.167"
 SRC_URI[sha256sum] = "304762f86fd53a8031b1bf006d12572a2aa0a5235485031113195cc0152e1e12"
 
 S = "${WORKDIR}/maturin-${PV}"