Skip to content

Commit a380f4d

Browse files
committed
---
yaml --- r: 178653 b: refs/heads/snap-stage3 c: 568a451 h: refs/heads/master i: 178651: 6cc3e8b v: v3
1 parent c7035e7 commit a380f4d

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 3d072a193bfcb76206aab576049e696d6d8db25d
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 3096784a3b1dd7d20bc67f19d4ccd61ae497a7de
4+
refs/heads/snap-stage3: 568a451a90a14b101ed357235a5055de2940f16b
55
refs/heads/try: ccf8fedf1cffcb8f6f3581d53d220039e192fe77
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/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/snap-stage3/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/snap-stage3/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)