diff options
Diffstat (limited to 'meta/recipes-devtools/python/python3-maturin/0005-Fix-cross-compilation-issue-with-linux-mips64-archit.patch')
| -rw-r--r-- | meta/recipes-devtools/python/python3-maturin/0005-Fix-cross-compilation-issue-with-linux-mips64-archit.patch | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3-maturin/0005-Fix-cross-compilation-issue-with-linux-mips64-archit.patch b/meta/recipes-devtools/python/python3-maturin/0005-Fix-cross-compilation-issue-with-linux-mips64-archit.patch new file mode 100644 index 0000000000..b24196d5dd --- /dev/null +++ b/meta/recipes-devtools/python/python3-maturin/0005-Fix-cross-compilation-issue-with-linux-mips64-archit.patch | |||
| @@ -0,0 +1,82 @@ | |||
| 1 | From 5fe643579bcc63d824f6a0f0936fff451c622903 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: =?UTF-8?q?Vesa=20J=C3=A4=C3=A4skel=C3=A4inen?= | ||
| 3 | <vesa.jaaskelainen@vaisala.com> | ||
| 4 | Date: Sun, 1 Sep 2024 15:55:54 +0300 | ||
| 5 | Subject: [PATCH 5/5] Fix cross compilation issue with linux-mips64 | ||
| 6 | architecture | ||
| 7 | MIME-Version: 1.0 | ||
| 8 | Content-Type: text/plain; charset=UTF-8 | ||
| 9 | Content-Transfer-Encoding: 8bit | ||
| 10 | |||
| 11 | When compiling under Yocto project for linux-mips64 target architecture | ||
| 12 | .so files were generated incorrectly as: | ||
| 13 | |||
| 14 | rpds.cpython-312-mips64-linux-gnu.so | ||
| 15 | |||
| 16 | Where as platform and EXT_SUFFIX are defined as: | ||
| 17 | |||
| 18 | >>> sysconfig.get_platform() | ||
| 19 | 'linux-mips64' | ||
| 20 | >>> sysconfig.get_config_vars()['EXT_SUFFIX'] | ||
| 21 | '.cpython-312-mips64-linux-gnuabi64.so' | ||
| 22 | |||
| 23 | Which should have caused the .so files as: | ||
| 24 | |||
| 25 | rpds.cpython-312-mips64-linux-gnuabi64.so | ||
| 26 | |||
| 27 | Upstream-Status: Backport [https://github.com/PyO3/maturin/commit/5fe643579bcc63d824f6a0f0936fff451c622903] | ||
| 28 | |||
| 29 | Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com> | ||
| 30 | --- | ||
| 31 | src/python_interpreter/config.rs | 19 +++++++++++++++++++ | ||
| 32 | src/target.rs | 4 +++- | ||
| 33 | 2 files changed, 22 insertions(+), 1 deletion(-) | ||
| 34 | |||
| 35 | diff --git a/src/python_interpreter/config.rs b/src/python_interpreter/config.rs | ||
| 36 | index 8f883887..ef656010 100644 | ||
| 37 | --- a/src/python_interpreter/config.rs | ||
| 38 | +++ b/src/python_interpreter/config.rs | ||
| 39 | @@ -432,6 +432,25 @@ mod test { | ||
| 40 | .unwrap(); | ||
| 41 | assert_eq!(sysconfig.ext_suffix, ".cpython-310-powerpc-linux-gnu.so"); | ||
| 42 | |||
| 43 | + let sysconfig = InterpreterConfig::lookup_one( | ||
| 44 | + &Target::from_target_triple(Some("mips64-unknown-linux-gnu".to_string())).unwrap(), | ||
| 45 | + InterpreterKind::CPython, | ||
| 46 | + (3, 10), | ||
| 47 | + ) | ||
| 48 | + .unwrap(); | ||
| 49 | + assert_eq!( | ||
| 50 | + sysconfig.ext_suffix, | ||
| 51 | + ".cpython-310-mips64-linux-gnuabi64.so" | ||
| 52 | + ); | ||
| 53 | + | ||
| 54 | + let sysconfig = InterpreterConfig::lookup_one( | ||
| 55 | + &Target::from_target_triple(Some("mips-unknown-linux-gnu".to_string())).unwrap(), | ||
| 56 | + InterpreterKind::CPython, | ||
| 57 | + (3, 10), | ||
| 58 | + ) | ||
| 59 | + .unwrap(); | ||
| 60 | + assert_eq!(sysconfig.ext_suffix, ".cpython-310-mips-linux-gnu.so"); | ||
| 61 | + | ||
| 62 | let sysconfig = InterpreterConfig::lookup_one( | ||
| 63 | &Target::from_target_triple(Some("s390x-unknown-linux-gnu".to_string())).unwrap(), | ||
| 64 | InterpreterKind::CPython, | ||
| 65 | diff --git a/src/target.rs b/src/target.rs | ||
| 66 | index 93afd9bb..25fc6c07 100644 | ||
| 67 | --- a/src/target.rs | ||
| 68 | +++ b/src/target.rs | ||
| 69 | @@ -396,7 +396,9 @@ impl Target { | ||
| 70 | match python_impl { | ||
| 71 | CPython => { | ||
| 72 | // For musl handling see https://github.com/pypa/auditwheel/issues/349 | ||
| 73 | - if python_version >= (3, 11) { | ||
| 74 | + if matches!(self.target_arch(), Arch::Mips64 | Arch::Mips64el) && self.is_linux() { | ||
| 75 | + "gnuabi64".to_string() | ||
| 76 | + } else if python_version >= (3, 11) { | ||
| 77 | self.target_env().to_string() | ||
| 78 | } else { | ||
| 79 | self.target_env().to_string().replace("musl", "gnu") | ||
| 80 | -- | ||
| 81 | 2.34.1 | ||
| 82 | |||
