Skip to content

Commit e34e76f

Browse files
committed
---
yaml --- r: 93758 b: refs/heads/try c: f4c22f7 h: refs/heads/master v: v3
1 parent 5cc8fd9 commit e34e76f

35 files changed

+744
-776
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 0da105a8b7b6b1e0568e8ff20f6ff4b13cc7ecc2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
5-
refs/heads/try: f977bedafd657b52fb618cc788cc31f35336270d
5+
refs/heads/try: f4c22f75d46e94985d2fe45c896bde65e991b13d
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/mk/clean.mk

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,19 @@
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+
2228
CLEAN_LLVM_RULES = \
2329
$(foreach target, $(CFG_HOST), \
2430
clean-llvm$(target))
@@ -33,19 +39,6 @@ clean: clean-misc $(CLEAN_STAGE_RULES)
3339

3440
clean-misc:
3541
@$(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
4942
$(Q)rm -f $(RUNTIME_OBJS) $(RUNTIME_DEF)
5043
$(Q)rm -f $(RUSTLLVM_LIB_OBJS) $(RUSTLLVM_OBJS_OBJS) $(RUSTLLVM_DEF)
5144
$(Q)rm -Rf $(DOCS)
@@ -60,6 +53,27 @@ clean-misc:
6053
$(Q)rm -Rf $(foreach sub, index styles files search javascript, \
6154
$(wildcard doc/*/$(sub)))
6255

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+
6377
define CLEAN_HOST_STAGE_N
6478

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

branches/try/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)) \

branches/try/mk/rt.mk

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

9292
RUNTIME_CXXS_$(1)_$(2) := \
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
93+
rt/rust_cxx_glue.cpp
9994

100-
RUNTIME_CS_$(1)_$(2) :=
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
101105

102106
RUNTIME_S_$(1)_$(2) := rt/arch/$$(HOST_$(1))/_context.S \
103107
rt/arch/$$(HOST_$(1))/record_sp.S
@@ -115,7 +119,7 @@ ALL_OBJ_FILES += $$(RUNTIME_OBJS_$(1)_$(2))
115119
MORESTACK_OBJS_$(1)_$(2) := $$(RT_BUILD_DIR_$(1)_$(2))/arch/$$(HOST_$(1))/morestack.o
116120
ALL_OBJ_FILES += $$(MORESTACK_OBJS_$(1)_$(2))
117121

118-
$$(RT_BUILD_DIR_$(1)_$(2))/%.o: rt/%.cpp $$(MKFILE_DEPS)
122+
$$(RT_BUILD_DIR_$(1)_$(2))/rust_cxx_glue.o: rt/rust_cxx_glue.cpp $$(MKFILE_DEPS)
119123
@$$(call E, compile: $$@)
120124
$$(Q)$$(call CFG_COMPILE_CXX_$(1), $$@, $$(RUNTIME_INCS_$(1)_$(2)) \
121125
$$(SNAP_DEFINES) $$(RUNTIME_CXXFLAGS_$(1)_$(2))) $$<
@@ -242,13 +246,13 @@ endif
242246
UV_SUPPORT_NAME_$(1) := $$(call CFG_STATIC_LIB_NAME_$(1),uv_support)
243247
UV_SUPPORT_DIR_$(1) := $$(RT_OUTPUT_DIR_$(1))/uv_support
244248
UV_SUPPORT_LIB_$(1) := $$(UV_SUPPORT_DIR_$(1))/$$(UV_SUPPORT_NAME_$(1))
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)
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)
247251

248-
$$(UV_SUPPORT_DIR_$(1))/%.o: rt/%.cpp
252+
$$(UV_SUPPORT_DIR_$(1))/%.o: rt/%.c
249253
@$$(call E, compile: $$@)
250254
@mkdir -p $$(@D)
251-
$$(Q)$$(call CFG_COMPILE_CXX_$(1), $$@, \
255+
$$(Q)$$(call CFG_COMPILE_C_$(1), $$@, \
252256
-I $$(S)src/libuv/include \
253257
$$(RUNTIME_CFLAGS_$(1))) $$<
254258

branches/try/src/etc/adb_run_wrapper.sh

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

1819
L_RET=1
1920
L_COUNT=0
20-
cd $PATH
21+
cd $TEST_PATH
2122
while [ $L_RET -eq 1 ]
2223
do
23-
TEST_EXEC_ENV=22 LD_LIBRARY_PATH=$PATH $PATH/$RUN $@ 1>$PATH/$RUN.stdout 2>$PATH/$RUN.stderr
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
2425
L_RET=$?
2526
if [ $L_COUNT -gt 0 ]
2627
then
@@ -30,7 +31,7 @@ then
3031
L_COUNT=$((L_COUNT+1))
3132
done
3233

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

3536
fi
3637
fi

branches/try/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 get_time(sec: &mut i64, nsec: &mut i32);
25-
pub fn precise_time_ns(ns: &mut u64);
24+
pub fn rust_get_time(sec: &mut i64, nsec: &mut i32);
25+
pub fn rust_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::get_time(&mut sec, &mut nsec);
69+
rustrt::rust_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::precise_time_ns(&mut ns);
82+
rustrt::rust_precise_time_ns(&mut ns);
8383
ns
8484
}
8585
}

branches/try/src/libextra/workcache.rs

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

478478

479479
#[test]
480+
#[cfg(not(target_os="android"))] // FIXME(#10455)
480481
fn test() {
481482
use std::{os, run};
482483
use std::io::fs;

branches/try/src/libstd/os.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,21 +138,19 @@ 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};
141142
use unstable::finally::Finally;
142143

144+
static mut lock: Mutex = MUTEX_INIT;
145+
143146
unsafe {
144147
return do (|| {
145-
rust_take_env_lock();
148+
lock.lock();
146149
f()
147150
}).finally {
148-
rust_drop_env_lock();
151+
lock.unlock();
149152
};
150153
}
151-
152-
extern {
153-
fn rust_take_env_lock();
154-
fn rust_drop_env_lock();
155-
}
156154
}
157155

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

branches/try/src/libstd/rt/args.rs

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,46 +21,60 @@
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;
2427

2528
/// One-time global initialization.
26-
pub unsafe fn init(argc: int, argv: **u8) {
27-
imp::init(argc, argv)
28-
}
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) }
2933

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

3538
/// Take the global arguments from global storage.
36-
pub fn take() -> Option<~[~str]> {
37-
imp::take()
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+
}
3845
}
3946

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

4753
/// Make a clone of the global arguments.
48-
pub fn clone() -> Option<~[~str]> {
49-
imp::clone()
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+
}
5060
}
5161

5262
#[cfg(target_os = "linux")]
5363
#[cfg(target_os = "android")]
5464
#[cfg(target_os = "freebsd")]
5565
mod imp {
66+
use cast;
5667
use libc;
5768
use option::{Option, Some, None};
5869
use iter::Iterator;
5970
use str;
6071
use unstable::finally::Finally;
72+
use unstable::mutex::{Mutex, MUTEX_INIT};
6173
use util;
6274
use vec;
6375

76+
static mut global_args_ptr: uint = 0;
77+
6478
pub unsafe fn init(argc: int, argv: **u8) {
6579
let args = load_argc_and_argv(argc, argv);
6680
put(args);
@@ -94,20 +108,22 @@ mod imp {
94108
}
95109

96110
fn with_lock<T>(f: &fn() -> T) -> T {
111+
static mut lock: Mutex = MUTEX_INIT;
112+
97113
do (|| {
98114
unsafe {
99-
rust_take_global_args_lock();
115+
lock.lock();
100116
f()
101117
}
102118
}).finally {
103119
unsafe {
104-
rust_drop_global_args_lock();
120+
lock.unlock();
105121
}
106122
}
107123
}
108124

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

113129
// Copied from `os`.
@@ -117,12 +133,6 @@ mod imp {
117133
}
118134
}
119135

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-
126136
#[cfg(test)]
127137
mod tests {
128138
use option::{Some, None};

branches/try/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 get_time(sec: &mut i64, nsec: &mut i32);
244+
fn rust_get_time(sec: &mut i64, nsec: &mut i32);
245245
}
246246
let mut sec = 0;
247247
let mut nsec = 0;
248-
unsafe { get_time(&mut sec, &mut nsec) }
248+
unsafe { rust_get_time(&mut sec, &mut nsec) }
249249

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

0 commit comments

Comments
 (0)