about summary refs log tree commit diff
path: root/src/libstd/sys/common/stack.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-02-02 10:56:57 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-02-02 10:56:57 -0800
commit425f2328d0d6d2848a399424ab26dde4800edcf9 (patch)
tree638cfb61a5f646ee6693586a3b4cadec20ec8cdb /src/libstd/sys/common/stack.rs
parent9529ab0e7e469940db890604060c073179db8464 (diff)
parentf6414b0187bfc6e5b563a17c85a9f790d6257551 (diff)
downloadrust-425f2328d0d6d2848a399424ab26dde4800edcf9.tar.gz
rust-425f2328d0d6d2848a399424ab26dde4800edcf9.zip
rollup merge of #21754: semarie/openbsd-rebased
Hi.

Here a commit in order to add OpenBSD support to rust.

- tests status:
run-pass: test result: ok. 1879 passed; 0 failed; 24 ignored; 0 measured
run-fail: test result: ok. 81 passed; 0 failed; 5 ignored; 0 measured
compile-fail: test result: ok. 1634 passed; 0 failed; 22 ignored; 0 measured
run-pass-fulldeps: test result: ok. 22 passed; 0 failed; 1 ignored; 0 measured
compile-fail-fulldeps: test result: ok. 13 passed; 0 failed; 0 ignored; 0 measured

- The current implementation of load_self function (src/libstd/sys/unix/os.rs) isn't optimal as under OpenBSD I haven't found a reliable method to get the filename of a running process. The current implementation is enought for bootstrapping purpose.

- I have disable `run-pass/tcp-stress.rs` test under openbsd. When run manually, the test pass, but when run under `compiletest`, it timeout and echo continuoulsy `Too many open files`.

- For building with jemalloc, a more recent version of jemalloc would be mandatory. See https://github.com/jemalloc/jemalloc/pull/188 for more details.
Diffstat (limited to 'src/libstd/sys/common/stack.rs')
-rw-r--r--src/libstd/sys/common/stack.rs43
1 files changed, 17 insertions, 26 deletions
diff --git a/src/libstd/sys/common/stack.rs b/src/libstd/sys/common/stack.rs
index 88bb9395cf1..8dd2f154fa8 100644
--- a/src/libstd/sys/common/stack.rs
+++ b/src/libstd/sys/common/stack.rs
@@ -227,18 +227,13 @@ pub unsafe fn record_sp_limit(limit: uint) {
     }
 
     // aarch64 - FIXME(AARCH64): missing...
-    #[cfg(target_arch = "aarch64")]
-    unsafe fn target_record_sp_limit(_: uint) {
-    }
-
     // powerpc - FIXME(POWERPC): missing...
-    #[cfg(target_arch = "powerpc")]
-    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)]
+    // arm-ios - iOS segmented stack is disabled for now, see related notes
+    // openbsd - segmented stack is disabled
+    #[cfg(any(target_arch = "aarch64",
+              target_arch = "powerpc",
+              all(target_arch = "arm", target_os = "ios"),
+              target_os = "openbsd"))]
     unsafe fn target_record_sp_limit(_: uint) {
     }
 }
@@ -327,21 +322,17 @@ pub unsafe fn get_sp_limit() -> uint {
     }
 
     // aarch64 - FIXME(AARCH64): missing...
-    #[cfg(target_arch = "aarch64")]
-    unsafe fn target_get_sp_limit() -> uint {
-        1024
-    }
-
-    // powepc - FIXME(POWERPC): missing...
-    #[cfg(target_arch = "powerpc")]
-    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.
-    #[cfg(all(target_arch = "arm", target_os = "ios"))] #[inline(always)]
+    // powerpc - FIXME(POWERPC): missing...
+    // arm-ios - iOS doesn't support segmented stacks yet.
+    // openbsd - OpenBSD doesn't support segmented stacks.
+    //
+    // This function might be called by runtime though
+    // so it is unsafe to unreachable, let's return a fixed constant.
+    #[cfg(any(target_arch = "aarch64",
+              target_arch = "powerpc",
+              all(target_arch = "arm", target_os = "ios"),
+              target_os = "openbsd"))]
+    #[inline(always)]
     unsafe fn target_get_sp_limit() -> uint {
         1024
     }