diff options
Diffstat (limited to 'meta-python/recipes-devtools/python/python3-pydantic-core')
-rw-r--r-- | meta-python/recipes-devtools/python/python3-pydantic-core/0001-musl-enable-getrandom-on-all-musl-platforms.patch | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-pydantic-core/0001-musl-enable-getrandom-on-all-musl-platforms.patch b/meta-python/recipes-devtools/python/python3-pydantic-core/0001-musl-enable-getrandom-on-all-musl-platforms.patch new file mode 100644 index 0000000000..fd94526686 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-pydantic-core/0001-musl-enable-getrandom-on-all-musl-platforms.patch | |||
@@ -0,0 +1,81 @@ | |||
1 | From 4253e25b7f31d207c69b9997f403b6e4e560e258 Mon Sep 17 00:00:00 2001 | ||
2 | From: Tamir Duberstein <tamird@gmail.com> | ||
3 | Date: Thu, 20 Mar 2025 11:45:08 -0400 | ||
4 | Subject: [PATCH] musl: enable `getrandom` on all musl platforms | ||
5 | |||
6 | The existing bindings were added in #1399 and limited to targets where | ||
7 | rustc used musl version >= 1.1.20 which was not all musl targets at that | ||
8 | time. Since https://github.com/rust-lang/rust/pull/107129 all musl | ||
9 | targets use musl 1.2.3. Hence, move the binding to the module root so it | ||
10 | is available for all musl targets. | ||
11 | |||
12 | Upstream-Status: Backport [https://github.com/rust-lang/libc/pull/4346] | ||
13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
14 | --- | ||
15 | src/unix/linux_like/linux/musl/b32/arm/mod.rs | 4 ---- | ||
16 | src/unix/linux_like/linux/musl/b32/powerpc.rs | 4 ---- | ||
17 | src/unix/linux_like/linux/musl/b32/x86/mod.rs | 4 ---- | ||
18 | src/unix/linux_like/linux/musl/b64/mod.rs | 4 ---- | ||
19 | src/unix/linux_like/linux/musl/mod.rs | 2 ++ | ||
20 | 5 files changed, 2 insertions(+), 16 deletions(-) | ||
21 | |||
22 | --- a/src/unix/linux_like/linux/musl/b32/arm/mod.rs | ||
23 | +++ b/src/unix/linux_like/linux/musl/b32/arm/mod.rs | ||
24 | @@ -841,10 +841,6 @@ pub const SYS_process_mrelease: ::c_long | ||
25 | pub const SYS_futex_waitv: ::c_long = 449; | ||
26 | pub const SYS_set_mempolicy_home_node: ::c_long = 450; | ||
27 | |||
28 | -extern "C" { | ||
29 | - pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t; | ||
30 | -} | ||
31 | - | ||
32 | cfg_if! { | ||
33 | if #[cfg(libc_align)] { | ||
34 | mod align; | ||
35 | --- a/src/unix/linux_like/linux/musl/b32/powerpc.rs | ||
36 | +++ b/src/unix/linux_like/linux/musl/b32/powerpc.rs | ||
37 | @@ -796,7 +796,3 @@ pub const SYS_memfd_secret: ::c_long = 4 | ||
38 | pub const SYS_process_mrelease: ::c_long = 448; | ||
39 | pub const SYS_futex_waitv: ::c_long = 449; | ||
40 | pub const SYS_set_mempolicy_home_node: ::c_long = 450; | ||
41 | - | ||
42 | -extern "C" { | ||
43 | - pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t; | ||
44 | -} | ||
45 | --- a/src/unix/linux_like/linux/musl/b32/x86/mod.rs | ||
46 | +++ b/src/unix/linux_like/linux/musl/b32/x86/mod.rs | ||
47 | @@ -956,10 +956,6 @@ pub const EFL: ::c_int = 14; | ||
48 | pub const UESP: ::c_int = 15; | ||
49 | pub const SS: ::c_int = 16; | ||
50 | |||
51 | -extern "C" { | ||
52 | - pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t; | ||
53 | -} | ||
54 | - | ||
55 | cfg_if! { | ||
56 | if #[cfg(libc_align)] { | ||
57 | mod align; | ||
58 | --- a/src/unix/linux_like/linux/musl/b64/mod.rs | ||
59 | +++ b/src/unix/linux_like/linux/musl/b64/mod.rs | ||
60 | @@ -134,10 +134,6 @@ pub const __SIZEOF_PTHREAD_RWLOCK_T: usi | ||
61 | pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; | ||
62 | pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32; | ||
63 | |||
64 | -extern "C" { | ||
65 | - pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t; | ||
66 | -} | ||
67 | - | ||
68 | cfg_if! { | ||
69 | if #[cfg(target_arch = "aarch64")] { | ||
70 | mod aarch64; | ||
71 | --- a/src/unix/linux_like/linux/musl/mod.rs | ||
72 | +++ b/src/unix/linux_like/linux/musl/mod.rs | ||
73 | @@ -885,6 +885,8 @@ extern "C" { | ||
74 | |||
75 | pub fn dirname(path: *mut ::c_char) -> *mut ::c_char; | ||
76 | pub fn basename(path: *mut ::c_char) -> *mut ::c_char; | ||
77 | + // Addded in `musl` 1.1.20 | ||
78 | + pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t; | ||
79 | } | ||
80 | |||
81 | // Alias <foo> to <foo>64 to mimic glibc's LFS64 support | ||