Open estebank opened 1 year ago
I noticed this while I was working on #128579. Technically, at least per LLVM, this should only be the case in FreeBSD >=13.
/// Tests whether the target 64-bit PowerPC big endian ABI is ELFv2.
bool isPPC64ELFv2ABI() const {
return (getArch() == Triple::ppc64 &&
((getOS() == Triple::FreeBSD &&
(getOSMajorVersion() >= 13 || getOSVersion().empty())) ||
getOS() == Triple::OpenBSD || isMusl()));
}
It also appears to be the ABI of choice for OpenBSD on both endians, though I'm not sure how well OpenBSD supports big endian 64-bit Power.
The packaged version of rust in FreeBSD patches their release with
https://cgit.freebsd.org/ports/tree/lang/rust/files/patch-compiler_rustc__target_src_abi_call_powerpc64.rs
Immediately before that we have the following:
We can add yet another check for them there so that
powerpc64-unknown-freebsd
always uses ELFv2. The platform list page shows this one as "PPC64 FreeBSD (ELFv1 and ELFv2)" on Tier 3.I do not know if doing this change would cause other issues, maybe with lowest FreeBSD version support?
They've been carrying this patch since 2019.
https://github.com/freebsd/freebsd-ports/blob/9c64647054c81b8876c7f4f987189427b5858ad6/lang/rust/files/patch-compiler_rustc__target_src_spec_powerpc64__unknown__freebsd.rs#L1-L14
Since 2020.