Skip to content

Commit

Permalink
Merge pull request #1027 from messense/sparc64
Browse files Browse the repository at this point in the history
Add Linux sparc64 architecture support
  • Loading branch information
messense authored Jul 28, 2022
2 parents 16a9c18 + c8ad722 commit d52d59c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down
11 changes: 9 additions & 2 deletions src/target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ pub enum Arch {
Riscv64,
Mips64el,
Mipsel,
Sparc64,
}

impl fmt::Display for Arch {
Expand All @@ -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"),
}
}
}
Expand All @@ -103,6 +105,7 @@ fn get_supported_architectures(os: &Os) -> Vec<Arch> {
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],
Expand Down Expand Up @@ -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),
};

Expand Down Expand Up @@ -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",
}
}

Expand Down Expand Up @@ -412,7 +417,8 @@ impl Target {
| Arch::Riscv64
| Arch::Mips64el
| Arch::Mipsel
| Arch::Powerpc => PlatformTag::Linux,
| Arch::Powerpc
| Arch::Sparc64 => PlatformTag::Linux,
}
}

Expand All @@ -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
Expand Down

0 comments on commit d52d59c

Please sign in to comment.