mirror of
git://git.openembedded.org/meta-openembedded
synced 2026-04-02 02:49:12 +00:00
thin-provisioning-tools: Fix build on riscv32
Rustix crate needs libc crate to be patched Fix build on 32-bit hosts without 64bit atomics Use portable-atomic crate for 64bit atomics, helps 32bit arches without 64bit atomic intrinsics. Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
parent
8bca12516c
commit
82056b9245
@ -78,7 +78,7 @@ SRC_URI += " \
|
||||
crate://crates.io/once_cell/1.19.0 \
|
||||
crate://crates.io/os_pipe/1.2.1 \
|
||||
crate://crates.io/pkg-config/0.3.30 \
|
||||
crate://crates.io/portable-atomic/1.7.0 \
|
||||
crate://crates.io/portable-atomic/1.11.0 \
|
||||
crate://crates.io/ppv-lite86/0.2.20 \
|
||||
crate://crates.io/predicates/3.1.2 \
|
||||
crate://crates.io/predicates-core/1.0.8 \
|
||||
@ -218,7 +218,7 @@ SRC_URI[numtoa-0.1.0.sha256sum] = "b8f8bdf33df195859076e54ab11ee78a1b208382d3a26
|
||||
SRC_URI[once_cell-1.19.0.sha256sum] = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
|
||||
SRC_URI[os_pipe-1.2.1.sha256sum] = "5ffd2b0a5634335b135d5728d84c5e0fd726954b87111f7506a61c502280d982"
|
||||
SRC_URI[pkg-config-0.3.30.sha256sum] = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec"
|
||||
SRC_URI[portable-atomic-1.7.0.sha256sum] = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265"
|
||||
SRC_URI[portable-atomic-1.11.0.sha256sum] = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e"
|
||||
SRC_URI[ppv-lite86-0.2.20.sha256sum] = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04"
|
||||
SRC_URI[predicates-3.1.2.sha256sum] = "7e9086cc7640c29a356d1a29fd134380bee9d8f79a17410aa76e7ad295f42c97"
|
||||
SRC_URI[predicates-core-1.0.8.sha256sum] = "ae8177bee8e75d6846599c6b9ff679ed51e882816914eec639944d7c9aa11931"
|
||||
|
||||
@ -0,0 +1,38 @@
|
||||
From 11c494b418570a3fbdfbbbdfbbc4db0108743cc7 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 | 6 +++++-
|
||||
1 file changed, 5 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 2f437e1..db1f1e7 100644
|
||||
--- a/src/unix/linux_like/linux/arch/generic/mod.rs
|
||||
+++ b/src/unix/linux_like/linux/arch/generic/mod.rs
|
||||
@@ -114,6 +114,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",
|
||||
@@ -218,7 +219,10 @@ cfg_if! {
|
||||
// where S stands for size (int, long, struct...)
|
||||
// where T stands for type ('f','v','X'...)
|
||||
// where N stands for NR (NumbeR)
|
||||
- if #[cfg(any(target_arch = "x86", target_arch = "arm", target_arch = "csky"))] {
|
||||
+ if #[cfg(any(target_arch = "x86",
|
||||
+ target_arch = "arm",
|
||||
+ target_arch = "riscv32",
|
||||
+ target_arch = "csky"))] {
|
||||
pub const FS_IOC_GETFLAGS: ::Ioctl = 0x80046601;
|
||||
pub const FS_IOC_SETFLAGS: ::Ioctl = 0x40046602;
|
||||
pub const FS_IOC_GETVERSION: ::Ioctl = 0x80047601;
|
||||
@ -0,0 +1,86 @@
|
||||
From aa7186a69f8fb46cdb736e03682deb77f993103b Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Sat, 5 Apr 2025 18:53:03 -0700
|
||||
Subject: [PATCH] Use portable atomics crate
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This extends building thing-provisioning-tools for
|
||||
32bit architectures without 64bit atomics support e.g.
|
||||
armv5, mips, ppc32 and riscv32. More info on portable-atomics [1]
|
||||
|
||||
Fixes
|
||||
|
||||
error[E0432]: unresolved import `std::sync::atomic::AtomicU64`
|
||||
│ 232 --> src/cache/writeback.rs:6:25
|
||||
│ 234 | use std::sync::atomic::{AtomicU64, Ordering};
|
||||
│ 235 | ^^^^^^^^^
|
||||
|
||||
[1] https://crates.io/crates/portable-atomic
|
||||
|
||||
Upstream-Status: Submitted [https://github.com/jthornber/thin-provisioning-tools/pull/321]
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
Cargo.lock | 5 +++--
|
||||
Cargo.toml | 1 +
|
||||
src/cache/writeback.rs | 2 +-
|
||||
src/thin/stat.rs | 2 +-
|
||||
4 files changed, 6 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/Cargo.lock
|
||||
+++ b/Cargo.lock
|
||||
@@ -649,9 +649,9 @@ checksum = "d231b230927b5e4ad203db57bbcb
|
||||
|
||||
[[package]]
|
||||
name = "portable-atomic"
|
||||
-version = "1.7.0"
|
||||
+version = "1.11.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
-checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265"
|
||||
+checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e"
|
||||
|
||||
[[package]]
|
||||
name = "ppv-lite86"
|
||||
@@ -1000,6 +1000,7 @@ dependencies = [
|
||||
"num-derive",
|
||||
"num-traits",
|
||||
"num_cpus",
|
||||
+ "portable-atomic",
|
||||
"quick-xml",
|
||||
"quickcheck",
|
||||
"quickcheck_macros",
|
||||
--- a/Cargo.toml
|
||||
+++ b/Cargo.toml
|
||||
@@ -30,6 +30,7 @@ nom = "7.1"
|
||||
num_cpus = "1.16"
|
||||
num-derive = "0.4"
|
||||
num-traits = "0.2"
|
||||
+portable-atomic = "1.11"
|
||||
quick-xml = "0.36"
|
||||
rand = "0.8"
|
||||
rangemap = "1.5"
|
||||
--- a/src/cache/writeback.rs
|
||||
+++ b/src/cache/writeback.rs
|
||||
@@ -1,9 +1,9 @@
|
||||
use anyhow::anyhow;
|
||||
+use portable_atomic::{AtomicU64, Ordering};
|
||||
use roaring::RoaringBitmap;
|
||||
use std::fs::File;
|
||||
use std::io::Cursor;
|
||||
use std::path::Path;
|
||||
-use std::sync::atomic::{AtomicU64, Ordering};
|
||||
use std::sync::mpsc::{self, SyncSender};
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::thread;
|
||||
--- a/src/thin/stat.rs
|
||||
+++ b/src/thin/stat.rs
|
||||
@@ -1,7 +1,7 @@
|
||||
use anyhow::{anyhow, Result};
|
||||
+use portable_atomic::{AtomicU64, Ordering};
|
||||
use std::collections::BTreeMap;
|
||||
use std::path::Path;
|
||||
-use std::sync::atomic::{AtomicU64, Ordering};
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::vec::Vec;
|
||||
|
||||
@ -9,6 +9,8 @@ S = "${WORKDIR}/git"
|
||||
|
||||
SRC_URI = " \
|
||||
git://github.com/jthornber/thin-provisioning-tools;branch=main;protocol=https \
|
||||
file://0001-Define-more-ioctl-codes-on-riscv32gc-unknown-linux-g.patch;patchdir=${CARGO_VENDORING_DIRECTORY}/libc-0.2.155 \
|
||||
file://0001-Use-portable-atomics-crate.patch \
|
||||
"
|
||||
|
||||
# v1.1.0
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user