diff options
| author | bors <bors@rust-lang.org> | 2013-05-17 18:19:27 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-05-17 18:19:27 -0700 |
| commit | d68c0279eadc8544a1e3c1d9077185500a36ae66 (patch) | |
| tree | 9f1c22f6d98d4619ac63350828d584b9924582a8 /src | |
| parent | 2d28d645422c1617be58c8ca7ad9a457264ca850 (diff) | |
| parent | 48b6262b383365b7319ef76fa9c6d2c63c4d70e1 (diff) | |
| download | rust-d68c0279eadc8544a1e3c1d9077185500a36ae66.tar.gz rust-d68c0279eadc8544a1e3c1d9077185500a36ae66.zip | |
auto merge of #6249 : crabtw/rust/arm, r=brson
It uses the private field of TCB head to store stack limit. I tested on my Raspberry PI. A simple hello world program ran without any problem. However, for a more complex program, it segfaulted as #6231.
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc/back/arm.rs | 2 | ||||
| -rw-r--r-- | src/rt/arch/arm/record_sp.S | 8 | ||||
| -rw-r--r-- | src/rt/rust_task.h | 3 |
3 files changed, 12 insertions, 1 deletions
diff --git a/src/librustc/back/arm.rs b/src/librustc/back/arm.rs index dfe5751f21b..ff3c71da458 100644 --- a/src/librustc/back/arm.rs +++ b/src/librustc/back/arm.rs @@ -64,7 +64,7 @@ pub fn get_target_strs(target_os: session::os) -> target_strs::t { target_triple: match target_os { session::os_macos => ~"arm-apple-darwin", session::os_win32 => ~"arm-pc-mingw32", - session::os_linux => ~"arm-unknown-linux", + session::os_linux => ~"arm-unknown-linux-gnueabihf", session::os_android => ~"arm-linux-androideabi", session::os_freebsd => ~"arm-unknown-freebsd" }, diff --git a/src/rt/arch/arm/record_sp.S b/src/rt/arch/arm/record_sp.S index 95fce8746a1..8d5f24bc5a8 100644 --- a/src/rt/arch/arm/record_sp.S +++ b/src/rt/arch/arm/record_sp.S @@ -15,13 +15,21 @@ record_sp_limit: mrc p15, #0, r3, c13, c0, #3 +#if __ANDROID__ add r3, r3, #252 +#elif __linux__ + add r3, r3, #4 +#endif str r0, [r3] mov pc, lr get_sp_limit: mrc p15, #0, r3, c13, c0, #3 +#if __ANDROID__ add r3, r3, #252 +#elif __linux__ + add r3, r3, #4 +#endif ldr r0, [r3] mov pc, lr diff --git a/src/rt/rust_task.h b/src/rt/rust_task.h index 672af608db8..213aee6a9eb 100644 --- a/src/rt/rust_task.h +++ b/src/rt/rust_task.h @@ -146,6 +146,9 @@ #ifdef __mips__ #define RED_ZONE_SIZE RZ_MAC_32 #endif +#ifdef __arm__ +#define RED_ZONE_SIZE RZ_LINUX_32 +#endif #endif #ifdef __APPLE__ #ifdef __i386__ |
