Skip to content

Commit 66ca3cc

Browse files
committed
---
yaml --- r: 114558 b: refs/heads/master c: e865415 h: refs/heads/master v: v3
1 parent adcca13 commit 66ca3cc

File tree

12 files changed

+176
-57
lines changed

12 files changed

+176
-57
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: dd0d495f50e2d8ba501e6b003cb4c1ef52d95ed5
2+
refs/heads/master: e865415c2fe2c0e83fe1955238db082a1374c380
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ec0258a381b88b5574e3f8ce72ae553ac3a574b7
55
refs/heads/try: 7c6c492fb2af9a85f21ff952942df3523b22fd17

trunk/configure

Lines changed: 46 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,11 @@ case $CFG_CPUTYPE in
348348
CFG_CPUTYPE=arm
349349
;;
350350

351+
armv7l)
352+
CFG_CPUTYPE=arm
353+
CFG_OSTYPE="${CFG_OSTYPE}eabihf"
354+
;;
355+
351356
x86_64 | x86-64 | x64 | amd64)
352357
CFG_CPUTYPE=x86_64
353358
;;
@@ -401,6 +406,7 @@ opt optimize 1 "build optimized rust code"
401406
opt optimize-cxx 1 "build optimized C++ code"
402407
opt optimize-llvm 1 "build optimized LLVM"
403408
opt optimize-tests 1 "build tests with optimizations"
409+
opt libcpp 1 "build with clang's libcpp"
404410
opt llvm-assertions 1 "build LLVM with assertions"
405411
opt debug 1 "build with extra debug fun"
406412
opt ratchet-bench 0 "ratchet benchmarks"
@@ -1043,53 +1049,71 @@ do
10431049

10441050
case "$CFG_CC" in
10451051
("ccache clang")
1046-
LLVM_CXX_32="ccache clang++ -m32 -Qunused-arguments"
1047-
LLVM_CC_32="ccache clang -m32 -Qunused-arguments"
1052+
LLVM_CXX_32="ccache clang++ -Qunused-arguments"
1053+
LLVM_CC_32="ccache clang -Qunused-arguments"
10481054

10491055
LLVM_CXX_64="ccache clang++ -Qunused-arguments"
10501056
LLVM_CC_64="ccache clang -Qunused-arguments"
1051-
LLVM_OPTS="$LLVM_OPTS --enable-libcpp"
10521057
;;
10531058
("clang")
1054-
LLVM_CXX_32="clang++ -m32 -Qunused-arguments"
1055-
LLVM_CC_32="clang -m32 -Qunused-arguments"
1059+
LLVM_CXX_32="clang++ -Qunused-arguments"
1060+
LLVM_CC_32="clang -Qunused-arguments"
10561061

10571062
LLVM_CXX_64="clang++ -Qunused-arguments"
10581063
LLVM_CC_64="clang -Qunused-arguments"
1059-
LLVM_OPTS="$LLVM_OPTS --enable-libcpp"
10601064
;;
10611065
("ccache gcc")
1062-
LLVM_CXX_32="ccache g++ -m32"
1063-
LLVM_CC_32="ccache gcc -m32"
1066+
LLVM_CXX_32="ccache g++"
1067+
LLVM_CC_32="ccache gcc"
10641068

10651069
LLVM_CXX_64="ccache g++"
10661070
LLVM_CC_64="ccache gcc"
10671071
;;
10681072
("gcc")
1069-
LLVM_CXX_32="g++ -m32"
1070-
LLVM_CC_32="gcc -m32"
1073+
LLVM_CXX_32="g++"
1074+
LLVM_CC_32="gcc"
10711075

10721076
LLVM_CXX_64="g++"
10731077
LLVM_CC_64="gcc"
10741078
;;
10751079

10761080
(*)
10771081
msg "inferring LLVM_CXX/CC from CXX/CC = $CXX/$CC"
1078-
LLVM_CXX_32="$CXX -m32"
1079-
LLVM_CC_32="$CC -m32"
1082+
LLVM_CXX_32="$CXX"
1083+
LLVM_CC_32="$CC"
10801084

10811085
LLVM_CXX_64="$CXX"
10821086
LLVM_CC_64="$CC"
10831087
;;
10841088
esac
10851089

