You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, it should be fairly easy to add FreeBSD support for ppc, ppc64 and sparc64 unless there are any peculiarities in the FreeBSD ABI that I'm unaware of. I can have a go at this.
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use spec::{LinkerFlavor, Target, TargetResult};
pub fn target() -> TargetResult {
let mut base = super::freebsd_base::opts();
base.cpu = "ppc64".to_string();
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
base.max_atomic_width = Some(64);
Ok(Target {
llvm_target: "powerpc64-unknown-freebsd".to_string(),
target_endian: "big".to_string(),
target_pointer_width: "64".to_string(),
target_c_int_width: "32".to_string(),
data_layout: "E-m:e-i64:64-n32:64".to_string(),
arch: "powerpc64".to_string(),
target_os: "freebsd".to_string(),
target_env: "".to_string(),
target_vendor: "unknown".to_string(),
linker_flavor: LinkerFlavor::Gcc,
options: base,
})
}
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use spec::{LinkerFlavor, Target, TargetResult};
pub fn target() -> TargetResult {
let mut base = super::freebsd_base::opts();
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m32".to_string());
base.max_atomic_width = Some(32);
Ok(Target {
llvm_target: "powerpc-unknown-freebsd".to_string(),
target_endian: "big".to_string(),
target_pointer_width: "32".to_string(),
target_c_int_width: "32".to_string(),
data_layout: "E-m:e-p:32:32-i64:64-n32".to_string(),
arch: "powerpc".to_string(),
target_os: "freebsd".to_string(),
target_env: String::new(),
target_vendor: "unknown".to_string(),
linker_flavor: LinkerFlavor::Gcc,
options: base,
})
}
I see that ppc64 support was added, and it is actually available now for ppc64 ELFv1 ABI (FreeBSD 12.x), and both ppc64 and ppc64le ELFv2 ABI (soon-to-be-released FreeBSD 13).
How far has anyone made it with bringing up support for 32-bit ppc, on either FreeBSD 12.x (with gcc 4.2 in the base system, and thus probably relying on a newer gcc/llvm compiled from source code via the ports), or else FreeBSD 13 (with llvm in the base system)?
If someone (perhaps me) were to volunteer to continue working on such a project, what next steps would be required?
(Edit: The compromises that are required to maintain a FreeBSD 12.x system with up-to-date packages are beginning to take a hit as the only viable path forward at the moment is to avoid any packages which have a rust library anywhere in their chain of dependencies. I am increasingly thinking that the better path forward would be to bite the bullet and actually finish a 32-bit ppc rustc bootstrap. I see that 32-bit ppc is already supported as a Tier 2 architecture for a couple different flavours of Linux, so that gives me some hope that it might be possible for FreeBSD too.)
Activity
glaubitz commentedon Dec 25, 2018
Yes, it should be fairly easy to add FreeBSD support for ppc, ppc64 and sparc64 unless there are any peculiarities in the FreeBSD ABI that I'm unaware of. I can have a go at this.
lenoil98 commentedon Dec 25, 2018
Great! I will help where I can.
lenoil98 commentedon Dec 28, 2018
I've created spec files for FreeBSD.
glaubitz commentedon Jan 11, 2019
@lenoil98 Has this target been added now?
goosnarrggh commentedon Jan 4, 2021
I see that ppc64 support was added, and it is actually available now for ppc64 ELFv1 ABI (FreeBSD 12.x), and both ppc64 and ppc64le ELFv2 ABI (soon-to-be-released FreeBSD 13).
How far has anyone made it with bringing up support for 32-bit ppc, on either FreeBSD 12.x (with gcc 4.2 in the base system, and thus probably relying on a newer gcc/llvm compiled from source code via the ports), or else FreeBSD 13 (with llvm in the base system)?
If someone (perhaps me) were to volunteer to continue working on such a project, what next steps would be required?
(Edit: The compromises that are required to maintain a FreeBSD 12.x system with up-to-date packages are beginning to take a hit as the only viable path forward at the moment is to avoid any packages which have a rust library anywhere in their chain of dependencies. I am increasingly thinking that the better path forward would be to bite the bullet and actually finish a 32-bit ppc rustc bootstrap. I see that 32-bit ppc is already supported as a Tier 2 architecture for a couple different flavours of Linux, so that gives me some hope that it might be possible for FreeBSD too.)
barracuda156 commentedon May 16, 2024
@goosnarrggh Have you gotten anywhere with Rust for ppc?