]> git.lizzy.rs Git - rust.git/blob - src/librustc/back/arm.rs
97c3a588a7fc8d2a5d470a382faf4563229c089f
[rust.git] / src / librustc / back / arm.rs
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 driver::session;
14 use metadata::loader::meta_section_name;
15
16 pub fn get_target_strs(target_os: session::os) -> target_strs::t {
17     return target_strs::t {
18         module_asm: ~"",
19
20         meta_sect_name: meta_section_name(sess_os_to_meta_os(target_os)),
21
22         data_layout: match target_os {
23           session::os_macos => {
24             ~"e-p:32:32:32" +
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           session::os_win32 => {
32             ~"e-p:32:32:32" +
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           session::os_linux => {
40             ~"e-p:32:32:32" +
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           session::os_android => {
48             ~"e-p:32:32:32" +
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           session::os_freebsd => {
56             ~"e-p:32:32:32" +
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: match target_os {
65           session::os_macos => ~"arm-apple-darwin",
66           session::os_win32 => ~"arm-pc-mingw32",
67           session::os_linux => ~"arm-unknown-linux",
68           session::os_android => ~"arm-linux-androideabi",
69           session::os_freebsd => ~"arm-unknown-freebsd"
70         },
71
72         cc_args: ~[~"-marm"]
73     };
74 }
75
76
77 //
78 // Local Variables:
79 // mode: rust
80 // fill-column: 78;
81 // indent-tabs-mode: nil
82 // c-basic-offset: 4
83 // buffer-file-coding-system: utf-8-unix
84 // End:
85 //