diff options
author | Khem Raj <raj.khem@gmail.com> | 2022-03-05 22:48:31 -0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2022-03-09 07:37:03 -0800 |
commit | 1cf791b208c315e83109fb8eff34935294b5bc9c (patch) | |
tree | 8da71f710c93f093f701728af3fe1a08e6a49452 | |
parent | bc8241129c8b9b32e6e81dbf444c80c86a74e53b (diff) | |
download | meta-openembedded-contrib-1cf791b208c315e83109fb8eff34935294b5bc9c.tar.gz |
python3-pyruvate: Fix build on riscv32
refresh upstream status as needed.
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
5 files changed, 175 insertions, 9 deletions
diff --git a/meta-python/recipes-devtools/python/python3-pyruvate/0001-linux.rs-Define-consts-for-rv32-architecture.patch b/meta-python/recipes-devtools/python/python3-pyruvate/0001-linux.rs-Define-consts-for-rv32-architecture.patch new file mode 100644 index 0000000000..a2d4091a95 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-pyruvate/0001-linux.rs-Define-consts-for-rv32-architecture.patch @@ -0,0 +1,26 @@ +From 3a3bd8475f93d54cb5bb62d239247fef2e03a733 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 5 Mar 2022 00:37:01 -0800 +Subject: [PATCH] linux.rs: Define consts for rv32 architecture + +Upstream-Status: Submitted [https://github.com/nix-rust/nix/pull/1669] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/sys/ioctl/linux.rs | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/sys/ioctl/linux.rs b/src/sys/ioctl/linux.rs +index 68ebaba..08cd0c3 100644 +--- a/src/sys/ioctl/linux.rs ++++ b/src/sys/ioctl/linux.rs +@@ -34,6 +34,7 @@ mod consts { + target_arch = "s390x", + target_arch = "x86_64", + target_arch = "aarch64", ++ target_arch = "riscv32", + target_arch = "riscv64"))] + mod consts { + #[doc(hidden)] +-- +2.35.1 + diff --git a/meta-python/recipes-devtools/python/python3-pyruvate/0001-riscv32-Define-O_LARGEFILE.patch b/meta-python/recipes-devtools/python/python3-pyruvate/0001-riscv32-Define-O_LARGEFILE.patch new file mode 100644 index 0000000000..0ecb50478e --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-pyruvate/0001-riscv32-Define-O_LARGEFILE.patch @@ -0,0 +1,29 @@ +From 8c1251b57827c7e757079d6e9304570643e8e80a Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 5 Mar 2022 22:18:49 -0800 +Subject: [PATCH] riscv32: Define O_LARGEFILE + +Some applications (e.g. nix) use this define and expect it to come from libc + +Upstream-Status: Submitted [https://github.com/rust-lang/libc/pull/2710] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs b/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs +index 4d551eb..feaa00a 100644 +--- a/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs ++++ b/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs +@@ -490,6 +490,8 @@ pub const FIONREAD: ::c_ulong = 21531; + pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; + pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; + ++pub const O_LARGEFILE: ::c_int = 0; ++ + pub const SYS_read: ::c_long = 63; + pub const SYS_write: ::c_long = 64; + pub const SYS_close: ::c_long = 57; +-- +2.35.1 + diff --git a/meta-python/recipes-devtools/python/python3-pyruvate/0001-riscv64-mod.rs-Add-missing-error-codes.patch b/meta-python/recipes-devtools/python/python3-pyruvate/0001-riscv64-mod.rs-Add-missing-error-codes.patch index 67108472ac..6143342178 100644 --- a/meta-python/recipes-devtools/python/python3-pyruvate/0001-riscv64-mod.rs-Add-missing-error-codes.patch +++ b/meta-python/recipes-devtools/python/python3-pyruvate/0001-riscv64-mod.rs-Add-missing-error-codes.patch @@ -1,21 +1,21 @@ -From c711fb215de54f960a35cdc48cd506b6b5db4918 Mon Sep 17 00:00:00 2001 +From a6f5bb3e7fe51733144497a3b5962b300f922a2d Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> -Date: Wed, 26 Jan 2022 11:50:58 -0800 +Date: Mon, 7 Mar 2022 11:02:46 -0800 Subject: [PATCH] riscv64/mod.rs: Add missing error codes These are flagged by apps e.g. python3-pyruvate -Upstream-Status: Submitted [https://github.com/rust-lang/libc/pull/2656] +Upstream-Status: Backport [https://github.com/rust-lang/libc/commit/c711fb215de54f960a35cdc48cd506b6b5db4918] Signed-off-by: Khem Raj <raj.khem@gmail.com> --- src/unix/linux_like/linux/musl/b64/riscv64/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs b/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs -index b075b4a05..6b17621c7 100644 +index 48fee4e..7c88abe 100644 --- a/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs +++ b/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs -@@ -548,6 +548,11 @@ pub const EHOSTUNREACH: ::c_int = 113; +@@ -551,6 +551,11 @@ pub const EHOSTUNREACH: ::c_int = 113; pub const EALREADY: ::c_int = 114; pub const EINPROGRESS: ::c_int = 115; pub const ESTALE: ::c_int = 116; @@ -28,5 +28,5 @@ index b075b4a05..6b17621c7 100644 pub const ENOMEDIUM: ::c_int = 123; pub const EMEDIUMTYPE: ::c_int = 124; -- -2.35.0 +2.35.1 diff --git a/meta-python/recipes-devtools/python/python3-pyruvate/0001-statfs-Exclude-riscv32.patch b/meta-python/recipes-devtools/python/python3-pyruvate/0001-statfs-Exclude-riscv32.patch new file mode 100644 index 0000000000..b482d7c0db --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-pyruvate/0001-statfs-Exclude-riscv32.patch @@ -0,0 +1,108 @@ +From ccdc974dc10c83e29d551492fb2d17a2ff8c2b84 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 5 Mar 2022 22:30:15 -0800 +Subject: [PATCH] statfs: Exclude riscv32 + +Upstream-Status: Submitted [https://github.com/nix-rust/nix/pull/1669] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/sys/statfs.rs | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +diff --git a/src/sys/statfs.rs b/src/sys/statfs.rs +index 829be57..6b88dad 100644 +--- a/src/sys/statfs.rs ++++ b/src/sys/statfs.rs +@@ -292,7 +292,7 @@ impl Statfs { + } + + /// Total data blocks in filesystem +- #[cfg(all(target_os = "linux", any(target_env = "musl", all(target_arch = "x86_64", target_pointer_width = "32"))))] ++ #[cfg(all(target_os = "linux", any(target_env = "musl", target_arch = "riscv32", all(target_arch = "x86_64", target_pointer_width = "32"))))] + pub fn blocks(&self) -> u64 { + self.0.f_blocks + } +@@ -305,7 +305,7 @@ impl Statfs { + target_os = "freebsd", + target_os = "openbsd", + target_os = "dragonfly", +- all(target_os = "linux", any(target_env = "musl", all(target_arch = "x86_64", target_pointer_width = "32"))) ++ all(target_os = "linux", any(target_env = "musl", target_arch = "riscv32", all(target_arch = "x86_64", target_pointer_width = "32"))) + )))] + pub fn blocks(&self) -> libc::c_ulong { + self.0.f_blocks +@@ -330,7 +330,7 @@ impl Statfs { + } + + /// Free blocks in filesystem +- #[cfg(all(target_os = "linux", any(target_env = "musl", all(target_arch = "x86_64", target_pointer_width = "32"))))] ++ #[cfg(all(target_os = "linux", any(target_env = "musl", target_arch = "riscv32", all(target_arch = "x86_64", target_pointer_width = "32"))))] + pub fn blocks_free(&self) -> u64 { + self.0.f_bfree + } +@@ -343,7 +343,7 @@ impl Statfs { + target_os = "freebsd", + target_os = "openbsd", + target_os = "dragonfly", +- all(target_os = "linux", any(target_env = "musl", all(target_arch = "x86_64", target_pointer_width = "32"))) ++ all(target_os = "linux", any(target_env = "musl", target_arch = "riscv32", all(target_arch = "x86_64", target_pointer_width = "32"))) + )))] + pub fn blocks_free(&self) -> libc::c_ulong { + self.0.f_bfree +@@ -368,7 +368,7 @@ impl Statfs { + } + + /// Free blocks available to unprivileged user +- #[cfg(all(target_os = "linux", any(target_env = "musl", all(target_arch = "x86_64", target_pointer_width = "32"))))] ++ #[cfg(all(target_os = "linux", any(target_env = "musl", target_arch = "riscv32", all(target_arch = "x86_64", target_pointer_width = "32"))))] + pub fn blocks_available(&self) -> u64 { + self.0.f_bavail + } +@@ -381,7 +381,7 @@ impl Statfs { + target_os = "freebsd", + target_os = "openbsd", + target_os = "dragonfly", +- all(target_os = "linux", any(target_env = "musl", all(target_arch = "x86_64", target_pointer_width = "32"))) ++ all(target_os = "linux", any(target_env = "musl", target_arch = "riscv32", all(target_arch = "x86_64", target_pointer_width = "32"))) + )))] + pub fn blocks_available(&self) -> libc::c_ulong { + self.0.f_bavail +@@ -406,7 +406,7 @@ impl Statfs { + } + + /// Total file nodes in filesystem +- #[cfg(all(target_os = "linux", any(target_env = "musl", all(target_arch = "x86_64", target_pointer_width = "32"))))] ++ #[cfg(all(target_os = "linux", any(target_env = "musl", target_arch = "riscv32", all(target_arch = "x86_64", target_pointer_width = "32"))))] + pub fn files(&self) -> libc::fsfilcnt_t { + self.0.f_files + } +@@ -419,7 +419,7 @@ impl Statfs { + target_os = "freebsd", + target_os = "openbsd", + target_os = "dragonfly", +- all(target_os = "linux", any(target_env = "musl", all(target_arch = "x86_64", target_pointer_width = "32"))) ++ all(target_os = "linux", any(target_env = "musl", target_arch = "riscv32", all(target_arch = "x86_64", target_pointer_width = "32"))) + )))] + pub fn files(&self) -> libc::c_ulong { + self.0.f_files +@@ -449,7 +449,7 @@ impl Statfs { + } + + /// Free file nodes in filesystem +- #[cfg(all(target_os = "linux", any(target_env = "musl", all(target_arch = "x86_64", target_pointer_width = "32"))))] ++ #[cfg(all(target_os = "linux", any(target_env = "musl", target_arch = "riscv32", all(target_arch = "x86_64", target_pointer_width = "32"))))] + pub fn files_free(&self) -> libc::fsfilcnt_t { + self.0.f_ffree + } +@@ -462,7 +462,7 @@ impl Statfs { + target_os = "freebsd", + target_os = "openbsd", + target_os = "dragonfly", +- all(target_os = "linux", any(target_env = "musl", all(target_arch = "x86_64", target_pointer_width = "32"))) ++ all(target_os = "linux", any(target_env = "musl", target_arch = "riscv32", all(target_arch = "x86_64", target_pointer_width = "32"))) + )))] + pub fn files_free(&self) -> libc::c_ulong { + self.0.f_ffree +-- +2.35.1 + diff --git a/meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb b/meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb index 4429e4c32a..143125bbb1 100644 --- a/meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb +++ b/meta-python/recipes-devtools/python/python3-pyruvate_1.1.2.bb @@ -24,9 +24,6 @@ RUSTFLAGS:append:mipsel = " --cfg crossbeam_no_atomic_64" RUSTFLAGS:append:powerpc = " --cfg crossbeam_no_atomic_64" RUSTFLAGS:append:riscv32 = " --cfg crossbeam_no_atomic_64" -SRC_URI:append:mips = " file://0001-check-for-mips-targets-for-stat.st_dev-definitions.patch;patchdir=../cargo_home/bitbake/libsystemd-0.4.1/" -SRC_URI:append = " file://0001-riscv64-mod.rs-Add-missing-error-codes.patch;patchdir=../cargo_home/bitbake/libc-0.2.112/" - SRC_URI += " \ crate://crates.io/aho-corasick/0.7.18 \ crate://crates.io/atty/0.2.14 \ @@ -118,6 +115,12 @@ SRC_URI += " \ crate://crates.io/winapi-x86_64-pc-windows-gnu/0.4.0 \ crate://crates.io/winapi/0.3.9 \ " +SRC_URI += "file://0001-riscv64-mod.rs-Add-missing-error-codes.patch;patchdir=../cargo_home/bitbake/libc-0.2.112/ \ + file://0001-riscv32-Define-O_LARGEFILE.patch;patchdir=../cargo_home/bitbake/libc-0.2.112/ \ + file://0001-linux.rs-Define-consts-for-rv32-architecture.patch;patchdir=../cargo_home/bitbake/nix-0.23.1/ \ + file://0001-statfs-Exclude-riscv32.patch;patchdir=../cargo_home/bitbake/nix-0.23.1/ \ + " +SRC_URI:append:mips = " file://0001-check-for-mips-targets-for-stat.st_dev-definitions.patch;patchdir=../cargo_home/bitbake/libsystemd-0.4.1/" # The following configs & dependencies are from setuptools extras_require. # These dependencies are optional, hence can be controlled via PACKAGECONFIG. |