Skip to content

Commit 5db21c3

Browse files
authored
Auto merge of #37387 - raphlinus:fuchsia_aarch64, r=alexcrichton
Support for aarch64 architecture on Fuchsia This patch adds support for the aarch64-unknown-fuchsia target. Also updates src/liblibc submodule to include required libc change.
2 parents 17e9d9a + c4651db commit 5db21c3

File tree

5 files changed

+35
-3
lines changed

5 files changed

+35
-3
lines changed

mk/cfg/aarch64-unknown-fuchsia.mk

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# rustbuild-only target
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright 2016 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, TargetResult};
12+
13+
pub fn target() -> TargetResult {
14+
let mut base = super::fuchsia_base::opts();
15+
base.max_atomic_width = Some(128);
16+
17+
Ok(Target {
18+
llvm_target: "aarch64-unknown-fuchsia".to_string(),
19+
target_endian: "little".to_string(),
20+
target_pointer_width: "64".to_string(),
21+
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
22+
arch: "aarch64".to_string(),
23+
target_os: "fuchsia".to_string(),
24+
target_env: "".to_string(),
25+
target_vendor: "unknown".to_string(),
26+
options: base,
27+
})
28+
}

src/librustc_back/target/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ supported_targets! {
177177
("x86_64-apple-darwin", x86_64_apple_darwin),
178178
("i686-apple-darwin", i686_apple_darwin),
179179

180+
("aarch64-unknown-fuchsia", aarch64_unknown_fuchsia),
180181
("x86_64-unknown-fuchsia", x86_64_unknown_fuchsia),
181182

182183
("i386-apple-ios", i386_apple_ios),

src/libstd/os/raw.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,17 @@
1818
target_arch = "arm",
1919
target_arch = "powerpc",
2020
target_arch = "powerpc64",
21-
target_arch = "s390x"))))]
21+
target_arch = "s390x")),
22+
all(target_os = "fuchsia", target_arch = "aarch64")))]
2223
#[stable(feature = "raw_os", since = "1.1.0")] pub type c_char = u8;
2324
#[cfg(not(any(target_os = "android",
2425
target_os = "emscripten",
2526
all(target_os = "linux", any(target_arch = "aarch64",
2627
target_arch = "arm",
2728
target_arch = "powerpc",
2829
target_arch = "powerpc64",
29-
target_arch = "s390x")))))]
30+
target_arch = "s390x")),
31+
all(target_os = "fuchsia", target_arch = "aarch64"))))]
3032
#[stable(feature = "raw_os", since = "1.1.0")] pub type c_char = i8;
3133
#[stable(feature = "raw_os", since = "1.1.0")] pub type c_schar = i8;
3234
#[stable(feature = "raw_os", since = "1.1.0")] pub type c_uchar = u8;

0 commit comments

Comments
 (0)