diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-01-21 09:15:59 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-01-21 09:15:59 -0800 |
| commit | a6780d8c6be311cd9a2e0cdda726469a04d21a9c (patch) | |
| tree | e119d0b5d837b05450e4766394949fc2c60ec539 /src | |
| parent | 81504f211c36afb69fa2a13d475c45e65d7b2a31 (diff) | |
| parent | 940080501b76e559e3a2c0de1b15dc7b2353fd85 (diff) | |
| download | rust-a6780d8c6be311cd9a2e0cdda726469a04d21a9c.tar.gz rust-a6780d8c6be311cd9a2e0cdda726469a04d21a9c.zip | |
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)
Diffstat (limited to 'src')
| -rw-r--r-- | src/liblibc/lib.rs | 4 | ||||
| -rw-r--r-- | src/librustc_back/target/aarch64_linux_android.rs | 28 | ||||
| -rw-r--r-- | src/librustc_back/target/mod.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/unix/backtrace.rs | 4 |
4 files changed, 34 insertions, 4 deletions
diff --git a/src/liblibc/lib.rs b/src/liblibc/lib.rs index fa6468517e6..677a5f37a1b 100644 --- a/src/liblibc/lib.rs +++ b/src/liblibc/lib.rs @@ -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, diff --git a/src/librustc_back/target/aarch64_linux_android.rs b/src/librustc_back/target/aarch64_linux_android.rs new file mode 100644 index 00000000000..313c0dc2a6e --- /dev/null +++ b/src/librustc_back/target/aarch64_linux_android.rs @@ -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, + } +} diff --git a/src/librustc_back/target/mod.rs b/src/librustc_back/target/mod.rs index f8eabb4375f..4626f2dc483 100644 --- a/src/librustc_back/target/mod.rs +++ b/src/librustc_back/target/mod.rs @@ -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, diff --git a/src/libstd/sys/unix/backtrace.rs b/src/libstd/sys/unix/backtrace.rs index 70b9c012b00..e6007a4d43c 100644 --- a/src/libstd/sys/unix/backtrace.rs +++ b/src/libstd/sys/unix/backtrace.rs @@ -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)] |
