Skip to content

Commit a0d95f8

Browse files
committed
---
yaml --- r: 63516 b: refs/heads/snap-stage3 c: dc262d9 h: refs/heads/master v: v3
1 parent 0eb72e7 commit a0d95f8

39 files changed

+956
-3177
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: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 357f087786cbd6516a38aff800cf9334bc5b85c5
4+
refs/heads/snap-stage3: dc262d9aa742adadb92558a588aeaa57267fdee4
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/mk/tests.mk

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,7 @@ CFG_ADB_TEST_DIR=/data/tmp
122122
$(info check: android device test dir $(CFG_ADB_TEST_DIR) ready \
123123
$(shell adb remount 1>/dev/null) \
124124
$(shell adb shell mkdir $(CFG_ADB_TEST_DIR) 1>/dev/null) \
125-
$(shell adb shell rm $(CFG_ADB_TEST_DIR)/*.so 1>/dev/null) \
126-
$(shell adb shell rm $(CFG_ADB_TEST_DIR)/*-arm-linux-androideabi 1>/dev/null) \
127-
$(shell adb shell rm $(CFG_ADB_TEST_DIR)/*-arm-linux-androideabi.* 1>/dev/null) \
125+
$(shell adb shell rm -rf $(CFG_ADB_TEST_DIR)/* 1>/dev/null) \
128126
$(shell adb push $(S)src/etc/adb_run_wrapper.sh $(CFG_ADB_TEST_DIR) 1>/dev/null) \
129127
$(shell adb push $(CFG_ANDROID_CROSS_PATH)/arm-linux-androideabi/lib/armv7-a/libgnustl_shared.so \
130128
$(CFG_ADB_TEST_DIR) 1>/dev/null) \

branches/snap-stage3/src/etc/adb_run_wrapper.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,17 @@ then
1717

1818
L_RET=1
1919
L_COUNT=0
20+
cd $PATH
2021
while [ $L_RET -eq 1 ]
2122
do
22-
LD_LIBRARY_PATH=$PATH $PATH/$RUN $@ 1>$PATH/$RUN.stdout 2>$PATH/$RUN.stderr
23+
TEST_EXEC_ENV=22 LD_LIBRARY_PATH=$PATH $PATH/$RUN $@ 1>$PATH/$RUN.stdout 2>$PATH/$RUN.stderr
2324
L_RET=$?
2425
if [ $L_COUNT -gt 0 ]
2526
then
2627
/system/bin/sleep $WAIT
2728
/system/bin/sync
2829
fi
29-
L_COUNT=`expr $L_COUNT+1`
30+
L_COUNT=$((L_COUNT+1))
3031
done
3132

3233
echo $L_RET > $PATH/$RUN.exitcode

branches/snap-stage3/src/librustc/middle/trans/callee.rs

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -826,24 +826,33 @@ pub fn trans_arg_expr(bcx: block,
826826
val = arg_datum.to_ref_llval(bcx);
827827
}
828828
ty::ByCopy => {
829-
debug!("by copy arg with type %s, storing to scratch",
830-
bcx.ty_to_str(arg_datum.ty));
831-
let scratch = scratch_datum(bcx, arg_datum.ty, false);
832-
833-
arg_datum.store_to_datum(bcx,
834-
arg_expr.id,
835-
INIT,
836-
scratch);
837-
838-
// Technically, ownership of val passes to the callee.
839-
// However, we must cleanup should we fail before the
840-
// callee is actually invoked.
841-
scratch.add_clean(bcx);
842-
temp_cleanups.push(scratch.val);
843-
844-
match arg_datum.appropriate_mode() {
845-
ByValue => val = Load(bcx, scratch.val),
846-
ByRef(_) => val = scratch.val,
829+
if ty::type_needs_drop(bcx.tcx(), arg_datum.ty) ||
830+
arg_datum.appropriate_mode().is_by_ref() {
831+
debug!("by copy arg with type %s, storing to scratch",
832+
bcx.ty_to_str(arg_datum.ty));
833+
let scratch = scratch_datum(bcx, arg_datum.ty, false);
834+
835+
arg_datum.store_to_datum(bcx,
836+
arg_expr.id,
837+
INIT,
838+
scratch);
839+
840+
// Technically, ownership of val passes to the callee.
841+
// However, we must cleanup should we fail before the
842+
// callee is actually invoked.
843+
scratch.add_clean(bcx);
844+
temp_cleanups.push(scratch.val);
845+
846+
match scratch.appropriate_mode() {
847+
ByValue => val = Load(bcx, scratch.val),
848+
ByRef(_) => val = scratch.val,
849+
}
850+
} else {
851+
debug!("by copy arg with type %s");
852+
match arg_datum.mode {
853+
ByRef(_) => val = Load(bcx, arg_datum.val),
854+
ByValue => val = arg_datum.val,
855+
}
847856
}
848857
}
849858
}

branches/snap-stage3/src/libstd/libc.rs

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,8 @@ pub mod types {
257257
pub type intptr_t = int;
258258
pub type uintptr_t = uint;
259259
}
260+
#[cfg(target_arch = "x86")]
261+
#[cfg(target_arch = "mips")]
260262
pub mod posix88 {
261263
pub type off_t = i32;
262264
pub type dev_t = u64;
@@ -268,6 +270,20 @@ pub mod types {
268270
pub type mode_t = u32;
269271
pub type ssize_t = i32;
270272
}
273+
#[cfg(target_arch = "arm")]
274+
pub mod posix88 {
275+
pub type off_t = i32;
276+
pub type dev_t = u32;
277+
pub type ino_t = u32;
278+
pub type pid_t = i32;
279+
pub type uid_t = u32;
280+
pub type gid_t = u32;
281+
pub type useconds_t = u32;
282+
pub type mode_t = u16;
283+
pub type ssize_t = i32;
284+
}
285+
#[cfg(target_arch = "x86")]
286+
#[cfg(target_arch = "mips")]
271287
pub mod posix01 {
272288
use libc::types::os::arch::c95::{c_short, c_long, c_ulong, time_t};
273289
use libc::types::os::arch::posix88::{dev_t, gid_t, ino_t};
@@ -279,7 +295,6 @@ pub mod types {
279295
pub type blkcnt_t = i32;
280296

281297
#[cfg(target_arch = "x86")]
282-
#[cfg(target_arch = "arm")]
283298
pub struct stat {
284299
st_dev: dev_t,
285300
__pad1: c_short,
@@ -327,6 +342,39 @@ pub mod types {
327342
st_pad5: [c_long, ..14],
328343
}
329344
}
345+
#[cfg(target_arch = "arm")]
346+
pub mod posix01 {
347+
use libc::types::os::arch::c95::{c_uchar, c_uint, c_ulong, time_t};
348+
use libc::types::os::arch::c99::{c_longlong, c_ulonglong};
349+
use libc::types::os::arch::posix88::{uid_t, gid_t, ino_t};
350+
use libc::types::os::arch::posix88::{uid_t};
351+
352+
pub type nlink_t = u16;
353+
pub type blksize_t = u32;
354+
pub type blkcnt_t = u32;
355+
356+
pub struct stat {
357+
st_dev: c_ulonglong,
358+
__pad0: [c_uchar, ..4],
359+
__st_ino: ino_t,
360+
st_mode: c_uint,
361+
st_nlink: c_uint,
362+
st_uid: uid_t,
363+
st_gid: gid_t,
364+
st_rdev: c_ulonglong,
365+
__pad3: [c_uchar, ..4],
366+
st_size: c_longlong,
367+
st_blksize: blksize_t,
368+
st_blocks: c_ulonglong,
369+
st_atime: time_t,
370+
st_atime_nsec: c_ulong,
371+
st_mtime: time_t,
372+
st_mtime_nsec: c_ulong,
373+
st_ctime: time_t,
374+
st_ctime_nsec: c_ulong,
375+
st_ino: c_ulonglong
376+
}
377+
}
330378
pub mod posix08 {}
331379
pub mod bsd44 {}
332380
pub mod extra {}

branches/snap-stage3/src/libstd/macros.rs

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,18 @@
1010

1111
#[macro_escape];
1212

13-
macro_rules! rterrln (
14-
($( $arg:expr),+) => ( {
15-
::rt::util::dumb_println(fmt!( $($arg),+ ));
16-
} )
17-
)
18-
1913
// Some basic logging
2014
macro_rules! rtdebug_ (
2115
($( $arg:expr),+) => ( {
22-
rterrln!( $($arg),+ )
16+
dumb_println(fmt!( $($arg),+ ));
17+
18+
fn dumb_println(s: &str) {
19+
use io::WriterUtil;
20+
let dbg = ::libc::STDERR_FILENO as ::io::fd_t;
21+
dbg.write_str(s);
22+
dbg.write_str("\n");
23+
}
24+
2325
} )
2426
)
2527

@@ -31,15 +33,21 @@ macro_rules! rtdebug (
3133
macro_rules! rtassert (
3234
( $arg:expr ) => ( {
3335
if !$arg {
34-
rtabort!("assertion failed: %s", stringify!($arg));
36+
abort!("assertion failed: %s", stringify!($arg));
3537
}
3638
} )
3739
)
3840

39-
40-
macro_rules! rtabort(
41+
macro_rules! abort(
4142
($( $msg:expr),+) => ( {
42-
::rt::util::abort(fmt!($($msg),+));
43+
rtdebug!($($msg),+);
44+
45+
do_abort();
46+
47+
// NB: This is in a fn to avoid putting the `unsafe` block in a macro,
48+
// which causes spurious 'unnecessary unsafe block' warnings.
49+
fn do_abort() -> ! {
50+
unsafe { ::libc::abort(); }
51+
}
4352
} )
4453
)
45-

branches/snap-stage3/src/libstd/path.rs

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ pub trait GenericPath {
128128
#[cfg(target_os = "android")]
129129
mod stat {
130130
#[cfg(target_arch = "x86")]
131-
#[cfg(target_arch = "arm")]
132131
pub mod arch {
133132
use libc;
134133

@@ -158,6 +157,35 @@ mod stat {
158157
}
159158
}
160159

160+
#[cfg(target_arch = "arm")]
161+
pub mod arch {
162+
use libc;
163+
164+
pub fn default_stat() -> libc::stat {
165+
libc::stat {
166+
st_dev: 0,
167+
__pad0: [0, ..4],
168+
__st_ino: 0,
169+
st_mode: 0,
170+
st_nlink: 0,
171+
st_uid: 0,
172+
st_gid: 0,
173+
st_rdev: 0,
174+
__pad3: [0, ..4],
175+
st_size: 0,
176+
st_blksize: 0,
177+
st_blocks: 0,
178+
st_atime: 0,
179+
st_atime_nsec: 0,
180+
st_mtime: 0,
181+
st_mtime_nsec: 0,
182+
st_ctime: 0,
183+
st_ctime_nsec: 0,
184+
st_ino: 0
185+
}
186+
}
187+
}
188+
161189
#[cfg(target_arch = "mips")]
162190
pub mod arch {
163191
use libc;

0 commit comments

Comments
 (0)