Skip to content

Commit 0190563

Browse files
committed
---
yaml --- r: 152775 b: refs/heads/try2 c: c381259 h: refs/heads/master i: 152773: f71338a 152771: 948969e 152767: 99960f1 v: v3
1 parent dcd95d0 commit 0190563

File tree

24 files changed

+377
-21
lines changed

24 files changed

+377
-21
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 0af4985332c16e07ad8348a941c9de4efdafb13e
8+
refs/heads/try2: c38125987f14017dd7a6f7977a84c7896d897eff
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/mk/platform.mk

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,36 @@ CFG_RUN_TARG_arm-unknown-linux-gnueabi=$(call CFG_RUN_arm-unknown-linux-gnueabi,
374374
RUSTC_FLAGS_arm-unknown-linux-gnueabi :=
375375
RUSTC_CROSS_FLAGS_arm-unknown-linux-gnueabi :=
376376

377+
# mipsel-linux configuration
378+
CC_mipsel-linux=mipsel-linux-gcc
379+
CXX_mipsel-linux=mipsel-linux-g++
380+
CPP_mipsel-linux=mipsel-linux-gcc
381+
AR_mipsel-linux=mipsel-linux-ar
382+
CFG_LIB_NAME_mipsel-linux=lib$(1).so
383+
CFG_STATIC_LIB_NAME_mipsel-linux=lib$(1).a
384+
CFG_LIB_GLOB_mipsel-linux=lib$(1)-*.so
385+
CFG_LIB_DSYM_GLOB_mipsel-linux=lib$(1)-*.dylib.dSYM
386+
CFG_CFLAGS_mipsel-linux := -mips32 -mabi=32 $(CFLAGS)
387+
CFG_GCCISH_CFLAGS_mipsel-linux := -Wall -g -fPIC -mips32 -mabi=32 $(CFLAGS)
388+
CFG_GCCISH_CXXFLAGS_mipsel-linux := -fno-rtti $(CXXFLAGS)
389+
CFG_GCCISH_LINK_FLAGS_mipsel-linux := -shared -fPIC -g -mips32
390+
CFG_GCCISH_DEF_FLAG_mipsel-linux := -Wl,--export-dynamic,--dynamic-list=
391+
CFG_GCCISH_PRE_LIB_FLAGS_mipsel-linux := -Wl,-whole-archive
392+
CFG_GCCISH_POST_LIB_FLAGS_mipsel-linux := -Wl,-no-whole-archive
393+
CFG_DEF_SUFFIX_mipsel-linux := .linux.def
394+
CFG_LLC_FLAGS_mipsel-linux :=
395+
CFG_INSTALL_NAME_mipsel-linux =
396+
CFG_LIBUV_LINK_FLAGS_mipsel-linux =
397+
CFG_EXE_SUFFIX_mipsel-linux :=
398+
CFG_WINDOWSY_mipsel-linux :=
399+
CFG_UNIXY_mipsel-linux := 1
400+
CFG_PATH_MUNGE_mipsel-linux := true
401+
CFG_LDPATH_mipsel-linux :=
402+
CFG_RUN_mipsel-linux=
403+
CFG_RUN_TARG_mipsel-linux=
404+
RUSTC_FLAGS_mipsel-linux := -C target-cpu=mips32 -C target-feature="+mips32,+o32"
405+
406+
377407
# mips-unknown-linux-gnu configuration
378408
CC_mips-unknown-linux-gnu=mips-linux-gnu-gcc
379409
CXX_mips-unknown-linux-gnu=mips-linux-gnu-g++
@@ -612,7 +642,7 @@ define CFG_MAKE_TOOLCHAIN
612642
$$(CFG_GCCISH_DEF_FLAG_$(1))$$(3) $$(2) \
613643
$$(call CFG_INSTALL_NAME_$(1),$$(4))
614644

615-
ifeq ($$(findstring $(HOST_$(1)),arm mips),)
645+
ifeq ($$(findstring $(HOST_$(1)),arm mips mipsel),)
616646

617647
# We're using llvm-mc as our assembler because it supports
618648
# .cfi pseudo-ops on mac

branches/try2/src/doc/tutorial.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2522,7 +2522,7 @@ fn sendable_foo(f: Box<Foo + Send>) { /* ... */ }
25222522
fn shareable_bar<T: Share>(b: &Bar<T> + Share) { /* ... */ }
25232523
~~~
25242524

2525-
When no colon is specified (such as the type `~Foo`), it is inferred that the
2525+
When no colon is specified (such as the type `Box<Foo>`), it is inferred that the
25262526
value ascribes to no bounds. They must be added manually if any bounds are
25272527
necessary for usage.
25282528

@@ -2579,17 +2579,18 @@ fn radius_times_area<T: Circle>(c: T) -> f64 {
25792579

25802580
Likewise, supertrait methods may also be called on trait objects.
25812581

2582-
~~~ {.ignore}
2582+
~~~
25832583
use std::f64::consts::PI;
25842584
# trait Shape { fn area(&self) -> f64; }
25852585
# trait Circle : Shape { fn radius(&self) -> f64; }
25862586
# struct Point { x: f64, y: f64 }
25872587
# struct CircleStruct { center: Point, radius: f64 }
25882588
# impl Circle for CircleStruct { fn radius(&self) -> f64 { (self.area() / PI).sqrt() } }
25892589
# impl Shape for CircleStruct { fn area(&self) -> f64 { PI * square(self.radius) } }
2590+
# fn square(x: f64) -> f64 { x * x }
25902591
2591-
let concrete = ~CircleStruct{center:Point{x:3.0,y:4.0},radius:5.0};
2592-
let mycircle: ~Circle = concrete as ~Circle;
2592+
let concrete = box CircleStruct{center:Point{x:3.0,y:4.0},radius:5.0};
2593+
let mycircle: Box<Circle> = concrete as Box<Circle>;
25932594
let nonsense = mycircle.radius() * mycircle.area();
25942595
~~~
25952596

branches/try2/src/libcore/mem.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ mod tests {
404404
#[cfg(target_arch = "x86")]
405405
#[cfg(target_arch = "arm")]
406406
#[cfg(target_arch = "mips")]
407+
#[cfg(target_arch = "mipsel")]
407408
fn size_of_32() {
408409
assert_eq!(size_of::<uint>(), 4u);
409410
assert_eq!(size_of::<*uint>(), 4u);
@@ -435,6 +436,7 @@ mod tests {
435436
#[cfg(target_arch = "x86")]
436437
#[cfg(target_arch = "arm")]
437438
#[cfg(target_arch = "mips")]
439+
#[cfg(target_arch = "mipsel")]
438440
fn align_of_32() {
439441
assert_eq!(align_of::<uint>(), 4u);
440442
assert_eq!(align_of::<*uint>(), 4u);

branches/try2/src/libgreen/context.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,12 +268,15 @@ fn initialize_call_frame(regs: &mut Registers, fptr: InitFn, arg: uint,
268268
}
269269

270270
#[cfg(target_arch = "mips")]
271+
#[cfg(target_arch = "mipsel")]
271272
type Registers = [uint, ..32];
272273

273274
#[cfg(target_arch = "mips")]
275+
#[cfg(target_arch = "mipsel")]
274276
fn new_regs() -> Box<Registers> { box {[0, .. 32]} }
275277

276278
#[cfg(target_arch = "mips")]
279+
#[cfg(target_arch = "mipsel")]
277280
fn initialize_call_frame(regs: &mut Registers, fptr: InitFn, arg: uint,
278281
procedure: raw::Procedure, sp: *mut uint) {
279282
let sp = align_down(sp);

branches/try2/src/liblibc/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ pub mod types {
463463
#[cfg(target_arch = "x86")]
464464
#[cfg(target_arch = "arm")]
465465
#[cfg(target_arch = "mips")]
466+
#[cfg(target_arch = "mipsel")]
466467
pub mod arch {
467468
pub mod c95 {
468469
pub type c_char = i8;
@@ -491,6 +492,7 @@ pub mod types {
491492
}
492493
#[cfg(target_arch = "x86")]
493494
#[cfg(target_arch = "mips")]
495+
#[cfg(target_arch = "mipsel")]
494496
pub mod posix88 {
495497
pub type off_t = i32;
496498
pub type dev_t = u64;
@@ -599,6 +601,7 @@ pub mod types {
599601
}
600602
}
601603
#[cfg(target_arch = "mips")]
604+
#[cfg(target_arch = "mipsel")]
602605
pub mod posix01 {
603606
use types::os::arch::c95::{c_long, c_ulong, time_t};
604607
use types::os::arch::posix88::{gid_t, ino_t};
@@ -2209,6 +2212,7 @@ pub mod consts {
22092212
}
22102213

22112214
#[cfg(target_arch = "mips")]
2215+
#[cfg(target_arch = "mipsel")]
22122216
pub mod posix88 {
22132217
use types::os::arch::c95::c_int;
22142218
use types::common::c95::c_void;
@@ -2483,6 +2487,7 @@ pub mod consts {
24832487
pub static PTHREAD_STACK_MIN: size_t = 16384;
24842488

24852489
#[cfg(target_arch = "mips", target_os = "linux")]
2490+
#[cfg(target_arch = "mipsel", target_os = "linux")]
24862491
pub static PTHREAD_STACK_MIN: size_t = 131072;
24872492

24882493
pub static CLOCK_REALTIME: c_int = 0;
@@ -2536,6 +2541,7 @@ pub mod consts {
25362541
pub static SHUT_RDWR: c_int = 2;
25372542
}
25382543
#[cfg(target_arch = "mips")]
2544+
#[cfg(target_arch = "mipsel")]
25392545
pub mod bsd44 {
25402546
use types::os::arch::c95::c_int;
25412547

@@ -2604,6 +2610,7 @@ pub mod consts {
26042610
pub static MAP_STACK : c_int = 0x020000;
26052611
}
26062612
#[cfg(target_arch = "mips")]
2613+
#[cfg(target_arch = "mipsel")]
26072614
pub mod extra {
26082615
use types::os::arch::c95::c_int;
26092616

@@ -2976,6 +2983,7 @@ pub mod consts {
29762983
pub static PTHREAD_STACK_MIN: size_t = 4096;
29772984

29782985
#[cfg(target_arch = "mips")]
2986+
#[cfg(target_arch = "mipsel")]
29792987
#[cfg(target_arch = "x86")]
29802988
#[cfg(target_arch = "x86_64")]
29812989
pub static PTHREAD_STACK_MIN: size_t = 2048;

branches/try2/src/libnative/io/c_unix.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,26 @@ use libc;
2323
#[cfg(target_os = "ios")]
2424
#[cfg(target_os = "freebsd")]
2525
pub static FIONBIO: libc::c_ulong = 0x8004667e;
26-
#[cfg(target_os = "linux", not(target_arch = "mips"))]
26+
#[cfg(target_os = "linux", target_arch = "x86")]
27+
#[cfg(target_os = "linux", target_arch = "x86_64")]
28+
#[cfg(target_os = "linux", target_arch = "arm")]
2729
#[cfg(target_os = "android")]
2830
pub static FIONBIO: libc::c_ulong = 0x5421;
2931
#[cfg(target_os = "linux", target_arch = "mips")]
32+
#[cfg(target_os = "linux", target_arch = "mipsel")]
3033
pub static FIONBIO: libc::c_ulong = 0x667e;
3134

3235
#[cfg(target_os = "macos")]
3336
#[cfg(target_os = "ios")]
3437
#[cfg(target_os = "freebsd")]
3538
pub static FIOCLEX: libc::c_ulong = 0x20006601;
36-
#[cfg(target_os = "linux", not(target_arch = "mips"))]
39+
#[cfg(target_os = "linux", target_arch = "x86")]
40+
#[cfg(target_os = "linux", target_arch = "x86_64")]
41+
#[cfg(target_os = "linux", target_arch = "arm")]
3742
#[cfg(target_os = "android")]
3843
pub static FIOCLEX: libc::c_ulong = 0x5451;
3944
#[cfg(target_os = "linux", target_arch = "mips")]
45+
#[cfg(target_os = "linux", target_arch = "mipsel")]
4046
pub static FIOCLEX: libc::c_ulong = 0x6601;
4147

4248
#[cfg(target_os = "macos")]
@@ -109,7 +115,9 @@ mod select {
109115
}
110116
}
111117

112-
#[cfg(target_os = "linux", not(target_arch = "mips"))]
118+
#[cfg(target_os = "linux", target_arch = "x86")]
119+
#[cfg(target_os = "linux", target_arch = "x86_64")]
120+
#[cfg(target_os = "linux", target_arch = "arm")]
113121
#[cfg(target_os = "android")]
114122
mod signal {
115123
use libc;
@@ -153,6 +161,7 @@ mod signal {
153161
}
154162

155163
#[cfg(target_os = "linux", target_arch = "mips")]
164+
#[cfg(target_os = "linux", target_arch = "mipsel")]
156165
mod signal {
157166
use libc;
158167

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
use back::target_strs;
12+
use syntax::abi;
13+
14+
pub fn get_target_strs(target_triple: String, target_os: abi::Os) -> target_strs::t {
15+
return target_strs::t {
16+
module_asm: "".to_string(),
17+
18+
data_layout: match target_os {
19+
abi::OsMacos => {
20+
"e-p:32:32:32\
21+
-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64\
22+
-f32:32:32-f64:64:64\
23+
-v64:64:64-v128:64:128\
24+
-a0:0:64-n32".to_string()
25+
}
26+
27+
abi::OsiOS => {
28+
"e-p:32:32:32\
29+
-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64\
30+
-f32:32:32-f64:64:64\
31+
-v64:64:64-v128:64:128\
32+
-a0:0:64-n32".to_string()
33+
}
34+
35+
abi::OsWin32 => {
36+
"e-p:32:32:32\
37+
-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64\
38+
-f32:32:32-f64:64:64\
39+
-v64:64:64-v128:64:128\
40+
-a0:0:64-n32".to_string()
41+
}
42+
43+
abi::OsLinux => {
44+
"e-p:32:32:32\
45+
-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64\
46+
-f32:32:32-f64:64:64\
47+
-v64:64:64-v128:64:128\
48+
-a0:0:64-n32".to_string()
49+
}
50+
51+
abi::OsAndroid => {
52+
"e-p:32:32:32\
53+
-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64\
54+
-f32:32:32-f64:64:64\
55+
-v64:64:64-v128:64:128\
56+
-a0:0:64-n32".to_string()
57+
}
58+
59+
abi::OsFreebsd => {
60+
"e-p:32:32:32\
61+
-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64\
62+
-f32:32:32-f64:64:64\
63+
-v64:64:64-v128:64:128\
64+
-a0:0:64-n32".to_string()
65+
}
66+
},
67+
68+
target_triple: target_triple,
69+
70+
cc_args: Vec::new(),
71+
};
72+
}

branches/try2/src/librustc/driver/config.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use driver::session::Session;
1818
use back;
1919
use back::link;
2020
use back::target_strs;
21-
use back::{arm, x86, x86_64, mips};
21+
use back::{arm, x86, x86_64, mips, mipsel};
2222
use middle::lint;
2323

2424
use syntax::abi;
@@ -373,7 +373,8 @@ pub fn default_configuration(sess: &Session) -> ast::CrateConfig {
373373
abi::X86 => ("little", "x86", "32"),
374374
abi::X86_64 => ("little", "x86_64", "64"),
375375
abi::Arm => ("little", "arm", "32"),
376-
abi::Mips => ("big", "mips", "32")
376+
abi::Mips => ("big", "mips", "32"),
377+
abi::Mipsel => ("little", "mipsel", "32")
377378
};
378379

379380
let fam = match sess.targ_cfg.os {
@@ -452,6 +453,7 @@ static architecture_abis : &'static [(&'static str, abi::Architecture)] = &'stat
452453
("xscale", abi::Arm),
453454
("thumb", abi::Arm),
454455

456+
("mipsel", abi::Mipsel),
455457
("mips", abi::Mips)];
456458

457459
pub fn build_target_config(sopts: &Options) -> Config {
@@ -470,14 +472,16 @@ pub fn build_target_config(sopts: &Options) -> Config {
470472
abi::X86 => (ast::TyI32, ast::TyU32),
471473
abi::X86_64 => (ast::TyI64, ast::TyU64),
472474
abi::Arm => (ast::TyI32, ast::TyU32),
473-
abi::Mips => (ast::TyI32, ast::TyU32)
475+
abi::Mips => (ast::TyI32, ast::TyU32),
476+
abi::Mipsel => (ast::TyI32, ast::TyU32)
474477
};
475478
let target_triple = sopts.target_triple.clone();
476479
let target_strs = match arch {
477480
abi::X86 => x86::get_target_strs(target_triple, os),
478481
abi::X86_64 => x86_64::get_target_strs(target_triple, os),
479482
abi::Arm => arm::get_target_strs(target_triple, os),
480-
abi::Mips => mips::get_target_strs(target_triple, os)
483+
abi::Mips => mips::get_target_strs(target_triple, os),
484+
abi::Mipsel => mipsel::get_target_strs(target_triple, os)
481485
};
482486
Config {
483487
os: os,

branches/try2/src/librustc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ pub mod back {
9999
pub mod link;
100100
pub mod lto;
101101
pub mod mips;
102+
pub mod mipsel;
102103
pub mod rpath;
103104
pub mod svh;
104105
pub mod target_strs;

branches/try2/src/librustc/middle/trans/adt.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ use middle::trans::type_::Type;
5959
use middle::trans::type_of;
6060
use middle::ty;
6161
use middle::ty::Disr;
62-
use syntax::abi::{X86, X86_64, Arm, Mips};
62+
use syntax::abi::{X86, X86_64, Arm, Mips, Mipsel};
6363
use syntax::ast;
6464
use syntax::attr;
6565
use syntax::attr::IntType;
@@ -365,6 +365,7 @@ fn range_to_inttype(cx: &CrateContext, hint: Hint, bounds: &IntBounds) -> IntTyp
365365
// corresponding to `choose_shortest`. However, we don't run on those yet...?
366366
Arm => at_least_32,
367367
Mips => at_least_32,
368+
Mipsel => at_least_32,
368369
}
369370
}
370371
attr::ReprAny => {

branches/try2/src/librustc/middle/trans/asm.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ pub fn trans_inline_asm<'a>(bcx: &'a Block<'a>, ia: &ast::InlineAsm)
135135

136136
#[cfg(target_arch = "arm")]
137137
#[cfg(target_arch = "mips")]
138+
#[cfg(target_arch = "mipsel")]
138139
fn get_clobbers() -> String {
139140
"".to_string()
140141
}

0 commit comments

Comments
 (0)