1086-
LLVM_CFLAGS_32="-m32"
1087-
LLVM_CXXFLAGS_32="-m32"
1088-
LLVM_LDFLAGS_32="-m32"
1090+
case "$CFG_CPUTYPE" in
1091+
(x86*)
1092+
LLVM_CXX_32="$LLVM_CXX_32 -m32"
1093+
LLVM_CC_32="$LLVM_CC_32 -m32"
1094+
1095+
LLVM_CFLAGS_32="-m32"
1096+
LLVM_CXXFLAGS_32="-m32"
1097+
LLVM_LDFLAGS_32="-m32"
1098+
1099+
LLVM_CFLAGS_64=""
1100+
LLVM_CXXFLAGS_64=""
1101+
LLVM_LDFLAGS_64=""
1102+
1103+
LLVM_CXX_32="$LLVM_CXX_32 -m32"
1104+
LLVM_CC_32="$LLVM_CC_32 -m32"
1105+
;;
1106+
1107+
(*)
1108+
LLVM_CFLAGS_32=""
1109+
LLVM_CXXFLAGS_32=""
1110+
LLVM_LDFLAGS_32=""
10891111

1090-
LLVM_CFLAGS_64=""
1091-
LLVM_CXXFLAGS_64=""
1092-
LLVM_LDFLAGS_64=""
1112+
LLVM_CFLAGS_64=""
1113+
LLVM_CXXFLAGS_64=""
1114+
LLVM_LDFLAGS_64=""
1115+
;;
1116+
esac
10931117

10941118
if echo $t | grep -q x86_64
10951119
then
@@ -1112,6 +1136,10 @@ do
11121136
CXXFLAGS=$LLVM_CXXFLAGS
11131137
LDFLAGS=$LLVM_LDFLAGS
11141138

1139+
if [ "$CFG_DISABLE_LIBCPP" != 1 ]; then
1140+
LLVM_OPTS="$LLVM_OPTS --enable-libcpp"
1141+
fi
1142+
11151143
LLVM_FLAGS="$LLVM_TARGETS $LLVM_OPTS $LLVM_BUILD \
11161144
$LLVM_HOST $LLVM_TARGET --with-python=$CFG_PYTHON"
11171145

trunk/src/libcore/mem.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ pub unsafe fn overwrite<T>(dst: *mut T, src: T) {
160160
intrinsics::move_val_init(&mut *dst, src)
161161
}
162162

163-
/// Deprecated, use move_val_init() instead
163+
/// Deprecated, use `overwrite` instead
164164
#[inline]
165-
#[deprecated = "this function has been renamed to move_val_init()"]
165+
#[deprecated = "this function has been renamed to `overwrite`"]
166166
pub unsafe fn move_val_init<T>(dst: &mut T, src: T) {
167167
overwrite(dst, src)
168168
}

