Skip to content

Commit 1756b92

Browse files
committed
---
yaml --- r: 85935 b: refs/heads/dist-snap c: 2b035d9 h: refs/heads/master i: 85933: 8dca8b2 85931: 42fa3f8 85927: 2f905c2 85919: 633d71f v: v3
1 parent 3ccd859 commit 1756b92

File tree

11 files changed

+43
-30
lines changed

11 files changed

+43
-30
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 0983ebe5310d4eb6d289f636f7ed0536c08bbc0e
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 4fea236a85b61b52fc3e16348886ff32f5b8210b
9+
refs/heads/dist-snap: 2b035d908b6d81fea4e8aaabafac9f69d9e20936
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/mk/llvm.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ ifeq ($(CFG_LLVM_ROOT),)
2626

2727
$$(LLVM_CONFIG_$(1)): $$(LLVM_DEPS)
2828
@$$(call E, make: llvm)
29-
$$(Q)$$(MAKE) -C $$(CFG_LLVM_BUILD_DIR_$(1))
29+
$$(Q)$$(MAKE) -C $$(CFG_LLVM_BUILD_DIR_$(1)) $$(CFG_LLVM_BUILD_ENV)
3030
$$(Q)touch $$(LLVM_CONFIG_$(1))
3131
endif
3232

branches/dist-snap/mk/platform.mk

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ endef
2626
$(foreach t,$(CFG_TARGET_TRIPLES),$(eval $(call DEF_OSTYPE_VAR,$(t))))
2727
$(foreach t,$(CFG_TARGET_TRIPLES),$(info cfg: os for $(t) is $(OSTYPE_$(t))))
2828

29-
CFG_GCCISH_CFLAGS += -DUSE_UTF8
29+
# FIXME: no-omit-frame-pointer is just so that task_start_wrapper
30+
# has a frame pointer and the stack walker can understand it. Turning off
31+
# frame pointers everywhere is overkill
32+
CFG_GCCISH_CFLAGS += -fno-omit-frame-pointer -DUSE_UTF8
3033

3134
# On Darwin, we need to run dsymutil so the debugging information ends
3235
# up in the right place. On other platforms, it automatically gets
@@ -150,6 +153,7 @@ CFG_GCCISH_POST_LIB_FLAGS_x86_64-unknown-linux-gnu := -Wl,-no-whole-archive
150153
CFG_DEF_SUFFIX_x86_64-unknown-linux-gnu := .linux.def
151154
CFG_INSTALL_NAME_x86_64-unknown-linux-gnu =
152155
CFG_LIBUV_LINK_FLAGS_x86_64-unknown-linux-gnu =
156+
CFG_LLVM_BUILD_ENV_x86_64-unknown-linux-gnu="CXXFLAGS=-fno-omit-frame-pointer"
153157
CFG_EXE_SUFFIX_x86_64-unknown-linux-gnu =
154158
CFG_WINDOWSY_x86_64-unknown-linux-gnu :=
155159
CFG_UNIXY_x86_64-unknown-linux-gnu := 1
@@ -175,6 +179,7 @@ CFG_GCCISH_POST_LIB_FLAGS_i686-unknown-linux-gnu := -Wl,-no-whole-archive
175179
CFG_DEF_SUFFIX_i686-unknown-linux-gnu := .linux.def
176180
CFG_INSTALL_NAME_i686-unknown-linux-gnu =
177181
CFG_LIBUV_LINK_FLAGS_i686-unknown-linux-gnu =
182+
CFG_LLVM_BUILD_ENV_i686-unknown-linux-gnu="CXXFLAGS=-fno-omit-frame-pointer"
178183
CFG_EXE_SUFFIX_i686-unknown-linux-gnu =
179184
CFG_WINDOWSY_i686-unknown-linux-gnu :=
180185
CFG_UNIXY_i686-unknown-linux-gnu := 1

