about summary refs log tree commit diff
path: root/src/rt/sync
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-04-04 15:36:58 -0700
committerbors <bors@rust-lang.org>2013-04-04 15:36:58 -0700
commitc08fb75dcd656707faf28264e93513da4606ea29 (patch)
tree8ce9bca99a6ebc59b8749fa7329395fa7b5cae94 /src/rt/sync
parent717ed51f123aac1cb25ba710ffacdd7821a577df (diff)
parent4f1d8cb6fce625d13baf12f49e41d29f1433c8dd (diff)
downloadrust-c08fb75dcd656707faf28264e93513da4606ea29.tar.gz
rust-c08fb75dcd656707faf28264e93513da4606ea29.zip
auto merge of #5431 : crabtw/rust/mips-rt, r=brson
Because the PTHREAD_STACK_MIN of my system is larger than default size, I add the stack_sz check to prevent assertion failure.

Besides, libuv has to be modified because some flags are different from other targets. Instead of using hardcoded numbers, I change them to predefined symbols.

By the way, the toolchain I used is http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/mips-gnu-linux

libuv patch: http://people.cs.nctu.edu.tw/~jyyou/rust/mips-uv.patch

Below is the current test result.

* core test

  stackwalk tests can cause segfault so I ignored them.

```
failures:
    io::tests::test_read_be_int_n
    io::tests::test_read_buffer_big_enough
    io::tests::test_read_f32
    io::tests::test_read_write_be
    io::tests::test_read_write_f32
    io::tests::test_read_write_le
    io::tests::test_simple
    io::tests::test_write_empty
    rand::tests::rng_seeded_custom_seed2
    unstable::uvll::test::test_uv_ll_struct_size_addrinfo
    unstable::uvll::test::test_uv_ll_struct_size_uv_timer_t

result: FAILED. 596 passed; 11 failed; 49 ignored
```

* std test:

```
failures:
    time::tests::run_tests

result: FAILED. 330 passed; 1 failed; 21 ignored
```
Diffstat (limited to 'src/rt/sync')
-rw-r--r--src/rt/sync/rust_thread.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/rt/sync/rust_thread.cpp b/src/rt/sync/rust_thread.cpp
index 70fa08d7f2e..824642fc435 100644
--- a/src/rt/sync/rust_thread.cpp
+++ b/src/rt/sync/rust_thread.cpp
@@ -10,6 +10,7 @@
 
 
 #include "rust_thread.h"
+#include <limits.h>
 
 const size_t default_stack_sz = 1024*1024;
 
@@ -41,6 +42,11 @@ rust_thread::start() {
 #if defined(__WIN32__)
    thread = CreateThread(NULL, stack_sz, rust_thread_start, this, 0, NULL);
 #else
+   // PTHREAD_STACK_MIN of some system is larger than default size
+   // so we check stack_sz to prevent assertion failure.
+   if (stack_sz < PTHREAD_STACK_MIN) {
+      stack_sz = PTHREAD_STACK_MIN;
+   }
    pthread_attr_t attr;
    CHECKED(pthread_attr_init(&attr));
    CHECKED(pthread_attr_setstacksize(&attr, stack_sz));