Skip to content

Commit 9b0d660

Browse files
committed
---
yaml --- r: 178063 b: refs/heads/auto c: 568a451 h: refs/heads/master i: 178061: c68b020 178059: fc533c3 178055: d63b8d6 178047: 312483e v: v3
1 parent c988e7d commit 9b0d660

File tree

4 files changed

+28
-41
lines changed

4 files changed

+28
-41
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: 3096784a3b1dd7d20bc67f19d4ccd61ae497a7de
13+
refs/heads/auto: 568a451a90a14b101ed357235a5055de2940f16b
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/libstd/sys/common/stack.rs

Lines changed: 17 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -227,24 +227,14 @@ pub unsafe fn record_sp_limit(limit: uint) {
227227
}
228228

229229
// aarch64 - FIXME(AARCH64): missing...
230-
#[cfg(target_arch = "aarch64")]
231-
unsafe fn target_record_sp_limit(_: uint) {
232-
}
233-
234230
// powerpc - FIXME(POWERPC): missing...
235-
#[cfg(target_arch = "powerpc")]
236-
unsafe fn target_record_sp_limit(_: uint) {
237-
}
238-
239-
240-
// iOS segmented stack is disabled for now, see related notes
241-
#[cfg(all(target_arch = "arm", target_os = "ios"))] #[inline(always)]
242-
unsafe fn target_record_sp_limit(_: uint) {
243-
}
244-
245-
#[cfg(target_os = "openbsd")] #[inline(always)]
231+
// arm-ios - iOS segmented stack is disabled for now, see related notes
232+
// openbsd - segmented stack is disabled
233+
#[cfg(any(target_arch = "aarch64",
234+
target_arch = "powerpc",
235+
all(target_arch = "arm", target_os = "ios"),
236+
target_os = "openbsd"))]
246237
unsafe fn target_record_sp_limit(_: uint) {
247-
// segmented stack is disabled
248238
}
249239
}
250240

@@ -332,28 +322,18 @@ pub unsafe fn get_sp_limit() -> uint {
332322
}
333323

334324
// aarch64 - FIXME(AARCH64): missing...
335-
#[cfg(target_arch = "aarch64")]
336-
unsafe fn target_get_sp_limit() -> uint {
337-
1024
338-
}
339-
340-
// powepc - FIXME(POWERPC): missing...
341-
#[cfg(target_arch = "powerpc")]
342-
unsafe fn target_get_sp_limit() -> uint {
343-
1024
344-
}
345-
346-
// iOS doesn't support segmented stacks yet. This function might
347-
// be called by runtime though so it is unsafe to mark it as
348-
// unreachable, let's return a fixed constant.
349-
#[cfg(all(target_arch = "arm", target_os = "ios"))] #[inline(always)]
350-
unsafe fn target_get_sp_limit() -> uint {
351-
1024
352-
}
353-
354-
#[cfg(target_os = "openbsd")] #[inline(always)]
325+
// powerpc - FIXME(POWERPC): missing...
326+
// arm-ios - iOS doesn't support segmented stacks yet.
327+
// openbsd - OpenBSD doesn't support segmented stacks.
328+
//
329+
// This function might be called by runtime though
330+
// so it is unsafe to unreachable, let's return a fixed constant.
331+
#[cfg(any(target_arch = "aarch64",
332+
target_arch = "powerpc",
333+
all(target_arch = "arm", target_os = "ios"),
334+
target_os = "openbsd"))]
335+
#[inline(always)]
355336
unsafe fn target_get_sp_limit() -> uint {
356-
// segmented stack is disabled
357337
1024
358338
}
359339
}

branches/auto/src/libstd/sys/unix/os.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,18 @@ pub fn load_self() -> Option<Vec<u8>> {
217217

218218
#[cfg(target_os = "openbsd")]
219219
pub fn load_self() -> Option<Vec<u8>> {
220+
use sync::{StaticMutex, MUTEX_INIT};
221+
222+
static LOCK: StaticMutex = MUTEX_INIT;
223+
220224
extern {
221-
fn __load_self() -> *const c_char;
225+
fn rust_load_self() -> *const c_char;
222226
}
227+
228+
let _guard = LOCK.lock();
229+
223230
unsafe {
224-
let v = __load_self();
231+
let v = rust_load_self();
225232
if v.is_null() {
226233
None
227234
} else {

branches/auto/src/rt/rust_builtin.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ int *__dfly_error(void) { return __error(); }
204204
#include <sys/sysctl.h>
205205
#include <limits.h>
206206

207-
const char * __load_self() {
207+
const char * rust_load_self() {
208208
static char *self = NULL;
209209

210210
if (self == NULL) {

0 commit comments

Comments
 (0)