branches/dist-snap/src/libextra/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ fn get_concurrency() -> uint {
745745
let opt_n: Option<uint> = FromStr::from_str(s);
746746
match opt_n {
747747
Some(n) if n > 0 => n,
748-
_ => fail!("RUST_TEST_TASKS is `%s`, should be a positive integer.", s)
748+
_ => fail!("RUST_TEST_TASKS is `%s`, should be a non-negative integer.", s)
749749
}
750750
}
751751
None => {

branches/dist-snap/src/libstd/rt/args.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,10 @@ pub fn clone() -> Option<~[~str]> {
5555
mod imp {
5656
use libc;
5757
use option::{Option, Some, None};
58-
use iterator::Iterator;
58+
use iterator::{Iterator, range};
5959
use str;
6060
use unstable::finally::Finally;
6161
use util;
62-
use vec;
6362

6463
pub unsafe fn init(argc: int, argv: **u8) {
6564
let args = load_argc_and_argv(argc, argv);
@@ -112,9 +111,11 @@ mod imp {
112111

113112
// Copied from `os`.
114113
unsafe fn load_argc_and_argv(argc: int, argv: **u8) -> ~[~str] {
115-
do vec::from_fn(argc as uint) |i| {
116-
str::raw::from_c_str(*(argv as **libc::c_char).offset(i as int))
114+
let mut args = ~[];
115+
for i in range(0u, argc as uint) {
116+
args.push(str::raw::from_c_str(*(argv as **libc::c_char).offset(i as int)));
117117
}
118+
args
118119
}
119120

120121
#[cfg(stage0)]

branches/dist-snap/src/libstd/rt/local_ptr.rs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,20 +121,27 @@ pub unsafe fn borrow<T>(f: &fn(&mut T)) {
121121
/// For the Scheduler pointer to be aliased
122122
pub unsafe fn unsafe_borrow<T>() -> *mut T {
123123
let key = tls_key();
124-
let void_ptr = tls::get(key);
124+
let mut void_ptr: *mut c_void = tls::get(key);
125125
if void_ptr.is_null() {
126126
rtabort!("thread-local pointer is null. bogus!");
127127
}
128-
void_ptr as *mut T
128+
let ptr: *mut *mut c_void = &mut void_ptr;
129+
let ptr: *mut ~T = ptr as *mut ~T;
130+
let ptr: *mut T = &mut **ptr;
131+
return ptr;
129132
}
130133

131134
pub unsafe fn try_unsafe_borrow<T>() -> Option<*mut T> {
132135
let key = tls_key();
133-
let void_ptr = tls::get(key);
136+
let mut void_ptr: *mut c_void = tls::get(key);
134137
if void_ptr.is_null() {
135-
None
136-
} else {
137-
Some(void_ptr as *mut T)
138+
return None;
139+
}
140+
{
141+
let ptr: *mut *mut c_void = &mut void_ptr;
142+
let ptr: *mut ~T = ptr as *mut ~T;
143+
let ptr: *mut T = &mut **ptr;
144+
return Some(ptr);
138145
}
139146
}
140147

branches/dist-snap/src/libstd/rt/mod.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Several modules in `core` are clients of `rt`:
5959
use cell::Cell;
6060
use clone::Clone;
6161
use container::Container;
62-
use iterator::Iterator;
62+
use iterator::{Iterator, range};
6363
use option::{Option, None, Some};
6464
use ptr::RawPtr;
6565
use rt::local::Local;
@@ -71,8 +71,7 @@ use rt::work_queue::WorkQueue;
7171
use rt::uv::uvio::UvEventLoop;
7272
use unstable::atomics::{AtomicInt, SeqCst};
7373
use unstable::sync::UnsafeArc;
74-
use vec;
75-
use vec::{OwnedVector, MutableVector, ImmutableVector};
74+
use vec::{OwnedVector, MutableVector};
7675

7776
/// The global (exchange) heap.
7877
pub mod global_heap;
@@ -252,21 +251,25 @@ fn run_(main: ~fn(), use_main_sched: bool) -> int {
252251

253252
// Create a work queue for each scheduler, ntimes. Create an extra
254253
// for the main thread if that flag is set. We won't steal from it.
255-
let work_queues: ~[WorkQueue<~Task>] = vec::from_fn(nscheds, |_| WorkQueue::new());
254+
let mut work_queues = ~[];
255+
for _ in range(0u, nscheds) {
256+
let work_queue: WorkQueue<~Task> = WorkQueue::new();
257+
work_queues.push(work_queue);
258+
}
256259

257260
// The schedulers.
258261
let mut scheds = ~[];
259262
// Handles to the schedulers. When the main task ends these will be
260263
// sent the Shutdown message to terminate the schedulers.
261264
let mut handles = ~[];
262265

263-
for work_queue in work_queues.iter() {
266+
for i in range(0u, nscheds) {
264267
rtdebug!("inserting a regular scheduler");
265268

266269
// Every scheduler is driven by an I/O event loop.
267270
let loop_ = ~UvEventLoop::new();
268271
let mut sched = ~Scheduler::new(loop_,
269-
work_queue.clone(),
272+
work_queues[i].clone(),
270273
work_queues.clone(),
271274
sleepers.clone());
272275
let handle = sched.make_handle();
@@ -355,8 +358,9 @@ fn run_(main: ~fn(), use_main_sched: bool) -> int {
355358
}
356359

357360
// Run each remaining scheduler in a thread.
358-
for sched in scheds.move_rev_iter() {
361+
while !scheds.is_empty() {
359362
rtdebug!("creating regular schedulers");
363+
let sched = scheds.pop();
360364
let sched_cell = Cell::new(sched);
361365
let thread = do Thread::start {
362366
let mut sched = sched_cell.take();

branches/dist-snap/src/libstd/rt/util.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use container::Container;
1212
use from_str::FromStr;
1313
use libc;
14-
use option::{Some, None, Option};
14+
use option::{Some, None};
1515
use os;
1616
use str::StrSlice;
1717
use unstable::atomics::{AtomicInt, INIT_ATOMIC_INT, SeqCst};
@@ -57,13 +57,7 @@ pub fn limit_thread_creation_due_to_osx_and_valgrind() -> bool {
5757
/// either `RUST_THREADS` or `num_cpus`.
5858
pub fn default_sched_threads() -> uint {
5959
match os::getenv("RUST_THREADS") {
60-
Some(nstr) => {
61-
let opt_n: Option<uint> = FromStr::from_str(nstr);
62-
match opt_n {
63-
Some(n) if n > 0 => n,
64-
_ => rtabort!("`RUST_THREADS` is `%s`, should be a positive integer", nstr)
65-
}
66-
}
60+
Some(nstr) => FromStr::from_str(nstr).unwrap(),
6761
None => {
6862
if limit_thread_creation_due_to_osx_and_valgrind() {
6963
1

branches/dist-snap/src/rustllvm/PassWrapper.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ LLVMRustCreateTargetMachine(const char *triple,
7878
}
7979

8080
TargetOptions Options;
81+
Options.NoFramePointerElim = true;
8182
Options.EnableSegmentedStacks = EnableSegmentedStacks;
8283
Options.FixedStackSegmentSize = 2 * 1024 * 1024; // XXX: This is too big.
8384
Options.FloatABIType =

branches/dist-snap/src/rustllvm/RustWrapper.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ LLVMRustBuildJIT(void* mem,
284284
std::string Err;
285285
TargetOptions Options;
286286
Options.JITEmitDebugInfo = true;
287+
Options.NoFramePointerElim = true;
287288
Options.EnableSegmentedStacks = EnableSegmentedStacks;
288289
RustMCJITMemoryManager* MM = (RustMCJITMemoryManager*) mem;
289290
assert(MM);

branches/dist-snap/src/test/run-fail/test-tasks-invalid-value.rs renamed to branches/dist-snap/src/test/run-fail/test-threads-invalid-value.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// This checks that RUST_TEST_TASKS not being 1, 2, ... is detected
1212
// properly.
1313

14-
// error-pattern:should be a positive integer
14+
// error-pattern:should be a non-negative integer
1515
// compile-flags: --test
1616
// exec-env:RUST_TEST_TASKS=foo
1717

0 commit comments

Comments
 (0)