(index<- ) ./librustc/back/mips.rs
git branch: * master 5200215 auto merge of #14035 : alexcrichton/rust/experimental, r=huonw
modified: Sat Apr 19 11:22:39 2014
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 driver::session::sess_os_to_meta_os;
13 use metadata::loader::meta_section_name;
14 use syntax::abi;
15
16 pub fn get_target_strs(target_triple: ~str, target_os: abi::Os) -> target_strs::t {
17 return target_strs::t {
18 module_asm: "".to_owned(),
19
20 meta_sect_name: meta_section_name(sess_os_to_meta_os(target_os)).to_owned(),
21
22 data_layout: match target_os {
23 abi::OsMacos => {
24 "E-p:32:32:32".to_owned() +
25 "-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64" +
26 "-f32:32:32-f64:64:64" +
27 "-v64:64:64-v128:64:128" +
28 "-a0:0:64-n32"
29 }
30
31 abi::OsWin32 => {
32 "E-p:32:32:32".to_owned() +
33 "-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64" +
34 "-f32:32:32-f64:64:64" +
35 "-v64:64:64-v128:64:128" +
36 "-a0:0:64-n32"
37 }
38
39 abi::OsLinux => {
40 "E-p:32:32:32".to_owned() +
41 "-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64" +
42 "-f32:32:32-f64:64:64" +
43 "-v64:64:64-v128:64:128" +
44 "-a0:0:64-n32"
45 }
46
47 abi::OsAndroid => {
48 "E-p:32:32:32".to_owned() +
49 "-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64" +
50 "-f32:32:32-f64:64:64" +
51 "-v64:64:64-v128:64:128" +
52 "-a0:0:64-n32"
53 }
54
55 abi::OsFreebsd => {
56 "E-p:32:32:32".to_owned() +
57 "-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64" +
58 "-f32:32:32-f64:64:64" +
59 "-v64:64:64-v128:64:128" +
60 "-a0:0:64-n32"
61 }
62 },
63
64 target_triple: target_triple,
65
66 cc_args: Vec::new(),
67 };
68 }