(index<- ) ./librustc/back/arm.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 let cc_args = if target_triple.contains("thumb") {
18 vec!("-mthumb".to_owned())
19 } else {
20 vec!("-marm".to_owned())
21 };
22 return target_strs::t {
23 module_asm: "".to_owned(),
24
25 meta_sect_name: meta_section_name(sess_os_to_meta_os(target_os)).to_owned(),
26
27 data_layout: match target_os {
28 abi::OsMacos => {
29 "e-p:32:32:32".to_owned() +
30 "-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64" +
31 "-f32:32:32-f64:64:64" +
32 "-v64:64:64-v128:64:128" +
33 "-a0:0:64-n32"
34 }
35
36 abi::OsWin32 => {
37 "e-p:32:32:32".to_owned() +
38 "-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64" +
39 "-f32:32:32-f64:64:64" +
40 "-v64:64:64-v128:64:128" +
41 "-a0:0:64-n32"
42 }
43
44 abi::OsLinux => {
45 "e-p:32:32:32".to_owned() +
46 "-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64" +
47 "-f32:32:32-f64:64:64" +
48 "-v64:64:64-v128:64:128" +
49 "-a0:0:64-n32"
50 }
51
52 abi::OsAndroid => {
53 "e-p:32:32:32".to_owned() +
54 "-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64" +
55 "-f32:32:32-f64:64:64" +
56 "-v64:64:64-v128:64:128" +
57 "-a0:0:64-n32"
58 }
59
60 abi::OsFreebsd => {
61 "e-p:32:32:32".to_owned() +
62 "-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64" +
63 "-f32:32:32-f64:64:64" +
64 "-v64:64:64-v128:64:128" +
65 "-a0:0:64-n32"
66 }
67 },
68
69 target_triple: target_triple,
70
71 cc_args: cc_args,
72 };
73 }