trunk/src/libcore/str.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -692,19 +692,19 @@ pub fn is_utf16(v: &[u16]) -> bool {
692692
/// An iterator that decodes UTF-16 encoded codepoints from a vector
693693
/// of `u16`s.
694694
#[deriving(Clone)]
695-
pub struct UTF16Items<'a> {
695+
pub struct Utf16Items<'a> {
696696
iter: slice::Items<'a, u16>
697697
}
698698
/// The possibilities for values decoded from a `u16` stream.
699699
#[deriving(Eq, TotalEq, Clone, Show)]
700-
pub enum UTF16Item {
700+
pub enum Utf16Item {
701701
/// A valid codepoint.
702702
ScalarValue(char),
703703
/// An invalid surrogate without its pair.
704704
LoneSurrogate(u16)
705705
}
706706

707-
impl UTF16Item {
707+
impl Utf16Item {
708708
/// Convert `self` to a `char`, taking `LoneSurrogate`s to the
709709
/// replacement character (U+FFFD).
710710
#[inline]
@@ -716,8 +716,8 @@ impl UTF16Item {
716716
}
717717
}
718718

719-
impl<'a> Iterator<UTF16Item> for UTF16Items<'a> {
720-
fn next(&mut self) -> Option<UTF16Item> {
719+
impl<'a> Iterator<Utf16Item> for Utf16Items<'a> {
720+
fn next(&mut self) -> Option<Utf16Item> {
721721
let u = match self.iter.next() {
722722
Some(u) => *u,
723723
None => return None
@@ -781,8 +781,8 @@ impl<'a> Iterator<UTF16Item> for UTF16Items<'a> {
781781
/// ScalarValue('i'), ScalarValue('c'),
782782
/// LoneSurrogate(0xD834)]);
783783
/// ```
784-
pub fn utf16_items<'a>(v: &'a [u16]) -> UTF16Items<'a> {
785-
UTF16Items { iter : v.iter() }
784+
pub fn utf16_items<'a>(v: &'a [u16]) -> Utf16Items<'a> {
785+
Utf16Items { iter : v.iter() }
786786
}
787787

788788
/// Return a slice of `v` ending at (and not including) the first NUL

trunk/src/libgreen/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ fn initialize_call_frame(regs: &mut Registers, fptr: InitFn, arg: uint,
270270
type Registers = [uint, ..32];
271271

272272
#[cfg(target_arch = "mips")]
273-
fn new_regs() -> Box<Registers> { box [0, .. 32] }
273+
fn new_regs() -> Box<Registers> { box {[0, .. 32]} }
274274

275275
#[cfg(target_arch = "mips")]
276276
fn initialize_call_frame(regs: &mut Registers, fptr: InitFn, arg: uint,

trunk/src/liblibc/lib.rs

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2476,6 +2476,9 @@ pub mod consts {
24762476
}
24772477
pub mod posix08 {
24782478
}
2479+
#[cfg(target_arch = "arm")]
2480+
#[cfg(target_arch = "x86")]
2481+
#[cfg(target_arch = "x86_64")]
24792482
pub mod bsd44 {
24802483
use types::os::arch::c95::c_int;
24812484

@@ -2518,6 +2521,49 @@ pub mod consts {
25182521
pub static SHUT_WR: c_int = 1;
25192522
pub static SHUT_RDWR: c_int = 2;
25202523
}
2524+
#[cfg(target_arch = "mips")]
2525+
pub mod bsd44 {
2526+
use types::os::arch::c95::c_int;
2527+
2528+
pub static MADV_NORMAL : c_int = 0;
2529+
pub static MADV_RANDOM : c_int = 1;
2530+
pub static MADV_SEQUENTIAL : c_int = 2;
2531+
pub static MADV_WILLNEED : c_int = 3;
2532+
pub static MADV_DONTNEED : c_int = 4;
2533+
pub static MADV_REMOVE : c_int = 9;
2534+
pub static MADV_DONTFORK : c_int = 10;
2535+
pub static MADV_DOFORK : c_int = 11;
2536+
pub static MADV_MERGEABLE : c_int = 12;
2537+
pub static MADV_UNMERGEABLE : c_int = 13;
2538+
pub static MADV_HWPOISON : c_int = 100;
2539+
2540+
pub static AF_UNIX: c_int = 1;
2541+
pub static AF_INET: c_int = 2;
2542+
pub static AF_INET6: c_int = 10;
2543+
pub static SOCK_STREAM: c_int = 2;
2544+
pub static SOCK_DGRAM: c_int = 1;
2545+
pub static IPPROTO_TCP: c_int = 6;
2546+
pub static IPPROTO_IP: c_int = 0;
2547+
pub static IPPROTO_IPV6: c_int = 41;
2548+
pub static IP_MULTICAST_TTL: c_int = 33;
2549+
pub static IP_MULTICAST_LOOP: c_int = 34;
2550+
pub static IP_TTL: c_int = 2;
2551+
pub static IP_ADD_MEMBERSHIP: c_int = 35;
2552+
pub static IP_DROP_MEMBERSHIP: c_int = 36;
2553+
pub static IPV6_ADD_MEMBERSHIP: c_int = 20;
2554+
pub static IPV6_DROP_MEMBERSHIP: c_int = 21;
2555+
2556+
pub static TCP_NODELAY: c_int = 1;
2557+
pub static SOL_SOCKET: c_int = 65535;
2558+
pub static SO_KEEPALIVE: c_int = 8;
2559+
pub static SO_BROADCAST: c_int = 32;
2560+
pub static SO_REUSEADDR: c_int = 4;
2561+
pub static SO_ERROR: c_int = 4103;
2562+
2563+
pub static SHUT_RD: c_int = 0;
2564+
pub static SHUT_WR: c_int = 1;
2565+
pub static SHUT_RDWR: c_int = 2;
2566+
}
25212567
#[cfg(target_arch = "x86")]
25222568
#[cfg(target_arch = "x86_64")]
25232569
#[cfg(target_arch = "arm")]

trunk/src/libnative/io/c_unix.rs

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,20 @@ use libc;
2222
#[cfg(target_os = "macos")]
2323
#[cfg(target_os = "freebsd")]
2424
pub static FIONBIO: libc::c_ulong = 0x8004667e;
25-
#[cfg(target_os = "linux")]
25+
#[cfg(target_os = "linux", not(target_arch = "mips"))]
2626
#[cfg(target_os = "android")]
2727
pub static FIONBIO: libc::c_ulong = 0x5421;
28+
#[cfg(target_os = "linux", target_arch = "mips")]
29+
pub static FIONBIO: libc::c_ulong = 0x667e;
30+
2831
#[cfg(target_os = "macos")]
2932
#[cfg(target_os = "freebsd")]
3033
pub static FIOCLEX: libc::c_ulong = 0x20006601;
31-
#[cfg(target_os = "linux")]
34+
#[cfg(target_os = "linux", not(target_arch = "mips"))]
3235
#[cfg(target_os = "android")]
3336
pub static FIOCLEX: libc::c_ulong = 0x5451;
37+
#[cfg(target_os = "linux", target_arch = "mips")]
38+
pub static FIOCLEX: libc::c_ulong = 0x6601;
3439

3540
#[cfg(target_os = "macos")]
3641
#[cfg(target_os = "freebsd")]
@@ -100,7 +105,7 @@ mod select {
100105
}
101106
}
102107

103-
#[cfg(target_os = "linux")]
108+
#[cfg(target_os = "linux", not(target_arch = "mips"))]
104109
#[cfg(target_os = "android")]
105110
mod signal {
106111
use libc;
@@ -143,6 +148,44 @@ mod signal {
143148
}
144149
}
145150

151+
#[cfg(target_os = "linux", target_arch = "mips")]
152+
mod signal {
153+
use libc;
154+
155+
pub static SA_NOCLDSTOP: libc::c_ulong = 0x00000001;
156+
pub static SA_NOCLDWAIT: libc::c_ulong = 0x00010000;
157+
pub static SA_NODEFER: libc::c_ulong = 0x40000000;
158+
pub static SA_ONSTACK: libc::c_ulong = 0x08000000;
159+
pub static SA_RESETHAND: libc::c_ulong = 0x80000000;
160+
pub static SA_RESTART: libc::c_ulong = 0x10000000;
161+
pub static SA_SIGINFO: libc::c_ulong = 0x00000008;
162+
pub static SIGCHLD: libc::c_int = 18;
163+
164+
// This definition is not as accurate as it could be, {pid, uid, status} is
165+
// actually a giant union. Currently we're only interested in these fields,
166+
// however.
167+
pub struct siginfo {
168+
si_signo: libc::c_int,
169+
si_code: libc::c_int,
170+
si_errno: libc::c_int,
171+
pub pid: libc::pid_t,
172+
pub uid: libc::uid_t,
173+
pub status: libc::c_int,
174+
}
175+
176+
pub struct sigaction {
177+
pub sa_flags: libc::c_uint,
178+
pub sa_handler: extern fn(libc::c_int),
179+
pub sa_mask: sigset_t,
180+
sa_restorer: *mut libc::c_void,
181+
sa_resv: [libc::c_int, ..1],
182+
}
183+
184+
pub struct sigset_t {
185+
__val: [libc::c_ulong, ..32],
186+
}
187+
}
188+
146189
#[cfg(target_os = "macos")]
147190
#[cfg(target_os = "freebsd")]
148191
mod signal {

trunk/src/libnative/io/net.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,12 @@ enum InAddr {
4242
fn ip_to_inaddr(ip: ip::IpAddr) -> InAddr {
4343
match ip {
4444
ip::Ipv4Addr(a, b, c, d) => {
45+
let ip = (a as u32 << 24) |
46+
(b as u32 << 16) |
47+
(c as u32 << 8) |
48+
(d as u32 << 0);
4549
InAddr(libc::in_addr {
46-
s_addr: (d as u32 << 24) |
47-
(c as u32 << 16) |
48-
(b as u32 << 8) |
49-
(a as u32 << 0)
50+
s_addr: mem::from_be32(ip)
5051
})
5152
}
5253
ip::Ipv6Addr(a, b, c, d, e, f, g, h) => {
@@ -174,11 +175,11 @@ pub fn sockaddr_to_addr(storage: &libc::sockaddr_storage,
174175
let storage: &libc::sockaddr_in = unsafe {
175176
mem::transmute(storage)
176177
};
177-
let addr = storage.sin_addr.s_addr as u32;
178-
let a = (addr >> 0) as u8;
179-
let b = (addr >> 8) as u8;
180-
let c = (addr >> 16) as u8;
181-
let d = (addr >> 24) as u8;
178+
let ip = mem::to_be32(storage.sin_addr.s_addr as u32);
179+
let a = (ip >> 24) as u8;
180+
let b = (ip >> 16) as u8;
181+
let c = (ip >> 8) as u8;
182+
let d = (ip >> 0) as u8;
182183
Ok(ip::SocketAddr {
183184
ip: ip::Ipv4Addr(a, b, c, d),
184185
port: ntohs(storage.sin_port),

trunk/src/librustdoc/html/render.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,10 +1094,10 @@ impl<'a> Item<'a> {
10941094
let path = cache.external_paths.get(&self.item.def_id);
10951095
let root = match *cache.extern_locations.get(&self.item.def_id.krate) {
10961096
Remote(ref s) => s.to_string(),
1097-
Local => format!("{}/..", self.cx.root_path),
1097+
Local => self.cx.root_path.clone(),
10981098
Unknown => return None,
10991099
};
1100-
Some(format!("{root}/{path}/{file}?gotosrc={goto}",
1100+
Some(format!("{root}{path}/{file}?gotosrc={goto}",
11011101
root = root,
11021102
path = path.slice_to(path.len() - 1).connect("/"),
11031103
file = item_path(self.item),

0 commit comments

Comments
 (0)