Skip to content

Commit

Permalink
Rollup merge of rust-lang#58080 - MikaelUrankar:freebsd_arm, r=nagisa
Browse files Browse the repository at this point in the history
Add FreeBSD armv6 and armv7 targets
  • Loading branch information
Centril authored Feb 13, 2019
2 parents 4eda0c3 + 6d85669 commit db2c161
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ def default_build_triple():
cputype = 'arm'
if ostype == 'linux-android':
ostype = 'linux-androideabi'
elif ostype == 'unknown-freebsd':
cputype = subprocess.check_output(
['uname', '-p']).strip().decode(default_encoding)
ostype = 'unknown-freebsd'
elif cputype == 'armv6l':
cputype = 'arm'
if ostype == 'linux-android':
Expand Down
24 changes: 24 additions & 0 deletions src/librustc_target/spec/armv6_unknown_freebsd.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
use spec::{LinkerFlavor, Target, TargetOptions, TargetResult};

pub fn target() -> TargetResult {
let base = super::freebsd_base::opts();
Ok(Target {
llvm_target: "armv6-unknown-freebsd-gnueabihf".to_string(),
target_endian: "little".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-v128:64:128-a:0:32-n32-S64".to_string(),
arch: "arm".to_string(),
target_os: "freebsd".to_string(),
target_env: "gnueabihf".to_string(),
target_vendor: "unknown".to_string(),
linker_flavor: LinkerFlavor::Gcc,

options: TargetOptions {
features: "+v6,+vfp2".to_string(),
max_atomic_width: Some(64),
abi_blacklist: super::arm_base::abi_blacklist(),
.. base
}
})
}
24 changes: 24 additions & 0 deletions src/librustc_target/spec/armv7_unknown_freebsd.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
use spec::{LinkerFlavor, Target, TargetOptions, TargetResult};

pub fn target() -> TargetResult {
let base = super::freebsd_base::opts();
Ok(Target {
llvm_target: "armv7-unknown-freebsd-gnueabihf".to_string(),
target_endian: "little".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-v128:64:128-a:0:32-n32-S64".to_string(),
arch: "arm".to_string(),
target_os: "freebsd".to_string(),
target_env: "gnueabihf".to_string(),
target_vendor: "unknown".to_string(),
linker_flavor: LinkerFlavor::Gcc,

options: TargetOptions {
features: "+v7,+vfp3,+d16,+thumb2,-neon".to_string(),
max_atomic_width: Some(64),
abi_blacklist: super::arm_base::abi_blacklist(),
.. base
}
})
}
2 changes: 2 additions & 0 deletions src/librustc_target/spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,8 @@ supported_targets! {
("aarch64-linux-android", aarch64_linux_android),

("aarch64-unknown-freebsd", aarch64_unknown_freebsd),
("armv6-unknown-freebsd", armv6_unknown_freebsd),
("armv7-unknown-freebsd", armv7_unknown_freebsd),
("i686-unknown-freebsd", i686_unknown_freebsd),
("powerpc64-unknown-freebsd", powerpc64_unknown_freebsd),
("x86_64-unknown-freebsd", x86_64_unknown_freebsd),
Expand Down

0 comments on commit db2c161

Please sign in to comment.