Skip to content

Commit b3518af

Browse files
authored
Rollup merge of rust-lang#39491 - dumbbell:support-aarch64-unknown-freebsd, r=alexcrichton
Support aarch64-unknown-freebsd
2 parents d021a3f + f6c6b31 commit b3518af

File tree

5 files changed

+39
-1
lines changed

5 files changed

+39
-1
lines changed

configure

+1-1
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ case $CFG_CPUTYPE in
517517
CFG_OSTYPE="${CFG_OSTYPE}eabihf"
518518
;;
519519

520-
aarch64)
520+
aarch64 | arm64)
521521
CFG_CPUTYPE=aarch64
522522
;;
523523

mk/cfg/aarch64-unknown-freebsd.mk

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# rustbuild-only target

src/bootstrap/bootstrap.py

+2
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,8 @@ def build_triple(self):
379379
ostype += 'eabihf'
380380
elif cputype == 'aarch64':
381381
cputype = 'aarch64'
382+
elif cputype == 'arm64':
383+
cputype = 'aarch64'
382384
elif cputype == 'mips':
383385
if sys.byteorder == 'big':
384386
cputype = 'mips'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
use target::{Target, TargetOptions, TargetResult};
12+
13+
pub fn target() -> TargetResult {
14+
let mut base = super::freebsd_base::opts();
15+
base.max_atomic_width = Some(128);
16+
17+
// see #36994
18+
base.exe_allocation_crate = "alloc_system".to_string();
19+
20+
Ok(Target {
21+
llvm_target: "aarch64-unknown-freebsd".to_string(),
22+
target_endian: "little".to_string(),
23+
target_pointer_width: "64".to_string(),
24+
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
25+
arch: "aarch64".to_string(),
26+
target_os: "freebsd".to_string(),
27+
target_env: "".to_string(),
28+
target_vendor: "unknown".to_string(),
29+
options: TargetOptions {
30+
abi_blacklist: super::arm_base::abi_blacklist(),
31+
.. base
32+
},
33+
})
34+
}

src/librustc_back/target/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ supported_targets! {
165165
("armv7-linux-androideabi", armv7_linux_androideabi),
166166
("aarch64-linux-android", aarch64_linux_android),
167167

168+
("aarch64-unknown-freebsd", aarch64_unknown_freebsd),
168169
("i686-unknown-freebsd", i686_unknown_freebsd),
169170
("x86_64-unknown-freebsd", x86_64_unknown_freebsd),
170171

0 commit comments

Comments
 (0)