diff options
| author | bors <bors@rust-lang.org> | 2015-01-03 20:20:48 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-01-03 20:20:48 +0000 |
| commit | 496dc4eae7de9d14cd49511a9acfbf5f11ae6c3f (patch) | |
| tree | 0b4dfc99ed7c3f80a5748aca27b4bcd9a1899da1 /src/libstd | |
| parent | fe7e285d0cbae8e44c3853a6965caf2b575dcfcc (diff) | |
| parent | 6e5fb8bd1bef7a36c32194b35ec16d0365adbcf1 (diff) | |
| download | rust-496dc4eae7de9d14cd49511a9acfbf5f11ae6c3f.tar.gz rust-496dc4eae7de9d14cd49511a9acfbf5f11ae6c3f.zip | |
auto merge of #19790 : akiss77/rust/aarch64-configure, r=alexcrichton
Preparing AArch64 support, starting work at the build system.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/os.rs | 7 | ||||
| -rw-r--r-- | src/libstd/rand/os.rs | 24 | ||||
| -rw-r--r-- | src/libstd/rt/libunwind.rs | 5 | ||||
| -rw-r--r-- | src/libstd/sys/common/stack.rs | 13 | ||||
| -rw-r--r-- | src/libstd/sys/unix/c.rs | 11 | ||||
| -rw-r--r-- | src/libstd/sys/unix/stack_overflow.rs | 3 | ||||
| -rw-r--r-- | src/libstd/sys/unix/sync.rs | 8 | ||||
| -rw-r--r-- | src/libstd/thread_local/mod.rs | 18 | ||||
| -rw-r--r-- | src/libstd/thread_local/scoped.rs | 20 |
9 files changed, 79 insertions, 30 deletions
diff --git a/src/libstd/os.rs b/src/libstd/os.rs index 615a20baf89..2ca6bccabc0 100644 --- a/src/libstd/os.rs +++ b/src/libstd/os.rs @@ -1,4 +1,4 @@ -// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT +// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -1414,6 +1414,11 @@ mod arch_consts { pub const ARCH: &'static str = "arm"; } +#[cfg(target_arch = "aarch64")] +mod arch_consts { + pub const ARCH: &'static str = "aarch64"; +} + #[cfg(target_arch = "mips")] mod arch_consts { pub const ARCH: &'static str = "mips"; diff --git a/src/libstd/rand/os.rs b/src/libstd/rand/os.rs index 9f3ac84afff..5caa71b4347 100644 --- a/src/libstd/rand/os.rs +++ b/src/libstd/rand/os.rs @@ -1,4 +1,4 @@ -// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT +// Copyright 2013-2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -29,7 +29,10 @@ mod imp { use os::errno; #[cfg(all(target_os = "linux", - any(target_arch = "x86_64", target_arch = "x86", target_arch = "arm")))] + any(target_arch = "x86_64", + target_arch = "x86", + target_arch = "arm", + target_arch = "aarch64")))] fn getrandom(buf: &mut [u8]) -> libc::c_long { extern "C" { fn syscall(number: libc::c_long, ...) -> libc::c_long; @@ -39,7 +42,7 @@ mod imp { const NR_GETRANDOM: libc::c_long = 318; #[cfg(target_arch = "x86")] const NR_GETRANDOM: libc::c_long = 355; - #[cfg(target_arch = "arm")] + #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] const NR_GETRANDOM: libc::c_long = 384; unsafe { @@ -48,7 +51,10 @@ mod imp { } #[cfg(not(all(target_os = "linux", - any(target_arch = "x86_64", target_arch = "x86", target_arch = "arm"))))] + any(target_arch = "x86_64", + target_arch = "x86", + target_arch = "arm", + target_arch = "aarch64"))))] fn getrandom(_buf: &mut [u8]) -> libc::c_long { -1 } fn getrandom_fill_bytes(v: &mut [u8]) { @@ -82,7 +88,10 @@ mod imp { } #[cfg(all(target_os = "linux", - any(target_arch = "x86_64", target_arch = "x86", target_arch = "arm")))] + any(target_arch = "x86_64", + target_arch = "x86", + target_arch = "arm", + target_arch = "aarch64")))] fn is_getrandom_available() -> bool { use sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT, Relaxed}; @@ -107,7 +116,10 @@ mod imp { } #[cfg(not(all(target_os = "linux", - any(target_arch = "x86_64", target_arch = "x86", target_arch = "arm"))))] + any(target_arch = "x86_64", + target_arch = "x86", + target_arch = "arm", + target_arch = "aarch64"))))] fn is_getrandom_available() -> bool { false } /// A random number generator that retrieves randomness straight from diff --git a/src/libstd/rt/libunwind.rs b/src/libstd/rt/libunwind.rs index 4dbe878277d..3fdfb5327ee 100644 --- a/src/libstd/rt/libunwind.rs +++ b/src/libstd/rt/libunwind.rs @@ -1,4 +1,4 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -75,6 +75,9 @@ pub const unwinder_private_data_size: uint = 20; #[cfg(all(target_arch = "arm", target_os = "ios"))] pub const unwinder_private_data_size: uint = 5; +#[cfg(target_arch = "aarch64")] +pub const unwinder_private_data_size: uint = 2; + #[cfg(any(target_arch = "mips", target_arch = "mipsel"))] pub const unwinder_private_data_size: uint = 2; diff --git a/src/libstd/sys/common/stack.rs b/src/libstd/sys/common/stack.rs index 2a88e20c8fa..ce5ab67ae61 100644 --- a/src/libstd/sys/common/stack.rs +++ b/src/libstd/sys/common/stack.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2013-2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -226,6 +226,11 @@ pub unsafe fn record_sp_limit(limit: uint) { } } + // aarch64 - FIXME(AARCH64): missing... + #[cfg(target_arch = "aarch64")] + unsafe fn target_record_sp_limit(_: uint) { + } + // iOS segmented stack is disabled for now, see related notes #[cfg(all(target_arch = "arm", target_os = "ios"))] #[inline(always)] unsafe fn target_record_sp_limit(_: uint) { @@ -315,6 +320,12 @@ pub unsafe fn get_sp_limit() -> uint { } } + // aarch64 - FIXME(AARCH64): missing... + #[cfg(target_arch = "aarch64")] + unsafe fn target_get_sp_limit() -> uint { + 1024 + } + // iOS doesn't support segmented stacks yet. This function might // be called by runtime though so it is unsafe to mark it as // unreachable, let's return a fixed constant. diff --git a/src/libstd/sys/unix/c.rs b/src/libstd/sys/unix/c.rs index 1bb8ed78177..ca419d1c7f4 100644 --- a/src/libstd/sys/unix/c.rs +++ b/src/libstd/sys/unix/c.rs @@ -1,4 +1,4 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -28,7 +28,8 @@ pub const FIONBIO: libc::c_ulong = 0x8004667e; #[cfg(any(all(target_os = "linux", any(target_arch = "x86", target_arch = "x86_64", - target_arch = "arm")), + target_arch = "arm", + target_arch = "aarch64")), target_os = "android"))] pub const FIONBIO: libc::c_ulong = 0x5421; #[cfg(all(target_os = "linux", @@ -43,7 +44,8 @@ pub const FIOCLEX: libc::c_ulong = 0x20006601; #[cfg(any(all(target_os = "linux", any(target_arch = "x86", target_arch = "x86_64", - target_arch = "arm")), + target_arch = "arm", + target_arch = "aarch64")), target_os = "android"))] pub const FIOCLEX: libc::c_ulong = 0x5451; #[cfg(all(target_os = "linux", @@ -127,7 +129,8 @@ mod select { #[cfg(any(all(target_os = "linux", any(target_arch = "x86", target_arch = "x86_64", - target_arch = "arm")), + target_arch = "arm", + target_arch = "aarch64")), target_os = "android"))] mod signal { use libc; diff --git a/src/libstd/sys/unix/stack_overflow.rs b/src/libstd/sys/unix/stack_overflow.rs index 95ab9b459d6..1fd619a28db 100644 --- a/src/libstd/sys/unix/stack_overflow.rs +++ b/src/libstd/sys/unix/stack_overflow.rs @@ -1,4 +1,4 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -147,6 +147,7 @@ mod imp { #[cfg(any(all(target_os = "linux", target_arch = "x86"), // may not match all(target_os = "linux", target_arch = "x86_64"), all(target_os = "linux", target_arch = "arm"), // may not match + all(target_os = "linux", target_arch = "aarch64"), all(target_os = "linux", target_arch = "mips"), // may not match all(target_os = "linux", target_arch = "mipsel"), // may not match target_os = "android"))] // may not match diff --git a/src/libstd/sys/unix/sync.rs b/src/libstd/sys/unix/sync.rs index 77c5582d8a4..1d8a59dbbb3 100644 --- a/src/libstd/sys/unix/sync.rs +++ b/src/libstd/sys/unix/sync.rs @@ -1,4 +1,4 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -125,15 +125,19 @@ mod os { target_arch = "mips", target_arch = "mipsel"))] const __SIZEOF_PTHREAD_MUTEX_T: uint = 24 - 8; + #[cfg(target_arch = "aarch64")] + const __SIZEOF_PTHREAD_MUTEX_T: uint = 48 - 8; #[cfg(any(target_arch = "x86_64", target_arch = "x86", target_arch = "arm", + target_arch = "aarch64", target_arch = "mips", target_arch = "mipsel"))] const __SIZEOF_PTHREAD_COND_T: uint = 48 - 8; - #[cfg(target_arch = "x86_64")] + #[cfg(any(target_arch = "x86_64", + target_arch = "aarch64"))] const __SIZEOF_PTHREAD_RWLOCK_T: uint = 56 - 8; #[cfg(any(target_arch = "x86", diff --git a/src/libstd/thread_local/mod.rs b/src/libstd/thread_local/mod.rs index 75e5ac59685..91d8aec01cf 100644 --- a/src/libstd/thread_local/mod.rs +++ b/src/libstd/thread_local/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -175,17 +175,21 @@ macro_rules! thread_local { #[doc(hidden)] macro_rules! __thread_local_inner { (static $name:ident: $t:ty = $init:expr) => ( - #[cfg_attr(any(target_os = "macos", target_os = "linux"), thread_local)] + #[cfg_attr(all(any(target_os = "macos", target_os = "linux"), + not(target_arch = "aarch64")), + thread_local)] static $name: ::std::thread_local::__impl::KeyInner<$t> = __thread_local_inner!($init, $t); ); (pub static $name:ident: $t:ty = $init:expr) => ( - #[cfg_attr(any(target_os = "macos", target_os = "linux"), thread_local)] + #[cfg_attr(all(any(target_os = "macos", target_os = "linux"), + not(target_arch = "aarch64")), + thread_local)] pub static $name: ::std::thread_local::__impl::KeyInner<$t> = __thread_local_inner!($init, $t); ); ($init:expr, $t:ty) => ({ - #[cfg(any(target_os = "macos", target_os = "linux"))] + #[cfg(all(any(target_os = "macos", target_os = "linux"), not(target_arch = "aarch64")))] const _INIT: ::std::thread_local::__impl::KeyInner<$t> = { ::std::thread_local::__impl::KeyInner { inner: ::std::cell::UnsafeCell { value: $init }, @@ -194,7 +198,7 @@ macro_rules! __thread_local_inner { } }; - #[cfg(all(not(any(target_os = "macos", target_os = "linux"))))] + #[cfg(any(not(any(target_os = "macos", target_os = "linux")), target_arch = "aarch64"))] const _INIT: ::std::thread_local::__impl::KeyInner<$t> = { unsafe extern fn __destroy(ptr: *mut u8) { ::std::thread_local::__impl::destroy_value::<$t>(ptr); @@ -317,7 +321,7 @@ impl<T: 'static> Key<T> { pub fn destroyed(&'static self) -> bool { self.state() == State::Destroyed } } -#[cfg(any(target_os = "macos", target_os = "linux"))] +#[cfg(all(any(target_os = "macos", target_os = "linux"), not(target_arch = "aarch64")))] mod imp { use prelude::v1::*; @@ -449,7 +453,7 @@ mod imp { } } -#[cfg(not(any(target_os = "macos", target_os = "linux")))] +#[cfg(any(not(any(target_os = "macos", target_os = "linux")), target_arch = "aarch64"))] mod imp { use prelude::v1::*; diff --git a/src/libstd/thread_local/scoped.rs b/src/libstd/thread_local/scoped.rs index c53d393f1eb..dc36fda3a02 100644 --- a/src/libstd/thread_local/scoped.rs +++ b/src/libstd/thread_local/scoped.rs @@ -1,4 +1,4 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -78,13 +78,19 @@ macro_rules! scoped_thread_local { #[doc(hidden)] macro_rules! __scoped_thread_local_inner { (static $name:ident: $t:ty) => ( - #[cfg_attr(not(any(windows, target_os = "android", target_os = "ios")), + #[cfg_attr(not(any(windows, + target_os = "android", + target_os = "ios", + target_arch = "aarch64")), thread_local)] static $name: ::std::thread_local::scoped::Key<$t> = __scoped_thread_local_inner!($t); ); (pub static $name:ident: $t:ty) => ( - #[cfg_attr(not(any(windows, target_os = "android", target_os = "ios")), + #[cfg_attr(not(any(windows, + target_os = "android", + target_os = "ios", + target_arch = "aarch64")), thread_local)] pub static $name: ::std::thread_local::scoped::Key<$t> = __scoped_thread_local_inner!($t); @@ -92,14 +98,14 @@ macro_rules! __scoped_thread_local_inner { ($t:ty) => ({ use std::thread_local::scoped::Key as __Key; - #[cfg(not(any(windows, target_os = "android", target_os = "ios")))] + #[cfg(not(any(windows, target_os = "android", target_os = "ios", target_arch = "aarch64")))] const _INIT: __Key<$t> = __Key { inner: ::std::thread_local::scoped::__impl::KeyInner { inner: ::std::cell::UnsafeCell { value: 0 as *mut _ }, } }; - #[cfg(any(windows, target_os = "android", target_os = "ios"))] + #[cfg(any(windows, target_os = "android", target_os = "ios", target_arch = "aarch64"))] const _INIT: __Key<$t> = __Key { inner: ::std::thread_local::scoped::__impl::KeyInner { inner: ::std::thread_local::scoped::__impl::OS_INIT, @@ -199,7 +205,7 @@ impl<T> Key<T> { } } -#[cfg(not(any(windows, target_os = "android", target_os = "ios")))] +#[cfg(not(any(windows, target_os = "android", target_os = "ios", target_arch = "aarch64")))] mod imp { use std::cell::UnsafeCell; @@ -217,7 +223,7 @@ mod imp { } } -#[cfg(any(windows, target_os = "android", target_os = "ios"))] +#[cfg(any(windows, target_os = "android", target_os = "ios", target_arch = "aarch64"))] mod imp { use kinds::marker; use sys_common::thread_local::StaticKey as OsStaticKey; |
