diff --git a/Changelog.md b/Changelog.md index afa827f06..682137822 100644 --- a/Changelog.md +++ b/Changelog.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Add Linux mips64el architecture support in [#1023](https://github.com/PyO3/maturin/pull/1023) * Add Linux mipsel architecture support in [#1024](https://github.com/PyO3/maturin/pull/1024) * Add Linux 32-bit powerpc architecture support in [#1026](https://github.com/PyO3/maturin/pull/1026) +* Add Linux sparc64 architecture support in [#1027](https://github.com/PyO3/maturin/pull/1027) ## [0.13.1] - 2022-07-26 diff --git a/setup.py b/setup.py index bad38573b..0bfad1da3 100644 --- a/setup.py +++ b/setup.py @@ -47,12 +47,14 @@ def finalize_options(self): cargo_args = [] if platform.machine() in ( + "mips", + "mips64", + "ppc", "ppc64le", "ppc64", "powerpc", "riscv64", - "mips", - "mips64", + "sparc64", ) or (sys.platform == "win32" and platform.machine() == "ARM64"): cargo_args.extend(["--no-default-features", "--features=upload,log,human-panic"]) elif sys.platform.startswith("haiku"): diff --git a/src/target.rs b/src/target.rs index 169b76a24..b8fcce278 100644 --- a/src/target.rs +++ b/src/target.rs @@ -65,6 +65,7 @@ pub enum Arch { Riscv64, Mips64el, Mipsel, + Sparc64, } impl fmt::Display for Arch { @@ -83,6 +84,7 @@ impl fmt::Display for Arch { Arch::Riscv64 => write!(f, "riscv64"), Arch::Mips64el => write!(f, "mips64el"), Arch::Mipsel => write!(f, "mipsel"), + Arch::Sparc64 => write!(f, "sparc64"), } } } @@ -103,6 +105,7 @@ fn get_supported_architectures(os: &Os) -> Vec { Arch::Riscv64, Arch::Mips64el, Arch::Mipsel, + Arch::Sparc64, ], Os::Windows => vec![Arch::X86, Arch::X86_64, Arch::Aarch64], Os::Macos => vec![Arch::Aarch64, Arch::X86_64], @@ -188,6 +191,7 @@ impl Target { Architecture::Riscv64(_) => Arch::Riscv64, Architecture::Mips64(Mips64Architecture::Mips64el) => Arch::Mips64el, Architecture::Mips32(Mips32Architecture::Mipsel) => Arch::Mipsel, + Architecture::Sparc64 => Arch::Sparc64, unsupported => bail!("The architecture {} is not supported", unsupported), }; @@ -381,6 +385,7 @@ impl Target { // It's kinda surprising that Python doesn't include the `el` suffix Arch::Mips64el => "mips64", Arch::Mipsel => "mips", + Arch::Sparc64 => "sparc64", } } @@ -412,7 +417,8 @@ impl Target { | Arch::Riscv64 | Arch::Mips64el | Arch::Mipsel - | Arch::Powerpc => PlatformTag::Linux, + | Arch::Powerpc + | Arch::Sparc64 => PlatformTag::Linux, } } @@ -425,7 +431,8 @@ impl Target { | Arch::X86_64 | Arch::S390X | Arch::Riscv64 - | Arch::Mips64el => 64, + | Arch::Mips64el + | Arch::Sparc64 => 64, Arch::Armv6L | Arch::Armv7L | Arch::X86