Skip to content

Commit 79430d7

Browse files
committed
---
yaml --- r: 107246 b: refs/heads/dist-snap c: 6ea218d h: refs/heads/master v: v3
1 parent 709be0f commit 79430d7

File tree

17 files changed

+161
-164
lines changed

17 files changed

+161
-164
lines changed

[refs]

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

branches/dist-snap/configure

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -782,11 +782,6 @@ do
782782
# target lib dir
783783
make_dir $h/stage$i/$LIBDIR_RELATIVE/$CFG_RUSTLIBDIR/$t/lib
784784
done
785-
786-
# Fix stage0:
787-
make_dir $h/stage0/$LIBDIR_RELATIVE/rustc/$t/bin
788-
make_dir $h/stage0/$LIBDIR_RELATIVE/rustc/$t/$LIBDIR_RELATIVE
789-
790785
done
791786

792787
make_dir $h/test/run-pass

branches/dist-snap/mk/target.mk

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -54,25 +54,14 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_RUNTIME_$(2)): \
5454
@$$(call E, cp: $$@)
5555
$$(Q)cp $$< $$@
5656

57-
# SNAP a5fa1d9 remove this after the stage0 snapshot from rules below
58-
ifeq ($(1),0)
59-
ifeq ($(3),$$(findstring $(3),$$(NON_BUILD_HOST)))
60-
LFLAGS_$(1)_$(2)_$(3) :=
61-
else
62-
LFLAGS_$(1)_$(2)_$(3) := -L $$(TLIB$(1)_T_$(2)_H_$(3))
63-
endif
64-
else
65-
LFLAGS_$(1)_$(2)_$(3) :=
66-
endif
67-
6857
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_STDLIB_$(2)): \
6958
$$(STDLIB_CRATE) $$(STDLIB_INPUTS) \
7059
$$(TSREQ$(1)_T_$(2)_H_$(3)) \
7160
| $$(TLIB$(1)_T_$(2)_H_$(3))/
7261
@$$(call E, compile_and_link: $$@)
7362
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(STDLIB_GLOB_$(2)),$$(notdir $$@))
7463
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(STDLIB_RGLOB_$(2)),$$(notdir $$@))
75-
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) $$(LFLAGS_$(1)_$(2)_$(3)) \
64+
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) \
7665
--out-dir $$(@D) $$< && touch $$@
7766
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(STDLIB_GLOB_$(2)),$$(notdir $$@))
7867
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(STDLIB_RGLOB_$(2)),$$(notdir $$@))
@@ -85,7 +74,7 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_EXTRALIB_$(2)): \
8574
@$$(call E, compile_and_link: $$@)
8675
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(EXTRALIB_GLOB_$(2)),$$(notdir $$@))
8776
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(EXTRALIB_RGLOB_$(2)),$$(notdir $$@))
88-
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) $$(LFLAGS_$(1)_$(2)_$(3)) \
77+
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) \
8978
--out-dir $$(@D) $$< && touch $$@
9079
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(EXTRALIB_GLOB_$(2)),$$(notdir $$@))
9180
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(EXTRALIB_RGLOB_$(2)),$$(notdir $$@))
@@ -103,7 +92,6 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBRUSTUV_$(2)): \
10392
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) \
10493
-L $$(UV_SUPPORT_DIR_$(2)) \
10594
-L $$(dir $$(LIBUV_LIB_$(2))) \
106-
$$(LFLAGS_$(1)_$(2)_$(3)) \
10795
--out-dir $$(@D) $$< && touch $$@
10896
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTUV_GLOB_$(2)),$$(notdir $$@))
10997
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTUV_RGLOB_$(2)),$$(notdir $$@))
@@ -117,7 +105,6 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBGREEN_$(2)): \
117105
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBGREEN_GLOB_$(2)),$$(notdir $$@))
118106
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBGREEN_RGLOB_$(2)),$$(notdir $$@))
119107
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) \
120-
$$(LFLAGS_$(1)_$(2)_$(3)) \
121108
--out-dir $$(@D) $$< && touch $$@
122109
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBGREEN_GLOB_$(2)),$$(notdir $$@))
123110
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBGREEN_RGLOB_$(2)),$$(notdir $$@))
@@ -131,7 +118,6 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBNATIVE_$(2)): \
131118
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBNATIVE_GLOB_$(2)),$$(notdir $$@))
132119
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBNATIVE_RGLOB_$(2)),$$(notdir $$@))
133120
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) \
134-
$$(LFLAGS_$(1)_$(2)_$(3)) \
135121
--out-dir $$(@D) $$< && touch $$@
136122
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBNATIVE_GLOB_$(2)),$$(notdir $$@))
137123
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBNATIVE_RGLOB_$(2)),$$(notdir $$@))
@@ -146,7 +132,6 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBSYNTAX_$(3)): \
146132
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBSYNTAX_GLOB_$(2)),$$(notdir $$@))
147133
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBSYNTAX_RGLOB_$(2)),$$(notdir $$@))
148134
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) $(BORROWCK) \
149-
$$(LFLAGS_$(1)_$(2)_$(3)) \
150135
--out-dir $$(@D) $$< && touch $$@
151136
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBSYNTAX_GLOB_$(2)),$$(notdir $$@))
152137
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBSYNTAX_RGLOB_$(2)),$$(notdir $$@))
@@ -174,7 +159,6 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBRUSTC_$(3)): \
174159
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTC_RGLOB_$(2)),$$(notdir $$@))
175160
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) \
176161
-L "$$(LLVM_LIBDIR_$(2))" \
177-
$$(LFLAGS_$(1)_$(2)_$(3)) \
178162
--out-dir $$(@D) $$< && touch $$@
179163
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTC_GLOB_$(2)),$$(notdir $$@))
180164
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTC_RGLOB_$(2)),$$(notdir $$@))
@@ -185,8 +169,7 @@ $$(TBIN$(1)_T_$(2)_H_$(3))/rustc$$(X_$(3)): \
185169
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBRUSTC_$(3)) \
186170
| $$(TBIN$(1)_T_$(2)_H_$(3))/
187171
@$$(call E, compile_and_link: $$@)
188-
$$(STAGE$(1)_T_$(2)_H_$(3)) --cfg rustc -o $$@ $$< \
189-
$$(LFLAGS_$(1)_$(2)_$(3))
172+
$$(STAGE$(1)_T_$(2)_H_$(3)) --cfg rustc -o $$@ $$<
190173
ifdef CFG_ENABLE_PAX_FLAGS
191174
@$$(call E, apply PaX flags: $$@)
192175
@"$(CFG_PAXCTL)" -cm "$$@"

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,14 +406,14 @@ impl<S:Encoder,T:Encodable<S>> Encodable<S> for @T {
406406
}
407407
}
408408

