Skip to content

Commit c561e84

Browse files
committed
---
yaml --- r: 89918 b: refs/heads/master c: 500a8f1 h: refs/heads/master v: v3
1 parent f69cae8 commit c561e84

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+868
-826
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: f5f5d5aac762a554850d291165536ba752260303
2+
refs/heads/master: 500a8f15c9afdd4e98e1d1573e34dd2b948f9773
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
55
refs/heads/try: b160761e35efcd1207112b3b782c06633cf441a8

trunk/mk/clean.mk

Lines changed: 17 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,13 @@
1212
# Cleanup
1313
######################################################################
1414

15-
CLEAN_STAGE_RULES := \
16-
$(foreach stage, $(STAGES), \
17-
$(foreach host, $(CFG_HOST), \
15+
CLEAN_STAGE_RULES = \
16+
$(foreach stage, $(STAGES), \
17+
$(foreach host, $(CFG_HOST), \
1818
clean$(stage)_H_$(host) \
19-
$(foreach target, $(CFG_TARGET), \
19+
$(foreach target, $(CFG_TARGET), \
2020
clean$(stage)_T_$(target)_H_$(host))))
2121

22-
CLEAN_STAGE_RULES := $(CLEAN_STAGE_RULES) \
23-
$(foreach host, $(CFG_HOST), clean-generic-H-$(host))
24-
25-
CLEAN_STAGE_RULES := $(CLEAN_STAGE_RULES) \
26-
$(foreach host, $(CFG_TARGET), clean-generic-T-$(host))
27-
2822
CLEAN_LLVM_RULES = \
2923
$(foreach target, $(CFG_HOST), \
3024
clean-llvm$(target))
@@ -39,6 +33,19 @@ clean: clean-misc $(CLEAN_STAGE_RULES)
3933

4034
clean-misc:
4135
@$(call E, cleaning)
36+
$(Q)find $(CFG_BUILD)/rustllvm \
37+
$(CFG_BUILD)/rt \
38+
$(CFG_BUILD)/test \
39+
-name '*.[odasS]' -o \
40+
-name '*.so' -o \
41+
-name '*.dylib' -o \
42+
-name '*.dll' -o \
43+
-name '*.def' -o \
44+
-name '*.bc' \
45+
| xargs rm -f
46+
$(Q)find $(CFG_BUILD)\
47+
-name '*.dSYM' \
48+
| xargs rm -Rf
4249
$(Q)rm -f $(RUNTIME_OBJS) $(RUNTIME_DEF)
4350
$(Q)rm -f $(RUSTLLVM_LIB_OBJS) $(RUSTLLVM_OBJS_OBJS) $(RUSTLLVM_DEF)
4451
$(Q)rm -Rf $(DOCS)
@@ -53,27 +60,6 @@ clean-misc:
5360
$(Q)rm -Rf $(foreach sub, index styles files search javascript, \
5461
$(wildcard doc/*/$(sub)))
5562

56-
define CLEAN_GENERIC
57-
58-
clean-generic-$(2)-$(1):
59-
$(Q)find $(1)/rustllvm \
60-
$(1)/rt \
61-
$(1)/test \
62-
-name '*.[odasS]' -o \
63-
-name '*.so' -o \
64-
-name '*.dylib' -o \
65-
-name '*.dll' -o \
66-
-name '*.def' -o \
67-
-name '*.bc' \
68-
| xargs rm -f
69-
$(Q)find $(1)\
70-
-name '*.dSYM' \
71-
| xargs rm -Rf
72-
endef
73-
74-
$(foreach host, $(CFG_HOST), $(eval $(call CLEAN_GENERIC,$(host),H)))
75-
$(foreach targ, $(CFG_TARGET), $(eval $(call CLEAN_GENERIC,$(targ),T)))
76-
7763
define CLEAN_HOST_STAGE_N
7864

7965
clean$(1)_H_$(2):

trunk/mk/platform.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ CFG_LIB_GLOB_arm-apple-darwin = lib$(1)-*.dylib
206206
CFG_LIB_DSYM_GLOB_arm-apple-darwin = lib$(1)-*.dylib.dSYM
207207
CFG_GCCISH_CFLAGS_arm-apple-darwin := -Wall -Werror -g -fPIC $(CFG_IOS_FLAGS)
208208
CFG_GCCISH_CXXFLAGS_arm-apple-darwin := -fno-rtti $(CFG_IOS_FLAGS)
209-
CFG_GCCISH_LINK_FLAGS_arm-apple-darwin := -dynamiclib -lpthread -framework CoreServices -Wl,-no_compact_unwind
209+
CFG_GCCISH_LINK_FLAGS_arm-apple-darwin := -dynamiclib -lpthread -framework CoreServices -Wl,-no_compact_unwind
210210
CFG_GCCISH_DEF_FLAG_arm-apple-darwin := -Wl,-exported_symbols_list,
211211
CFG_GCCISH_PRE_LIB_FLAGS_arm-apple-darwin :=
212212
CFG_GCCISH_POST_LIB_FLAGS_arm-apple-darwin :=
@@ -506,7 +506,7 @@ define CFG_MAKE_TOOLCHAIN
506506
-c -o $$(1) $$(2)
507507
CFG_LINK_C_$(1) = $$(CC_$(1)) \
508508
$$(CFG_GCCISH_LINK_FLAGS) -o $$(1) \
509-
$$(CFG_GCCISH_LINK_FLAGS_$(1)) \
509+
$$(CFG_GCCISH_LINK_FLAGS_$(1))) \
510510
$$(CFG_GCCISH_DEF_FLAG_$(1))$$(3) $$(2) \
511511
$$(call CFG_INSTALL_NAME_$(1),$$(4))
512512
CFG_COMPILE_CXX_$(1) = $$(CXX_$(1)) \

trunk/mk/rt.mk

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,14 @@ endif
9090
endif
9191

9292
RUNTIME_CXXS_$(1)_$(2) := \
93-
rt/rust_cxx_glue.cpp
93+
rt/sync/lock_and_signal.cpp \
94+
rt/rust_builtin.cpp \
95+
rt/rust_upcall.cpp \
96+
rt/miniz.cpp \
97+
rt/rust_android_dummy.cpp \
98+
rt/rust_test_helpers.cpp
9499

95-
RUNTIME_CS_$(1)_$(2) := \
96-
rt/rust_builtin.c \
97-
rt/rust_upcall.c \
98-
rt/miniz.c \
99-
rt/rust_android_dummy.c \
100-
rt/rust_test_helpers.c
101-
102-
# stage0 remove this after the next snapshot
103-
%.cpp:
104-
@touch tmp/foo.o
100+
RUNTIME_CS_$(1)_$(2) :=
105101

106102
RUNTIME_S_$(1)_$(2) := rt/arch/$$(HOST_$(1))/_context.S \
107103
rt/arch/$$(HOST_$(1))/record_sp.S
@@ -119,7 +115,7 @@ ALL_OBJ_FILES += $$(RUNTIME_OBJS_$(1)_$(2))
119115
MORESTACK_OBJS_$(1)_$(2) := $$(RT_BUILD_DIR_$(1)_$(2))/arch/$$(HOST_$(1))/morestack.o
120116
ALL_OBJ_FILES += $$(MORESTACK_OBJS_$(1)_$(2))
121117

122-
$$(RT_BUILD_DIR_$(1)_$(2))/rust_cxx_glue.o: rt/rust_cxx_glue.cpp $$(MKFILE_DEPS)
118+
$$(RT_BUILD_DIR_$(1)_$(2))/%.o: rt/%.cpp $$(MKFILE_DEPS)
123119
@$$(call E, compile: $$@)
124120
$$(Q)$$(call CFG_COMPILE_CXX_$(1), $$@, $$(RUNTIME_INCS_$(1)_$(2)) \
125121
$$(SNAP_DEFINES) $$(RUNTIME_CXXFLAGS_$(1)_$(2))) $$<
@@ -246,13 +242,13 @@ endif
246242
UV_SUPPORT_NAME_$(1) := $$(call CFG_STATIC_LIB_NAME_$(1),uv_support)
247243
UV_SUPPORT_DIR_$(1) := $$(RT_OUTPUT_DIR_$(1))/uv_support
248244
UV_SUPPORT_LIB_$(1) := $$(UV_SUPPORT_DIR_$(1))/$$(UV_SUPPORT_NAME_$(1))
249-
UV_SUPPORT_CS_$(1) := rt/rust_uv.c
250-
UV_SUPPORT_OBJS_$(1) := $$(UV_SUPPORT_CS_$(1):rt/%.c=$$(UV_SUPPORT_DIR_$(1))/%.o)
245+
UV_SUPPORT_CS_$(1) := rt/rust_uv.cpp
246+
UV_SUPPORT_OBJS_$(1) := $$(UV_SUPPORT_CS_$(1):rt/%.cpp=$$(UV_SUPPORT_DIR_$(1))/%.o)
251247

252-
$$(UV_SUPPORT_DIR_$(1))/%.o: rt/%.c
248+
$$(UV_SUPPORT_DIR_$(1))/%.o: rt/%.cpp
253249
@$$(call E, compile: $$@)
254250
@mkdir -p $$(@D)
255-
$$(Q)$$(call CFG_COMPILE_C_$(1), $$@, \
251+
$$(Q)$$(call CFG_COMPILE_CXX_$(1), $$@, \
256252
-I $$(S)src/libuv/include \
257253
$$(RUNTIME_CFLAGS_$(1))) $$<
258254

trunk/src/etc/adb_run_wrapper.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
# Sometimes android shell produce exitcode "1 : Text File Busy"
66
# Retry after $WAIT seconds, expecting resource cleaned-up
77
WAIT=10
8-
TEST_PATH=$1
9-
BIN_PATH=/system/bin
10-
if [ -d "$TEST_PATH" ]
8+
PATH=$1
9+
if [ -d "$PATH" ]
1110
then
1211
shift
1312
RUN=$1
@@ -18,10 +17,10 @@ then
1817

1918
L_RET=1
2019
L_COUNT=0
21-
cd $TEST_PATH
20+
cd $PATH
2221
while [ $L_RET -eq 1 ]
2322
do
24-
TEST_EXEC_ENV=22 LD_LIBRARY_PATH=$TEST_PATH PATH=$BIN_PATH:$TEST_PATH $TEST_PATH/$RUN $@ 1>$TEST_PATH/$RUN.stdout 2>$TEST_PATH/$RUN.stderr
23+
TEST_EXEC_ENV=22 LD_LIBRARY_PATH=$PATH $PATH/$RUN $@ 1>$PATH/$RUN.stdout 2>$PATH/$RUN.stderr
2524
L_RET=$?
2625
if [ $L_COUNT -gt 0 ]
2726
then
@@ -31,7 +30,7 @@ then
3130
L_COUNT=$((L_COUNT+1))
3231
done
3332

34-
echo $L_RET > $TEST_PATH/$RUN.exitcode
33+
echo $L_RET > $PATH/$RUN.exitcode
3534

3635
fi
3736
fi

trunk/src/libextra/time.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ pub mod rustrt {
2121
use super::Tm;
2222

2323
extern {
24-
pub fn rust_get_time(sec: &mut i64, nsec: &mut i32);
25-
pub fn rust_precise_time_ns(ns: &mut u64);
24+
pub fn get_time(sec: &mut i64, nsec: &mut i32);
25+
pub fn precise_time_ns(ns: &mut u64);
2626
pub fn rust_tzset();
2727
pub fn rust_gmtime(sec: i64, nsec: i32, result: &mut Tm);
2828
pub fn rust_localtime(sec: i64, nsec: i32, result: &mut Tm);
@@ -66,7 +66,7 @@ pub fn get_time() -> Timespec {
6666
unsafe {
6767
let mut sec = 0i64;
6868
let mut nsec = 0i32;
69-
rustrt::rust_get_time(&mut sec, &mut nsec);
69+
rustrt::get_time(&mut sec, &mut nsec);
7070
return Timespec::new(sec, nsec);
7171
}
7272
}
@@ -79,7 +79,7 @@ pub fn get_time() -> Timespec {
7979
pub fn precise_time_ns() -> u64 {
8080
unsafe {
8181
let mut ns = 0u64;
82-
rustrt::rust_precise_time_ns(&mut ns);
82+
rustrt::precise_time_ns(&mut ns);
8383
ns
8484
}
8585
}

trunk/src/libextra/workcache.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,6 @@ impl<'self, T:Send +
477477

478478

479479
#[test]
480-
#[cfg(not(target_os="android"))] // FIXME(#10455)
481480
fn test() {
482481
use std::{os, run};
483482
use std::io::fs;

trunk/src/libstd/io/net/unix.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ mod tests {
157157
use io::*;
158158
use rt::comm::oneshot;
159159

160-
fn smalltest(server: ~fn(UnixStream), client: ~fn(UnixStream)) {
160+
fn smalltest(server: proc(UnixStream), client: proc(UnixStream)) {
161161
let server = Cell::new(server);
162162
let client = Cell::new(client);
163163
do run_in_mt_newsched_task {

trunk/src/libstd/os.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,19 +138,21 @@ Accessing environment variables is not generally threadsafe.
138138
Serialize access through a global lock.
139139
*/
140140
fn with_env_lock<T>(f: &fn() -> T) -> T {
141-
use unstable::mutex::{Mutex, MUTEX_INIT};
142141
use unstable::finally::Finally;
143142

144-
static mut lock: Mutex = MUTEX_INIT;
145-
146143
unsafe {
147144
return do (|| {
148-
lock.lock();
145+
rust_take_env_lock();
149146
f()
150147
}).finally {
151-
lock.unlock();
148+
rust_drop_env_lock();
152149
};
153150
}
151+
152+
extern {
153+
fn rust_take_env_lock();
154+
fn rust_drop_env_lock();
155+
}
154156
}
155157

156158
/// Returns a vector of (variable, value) pairs for all the environment

trunk/src/libstd/reflect.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,11 +478,11 @@ impl<V:TyVisitor + MovePtr> TyVisitor for MovePtrAdaptor<V> {
478478
}
479479

480480
fn visit_closure_ptr(&mut self, ck: uint) -> bool {
481-
self.align_to::<~fn()>();
481+
self.align_to::<proc()>();
482482
if ! self.inner.visit_closure_ptr(ck) {
483483
return false
484484
}
485-
self.bump_past::<~fn()>();
485+
self.bump_past::<proc()>();
486486
true
487487
}
488488
}

trunk/src/libstd/rt/args.rs

Lines changed: 22 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -21,60 +21,46 @@
2121
//! FIXME #7756: This has a lot of C glue for lack of globals.
2222
2323
use option::Option;
24-
#[cfg(test)] use option::{Some, None};
25-
#[cfg(test)] use realstd;
26-
#[cfg(test)] use realargs = realstd::rt::args;
2724

2825
/// One-time global initialization.
29-
#[cfg(not(test))]
30-
pub unsafe fn init(argc: int, argv: **u8) { imp::init(argc, argv) }
31-
#[cfg(test)]
32-
pub unsafe fn init(argc: int, argv: **u8) { realargs::init(argc, argv) }
26+
pub unsafe fn init(argc: int, argv: **u8) {
27+
imp::init(argc, argv)
28+
}
3329

3430
/// One-time global cleanup.
35-
#[cfg(not(test))] pub fn cleanup() { imp::cleanup() }
36-
#[cfg(test)] pub fn cleanup() { realargs::cleanup() }
31+
pub fn cleanup() {
32+
imp::cleanup()
33+
}
3734

3835
/// Take the global arguments from global storage.
39-
#[cfg(not(test))] pub fn take() -> Option<~[~str]> { imp::take() }
40-
#[cfg(test)] pub fn take() -> Option<~[~str]> {
41-
match realargs::take() {
42-
realstd::option::Some(a) => Some(a),
43-
realstd::option::None => None,
44-
}
36+
pub fn take() -> Option<~[~str]> {
37+
imp::take()
4538
}
4639

4740
/// Give the global arguments to global storage.
4841
///
4942
/// It is an error if the arguments already exist.
50-
#[cfg(not(test))] pub fn put(args: ~[~str]) { imp::put(args) }
51-
#[cfg(test)] pub fn put(args: ~[~str]) { realargs::put(args) }
43+
pub fn put(args: ~[~str]) {
44+
imp::put(args)
45+
}
5246

5347
/// Make a clone of the global arguments.
54-
#[cfg(not(test))] pub fn clone() -> Option<~[~str]> { imp::clone() }
55-
#[cfg(test)] pub fn clone() -> Option<~[~str]> {
56-
match realargs::clone() {
57-
realstd::option::Some(a) => Some(a),
58-
realstd::option::None => None,
59-
}
48+
pub fn clone() -> Option<~[~str]> {
49+
imp::clone()
6050
}
6151

6252
#[cfg(target_os = "linux")]
6353
#[cfg(target_os = "android")]
6454
#[cfg(target_os = "freebsd")]
6555
mod imp {
66-
use cast;
6756
use libc;
6857
use option::{Option, Some, None};
6958
use iter::Iterator;
7059
use str;
7160
use unstable::finally::Finally;
72-
use unstable::mutex::{Mutex, MUTEX_INIT};
7361
use util;
7462
use vec;
7563

76-
static mut global_args_ptr: uint = 0;
77-
7864
pub unsafe fn init(argc: int, argv: **u8) {
7965
let args = load_argc_and_argv(argc, argv);
8066
put(args);
@@ -108,22 +94,20 @@ mod imp {
10894
}
10995

11096
fn with_lock<T>(f: &fn() -> T) -> T {
111-
static mut lock: Mutex = MUTEX_INIT;
112-
11397
do (|| {
11498
unsafe {
115-
lock.lock();
99+
rust_take_global_args_lock();
116100
f()
117101
}
118102
}).finally {
119103
unsafe {
120-
lock.unlock();
104+
rust_drop_global_args_lock();
121105
}
122106
}
123107
}
124108

125109
fn get_global_ptr() -> *mut Option<~~[~str]> {
126-
unsafe { cast::transmute(&global_args_ptr) }
110+
unsafe { rust_get_global_args_ptr() }
127111
}
128112

129113
// Copied from `os`.
@@ -133,6 +117,12 @@ mod imp {
133117
}
134118
}
135119

120+
extern {
121+
fn rust_take_global_args_lock();
122+
fn rust_drop_global_args_lock();
123+
fn rust_get_global_args_ptr() -> *mut Option<~~[~str]>;
124+
}
125+
136126
#[cfg(test)]
137127
mod tests {
138128
use option::{Some, None};

trunk/src/libstd/rt/basic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,11 @@ impl Drop for BasicPausible {
241241

242242
fn time() -> Time {
243243
extern {
244-
fn rust_get_time(sec: &mut i64, nsec: &mut i32);
244+
fn get_time(sec: &mut i64, nsec: &mut i32);
245245
}
246246
let mut sec = 0;
247247
let mut nsec = 0;
248-
unsafe { rust_get_time(&mut sec, &mut nsec) }
248+
unsafe { get_time(&mut sec, &mut nsec) }
249249

250250
Time { sec: sec as u64, nsec: nsec as u64 }
251251
}

0 commit comments

Comments
 (0)