summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python3-maturin/0004-Fix-cross-compilation-issue-with-linux-ppc-architect.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/python/python3-maturin/0004-Fix-cross-compilation-issue-with-linux-ppc-architect.patch')
-rw-r--r--meta/recipes-devtools/python/python3-maturin/0004-Fix-cross-compilation-issue-with-linux-ppc-architect.patch68
1 files changed, 68 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3-maturin/0004-Fix-cross-compilation-issue-with-linux-ppc-architect.patch b/meta/recipes-devtools/python/python3-maturin/0004-Fix-cross-compilation-issue-with-linux-ppc-architect.patch
new file mode 100644
index 0000000000..bda5dca8f6
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-maturin/0004-Fix-cross-compilation-issue-with-linux-ppc-architect.patch
@@ -0,0 +1,68 @@
1From f2c892109a05db144e8b18bcbcf9c24fe8d977c4 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Vesa=20J=C3=A4=C3=A4skel=C3=A4inen?=
3 <vesa.jaaskelainen@vaisala.com>
4Date: Sun, 1 Sep 2024 15:55:16 +0300
5Subject: [PATCH 4/5] Fix cross compilation issue with linux-ppc architecture
6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit
9
10When compiling under Yocto project for linux-ppc target architecture
11.so files were generated incorrectly as:
12
13 rpds.cpython-312-ppc-linux-gnu.so
14
15Where as platform and EXT_SUFFIX are defined as:
16
17 >>> sysconfig.get_platform()
18 'linux-ppc'
19 >>> sysconfig.get_config_vars()['EXT_SUFFIX']
20 '.cpython-312-powerpc-linux-gnu.so'
21
22Which should have caused the .so files as:
23
24 rpds.cpython-312-powerpc-linux-gnu.so
25
26Upstream-Status: Backport [https://github.com/PyO3/maturin/commit/f2c892109a05db144e8b18bcbcf9c24fe8d977c4]
27
28Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
29---
30 src/python_interpreter/config.rs | 8 ++++++++
31 src/target.rs | 2 ++
32 2 files changed, 10 insertions(+)
33
34diff --git a/src/python_interpreter/config.rs b/src/python_interpreter/config.rs
35index 938e9955..8f883887 100644
36--- a/src/python_interpreter/config.rs
37+++ b/src/python_interpreter/config.rs
38@@ -424,6 +424,14 @@ mod test {
39 ".cpython-310-powerpc64le-linux-gnu.so"
40 );
41
42+ let sysconfig = InterpreterConfig::lookup_one(
43+ &Target::from_target_triple(Some("powerpc-unknown-linux-gnu".to_string())).unwrap(),
44+ InterpreterKind::CPython,
45+ (3, 10),
46+ )
47+ .unwrap();
48+ assert_eq!(sysconfig.ext_suffix, ".cpython-310-powerpc-linux-gnu.so");
49+
50 let sysconfig = InterpreterConfig::lookup_one(
51 &Target::from_target_triple(Some("s390x-unknown-linux-gnu".to_string())).unwrap(),
52 InterpreterKind::CPython,
53diff --git a/src/target.rs b/src/target.rs
54index ad8ebaba..93afd9bb 100644
55--- a/src/target.rs
56+++ b/src/target.rs
57@@ -380,6 +380,8 @@ impl Target {
58 "ppc_64"
59 } else if matches!(self.target_arch(), Arch::X86) && python_impl == InterpreterKind::PyPy {
60 "x86"
61+ } else if matches!(self.target_arch(), Arch::Powerpc) {
62+ "powerpc"
63 } else {
64 self.get_python_arch()
65 }
66--
672.34.1
68