409-
impl<S:Encoder,T:Encodable<S> + Freeze> Encodable<S> for Rc<T> {
409+
impl<S:Encoder,T:Encodable<S>> Encodable<S> for Rc<T> {
410410
#[inline]
411411
fn encode(&self, s: &mut S) {
412412
self.borrow().encode(s)
413413
}
414414
}
415415

416-
impl<D:Decoder,T:Decodable<D> + Freeze> Decodable<D> for Rc<T> {
416+
impl<D:Decoder,T:Decodable<D>> Decodable<D> for Rc<T> {
417417
#[inline]
418418
fn decode(d: &mut D) -> Rc<T> {
419419
Rc::new(Decodable::decode(d))

branches/dist-snap/src/libgreen/simple.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ impl Runtime for SimpleTask {
7575
fail!()
7676
}
7777
fn local_io<'a>(&'a mut self) -> Option<rtio::LocalIo<'a>> { None }
78-
fn stack_bounds(&self) -> Option<(uint, uint)> { None }
78+
fn stack_bounds(&self) -> (uint, uint) { fail!() }
7979
fn wrap(~self) -> ~Any { fail!() }
8080
}
8181

branches/dist-snap/src/libgreen/task.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -454,11 +454,12 @@ impl Runtime for GreenTask {
454454
}
455455
}
456456

457-
fn stack_bounds(&self) -> Option<(uint, uint)> {
458-
self.coroutine.as_ref().map(|c| {
459-
(c.current_stack_segment.start() as uint,
460-
c.current_stack_segment.end() as uint)
461-
})
457+
fn stack_bounds(&self) -> (uint, uint) {
458+
let c = self.coroutine.as_ref()
459+
.expect("GreenTask.stack_bounds called without a coroutine");
460+
461+
(c.current_stack_segment.start() as uint,
462+
c.current_stack_segment.end() as uint)
462463
}
463464

464465
fn wrap(~self) -> ~Any { self as ~Any }

branches/dist-snap/src/libnative/lib.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ mod bookeeping;
3333
pub mod io;
3434
pub mod task;
3535

36+
#[cfg(windows)]
37+
#[cfg(android)]
38+
static OS_DEFAULT_STACK_ESTIMATE: uint = 1 << 20;
39+
#[cfg(unix, not(android))]
40+
static OS_DEFAULT_STACK_ESTIMATE: uint = 2 * (1 << 20);
41+
42+
3643
// XXX: this should not exist here
3744
#[cfg(stage0, nativestart)]
3845
#[lang = "start"]
@@ -66,10 +73,19 @@ pub fn lang_start(main: *u8, argc: int, argv: **u8) -> int {
6673
/// This function will only return once *all* native threads in the system have
6774
/// exited.
6875
pub fn start(argc: int, argv: **u8, main: proc()) -> int {
76+
let something_around_the_top_of_the_stack = 1;
77+
let addr = &something_around_the_top_of_the_stack as *int;
78+
let my_stack_top = addr as uint;
79+
80+
// FIXME #11359 we just assume that this thread has a stack of a
81+
// certain size, and estimate that there's at most 20KB of stack
82+
// frames above our current position.
83+
let my_stack_bottom = my_stack_top + 20000 - OS_DEFAULT_STACK_ESTIMATE;
84+
6985
rt::init(argc, argv);
7086
let mut exit_code = None;
7187
let mut main = Some(main);
72-
task::new().run(|| {
88+
task::new((my_stack_bottom, my_stack_top)).run(|| {
7389
exit_code = Some(run(main.take_unwrap()));
7490
});
7591
unsafe { rt::cleanup(); }

branches/dist-snap/src/libnative/task.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ use task;
3030
use bookeeping;
3131

3232
/// Creates a new Task which is ready to execute as a 1:1 task.
33-
pub fn new() -> ~Task {
33+
pub fn new(stack_bounds: (uint, uint)) -> ~Task {
3434
let mut task = ~Task::new();
35-
task.put_runtime(ops() as ~rt::Runtime);
35+
let mut ops = ops();
36+
ops.stack_bounds = stack_bounds;
37+
task.put_runtime(ops as ~rt::Runtime);
3638
return task;
3739
}
3840

@@ -41,7 +43,8 @@ fn ops() -> ~Ops {
4143
lock: unsafe { Mutex::new() },
4244
awoken: false,
4345
io: io::IoFactory::new(),
44-
stack_bounds: None,
46+
// these *should* get overwritten
47+
stack_bounds: (0, 0),
4548
}
4649
}
4750

@@ -95,7 +98,7 @@ pub fn spawn_opts(opts: TaskOpts, f: proc()) {
9598
stack::record_stack_bounds(my_stack - stack + 1024, my_stack);
9699
}
97100
let mut ops = ops;
98-
ops.stack_bounds = Some((my_stack - stack + 1024, my_stack));
101+
ops.stack_bounds = (my_stack - stack + 1024, my_stack);
99102

100103
let mut f = Some(f);
101104
let mut task = task;
@@ -115,7 +118,7 @@ struct Ops {
115118
// This field holds the known bounds of the stack in (lo, hi) form. Not all
116119
// native tasks necessarily know their precise bounds, hence this is
117120
// optional.
118-
stack_bounds: Option<(uint, uint)>,
121+
stack_bounds: (uint, uint),
119122
}
120123

121124
impl rt::Runtime for Ops {
@@ -137,7 +140,7 @@ impl rt::Runtime for Ops {
137140
self as ~Any
138141
}
139142

140-
fn stack_bounds(&self) -> Option<(uint, uint)> { self.stack_bounds }
143+
fn stack_bounds(&self) -> (uint, uint) { self.stack_bounds }
141144

142145
// This function gets a little interesting. There are a few safety and
143146
// ownership violations going on here, but this is all done in the name of

branches/dist-snap/src/librustuv/idle.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ mod test {
127127
}
128128

129129
fn mk(v: uint) -> (~IdleWatcher, Chan) {
130-
let rc = Rc::from_send(RefCell::new((None, 0)));
130+
let rc = Rc::new(RefCell::new((None, 0)));
131131
let cb = ~MyCallback(rc.clone(), v);
132132
let cb = cb as ~Callback:;
133133
let cb = unsafe { cast::transmute(cb) };

branches/dist-snap/src/libstd/option.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ mod tests {
509509
}
510510
}
511511

512-
let i = Rc::from_send(RefCell::new(0));
512+
let i = Rc::new(RefCell::new(0));
513513
{
514514
let x = R(i.clone());
515515
let opt = Some(x);

0 commit comments

Comments
 (0)