rollup merge of #21414: ejjeong/aarch64-linux-android
Initial support for aarch64-linux-android (#18920) - Add new configuration files - Modify some options to compile & link succesfully. (PIE, disable tls on jemalloc, modify some external function linkage, ..) - To build, refer to https://github.com/rust-lang/rust/wiki/Doc-building-for-android. (tested with platform=21 and toolchain=aarch64-linux-android-4.9)
This commit is contained in:
commit
a6780d8c6b
6 changed files with 66 additions and 4 deletions
|
|
@ -4648,13 +4648,13 @@ pub mod funcs {
|
|||
use types::os::arch::c95::c_int;
|
||||
use types::os::common::posix01::sighandler_t;
|
||||
|
||||
#[cfg(not(target_os = "android"))]
|
||||
#[cfg(not(all(target_os = "android", target_arch = "arm")))]
|
||||
extern {
|
||||
pub fn signal(signum: c_int,
|
||||
handler: sighandler_t) -> sighandler_t;
|
||||
}
|
||||
|
||||
#[cfg(target_os = "android")]
|
||||
#[cfg(all(target_os = "android", target_arch = "arm"))]
|
||||
extern {
|
||||
#[link_name = "bsd_signal"]
|
||||
pub fn signal(signum: c_int,
|
||||
|
|
|
|||
28
src/librustc_back/target/aarch64_linux_android.rs
Normal file
28
src/librustc_back/target/aarch64_linux_android.rs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright 2015 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 target::Target;
|
||||
|
||||
pub fn target() -> Target {
|
||||
let mut base = super::linux_base::opts();
|
||||
base.pre_link_args.push("-Wl,--allow-multiple-definition".to_string());
|
||||
base.position_independent_executables = true;
|
||||
Target {
|
||||
data_layout: "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-\
|
||||
f32:32:32-f64:64:64-v64:64:64-v128:128:128-a:0:64-\
|
||||
n32:64-S128".to_string(),
|
||||
llvm_target: "aarch64-linux-android".to_string(),
|
||||
target_endian: "little".to_string(),
|
||||
target_pointer_width: "64".to_string(),
|
||||
arch: "aarch64".to_string(),
|
||||
target_os: "android".to_string(),
|
||||
options: base,
|
||||
}
|
||||
}
|
||||
|
|
@ -65,6 +65,7 @@ mod arm_linux_androideabi;
|
|||
mod arm_unknown_linux_gnueabi;
|
||||
mod arm_unknown_linux_gnueabihf;
|
||||
mod aarch64_apple_ios;
|
||||
mod aarch64_linux_android;
|
||||
mod aarch64_unknown_linux_gnu;
|
||||
mod i686_apple_darwin;
|
||||
mod i686_pc_windows_gnu;
|
||||
|
|
@ -357,6 +358,7 @@ impl Target {
|
|||
i386_apple_ios,
|
||||
x86_64_apple_ios,
|
||||
aarch64_apple_ios,
|
||||
aarch64_linux_android,
|
||||
armv7_apple_ios,
|
||||
armv7s_apple_ios,
|
||||
|
||||
|
|
|
|||
|
|
@ -418,7 +418,7 @@ mod uw {
|
|||
trace_argument: *mut libc::c_void)
|
||||
-> _Unwind_Reason_Code;
|
||||
|
||||
#[cfg(all(not(target_os = "android"),
|
||||
#[cfg(all(not(all(target_os = "android", target_arch = "arm")),
|
||||
not(all(target_os = "linux", target_arch = "arm"))))]
|
||||
pub fn _Unwind_GetIP(ctx: *mut _Unwind_Context) -> libc::uintptr_t;
|
||||
|
||||
|
|
@ -431,7 +431,7 @@ mod uw {
|
|||
// On android, the function _Unwind_GetIP is a macro, and this is the
|
||||
// expansion of the macro. This is all copy/pasted directly from the
|
||||
// header file with the definition of _Unwind_GetIP.
|
||||
#[cfg(any(target_os = "android",
|
||||
#[cfg(any(all(target_os = "android", target_arch = "arm"),
|
||||
all(target_os = "linux", target_arch = "arm")))]
|
||||
pub unsafe fn _Unwind_GetIP(ctx: *mut _Unwind_Context) -> libc::uintptr_t {
|
||||
#[repr(C)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue