--- a/compiler/rustc_target/src/spec/mod.rs +++ b/compiler/rustc_target/src/spec/mod.rs @@ -1034,6 +1034,7 @@ supported_targets! { ("arm-openwrt-linux-muslgnueabihf", arm_openwrt_linux_muslgnueabihf), ("armv5tej-openwrt-linux-muslgnueabi", armv5tej_openwrt_linux_muslgnueabi), ("armv6k-openwrt-linux-muslgnueabi", armv6k_openwrt_linux_muslgnueabi), + ("powerpc-openwrt-linux-musl", powerpc_openwrt_linux_musl), } /// Warnings encountered when parsing the target `json`. --- /dev/null +++ b/compiler/rustc_target/src/spec/powerpc_openwrt_linux_musl.rs @@ -0,0 +1,16 @@ +use crate::abi::Endian; +use crate::spec::{LinkerFlavor, Target, TargetOptions}; + +pub fn target() -> Target { + let mut base = super::linux_musl_base::opts(); + base.pre_link_args.entry(LinkerFlavor::Gcc).or_default().push("-m32".into()); + base.max_atomic_width = Some(32); + + Target { + llvm_target: "powerpc-unknown-linux-musl".into(), + pointer_width: 32, + data_layout: "E-m:e-p:32:32-i64:64-n32".into(), + arch: "powerpc".into(), + options: TargetOptions { endian: Endian::Big, mcount: "_mcount".into(), ..base }, + } +}