diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs index 0f2aaeb533a97..437517989ab2b 100644 --- a/compiler/rustc_target/src/spec/mod.rs +++ b/compiler/rustc_target/src/spec/mod.rs @@ -769,6 +769,7 @@ supported_targets! { ("armv7-unknown-freebsd", armv7_unknown_freebsd), ("i686-unknown-freebsd", i686_unknown_freebsd), ("powerpc64-unknown-freebsd", powerpc64_unknown_freebsd), + ("powerpc64le-unknown-freebsd", powerpc64le_unknown_freebsd), ("x86_64-unknown-freebsd", x86_64_unknown_freebsd), ("x86_64-unknown-dragonfly", x86_64_unknown_dragonfly), diff --git a/compiler/rustc_target/src/spec/powerpc64le_unknown_freebsd.rs b/compiler/rustc_target/src/spec/powerpc64le_unknown_freebsd.rs new file mode 100644 index 0000000000000..283e9f744cbfc --- /dev/null +++ b/compiler/rustc_target/src/spec/powerpc64le_unknown_freebsd.rs @@ -0,0 +1,16 @@ +use crate::spec::{LinkerFlavor, Target, TargetOptions}; + +pub fn target() -> Target { + let mut base = super::freebsd_base::opts(); + base.cpu = "ppc64le".to_string(); + base.pre_link_args.entry(LinkerFlavor::Gcc).or_default().push("-m64".to_string()); + base.max_atomic_width = Some(64); + + Target { + llvm_target: "powerpc64le-unknown-freebsd".to_string(), + pointer_width: 64, + data_layout: "e-m:e-i64:64-n32:64".to_string(), + arch: "powerpc64".to_string(), + options: TargetOptions { mcount: "_mcount".to_string(), ..base }, + } +} diff --git a/src/doc/rustc/src/platform-support.md b/src/doc/rustc/src/platform-support.md index 3225e95941cf3..885010b039eac 100644 --- a/src/doc/rustc/src/platform-support.md +++ b/src/doc/rustc/src/platform-support.md @@ -248,6 +248,7 @@ target | std | host | notes `powerpc-wrs-vxworks-spe` | ? | | `powerpc-wrs-vxworks` | ? | | `powerpc64-unknown-freebsd` | ✓ | ✓ | PPC64 FreeBSD (ELFv1 and ELFv2) +`powerpc64le-unknown-freebsd` | | | PPC64LE FreeBSD `powerpc64-unknown-linux-musl` | ? | | `powerpc64-wrs-vxworks` | ? | | `powerpc64le-unknown-linux-musl` | ? | |