summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2025-04-05 13:57:25 -0700
committerKhem Raj <raj.khem@gmail.com>2025-04-06 10:57:39 -0700
commit8bca12516cb1c1904c371d583706861c215680b3 (patch)
treedc91208f653fd1112b59fb6653758cbe4b3031e1
parent830535e5b6699d769b07c838fc5fecf0b5afbf0e (diff)
downloadmeta-openembedded-8bca12516cb1c1904c371d583706861c215680b3.tar.gz
cbindgen: Fix build on riscv32
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/recipes-devtools/cbindgen/cbindgen/0001-Define-more-ioctl-codes-on-riscv32gc-unknown-linux-g.patch38
-rw-r--r--meta-oe/recipes-devtools/cbindgen/cbindgen_0.28.0.bb3
2 files changed, 40 insertions, 1 deletions
diff --git a/meta-oe/recipes-devtools/cbindgen/cbindgen/0001-Define-more-ioctl-codes-on-riscv32gc-unknown-linux-g.patch b/meta-oe/recipes-devtools/cbindgen/cbindgen/0001-Define-more-ioctl-codes-on-riscv32gc-unknown-linux-g.patch
new file mode 100644
index 0000000000..75086aba75
--- /dev/null
+++ b/meta-oe/recipes-devtools/cbindgen/cbindgen/0001-Define-more-ioctl-codes-on-riscv32gc-unknown-linux-g.patch
@@ -0,0 +1,38 @@
1From 6ab6af57cbd3b3b0cd4ba04f7f65693e1ca69870 Mon Sep 17 00:00:00 2001
2From: Dan Gohman <dev@sunfishcode.online>
3Date: Sun, 6 Apr 2025 05:22:49 -0700
4Subject: [PATCH] Define more ioctl codes on riscv32gc-unknown-linux-gnu
5
6Define ioctl codes including `FICLONE` and `FS_IOC32_GETVERSION` on
7riscv32gc-unknown-linux-gnu.
8
9Upstream-Status: Submitted [https://github.com/rust-lang/libc/pull/4382]
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 src/unix/linux_like/linux/arch/generic/mod.rs | 6 +++++-
13 1 file changed, 5 insertions(+), 1 deletion(-)
14
15diff --git a/src/unix/linux_like/linux/arch/generic/mod.rs b/src/unix/linux_like/linux/arch/generic/mod.rs
16index 2f437e1..db1f1e7 100644
17--- a/src/unix/linux_like/linux/arch/generic/mod.rs
18+++ b/src/unix/linux_like/linux/arch/generic/mod.rs
19@@ -114,6 +114,7 @@ cfg_if! {
20 target_arch = "x86_64",
21 target_arch = "arm",
22 target_arch = "aarch64",
23+ target_arch = "riscv32",
24 target_arch = "riscv64",
25 target_arch = "s390x",
26 target_arch = "csky",
27@@ -218,7 +219,10 @@ cfg_if! {
28 // where S stands for size (int, long, struct...)
29 // where T stands for type ('f','v','X'...)
30 // where N stands for NR (NumbeR)
31- if #[cfg(any(target_arch = "x86", target_arch = "arm", target_arch = "csky"))] {
32+ if #[cfg(any(target_arch = "x86",
33+ target_arch = "arm",
34+ target_arch = "riscv32",
35+ target_arch = "csky"))] {
36 pub const FS_IOC_GETFLAGS: ::Ioctl = 0x80046601;
37 pub const FS_IOC_SETFLAGS: ::Ioctl = 0x40046602;
38 pub const FS_IOC_GETVERSION: ::Ioctl = 0x80047601;
diff --git a/meta-oe/recipes-devtools/cbindgen/cbindgen_0.28.0.bb b/meta-oe/recipes-devtools/cbindgen/cbindgen_0.28.0.bb
index 40436ef035..eb8556ebc6 100644
--- a/meta-oe/recipes-devtools/cbindgen/cbindgen_0.28.0.bb
+++ b/meta-oe/recipes-devtools/cbindgen/cbindgen_0.28.0.bb
@@ -3,7 +3,8 @@ HOMEPAGE = "https://github.com/mozilla/cbindgen"
3LICENSE = "MPL-2.0" 3LICENSE = "MPL-2.0"
4LIC_FILES_CHKSUM = "file://LICENSE;md5=9741c346eef56131163e13b9db1241b3" 4LIC_FILES_CHKSUM = "file://LICENSE;md5=9741c346eef56131163e13b9db1241b3"
5 5
6SRC_URI += "git://github.com/mozilla/cbindgen.git;protocol=https;branch=master" 6SRC_URI += "git://github.com/mozilla/cbindgen.git;protocol=https;branch=master \
7 file://0001-Define-more-ioctl-codes-on-riscv32gc-unknown-linux-g.patch;patchdir=${CARGO_VENDORING_DIRECTORY}/libc-0.2.155"
7SRCREV = "bd78bbe59b10eda6ef1255e4acda95c56c6d0279" 8SRCREV = "bd78bbe59b10eda6ef1255e4acda95c56c6d0279"
8S = "${WORKDIR}/git" 9S = "${WORKDIR}/git"
9 10