]> git.lizzy.rs Git - rust.git/blob - src/librustc_back/x86.rs
auto merge of #15867 : cmr/rust/rewrite-lexer4, r=alexcrichton
[rust.git] / src / librustc_back / x86.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
12 use target_strs;
13 use syntax::abi;
14
15 pub fn get_target_strs(target_triple: String, target_os: abi::Os)
16                        -> target_strs::t {
17     return target_strs::t {
18         module_asm: "".to_string(),
19
20         data_layout: match target_os {
21           abi::OsMacos => {
22             "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16\
23                 -i32:32:32-i64:32:64\
24                 -f32:32:32-f64:32:64-v64:64:64\
25                 -v128:128:128-a0:0:64-f80:128:128\
26                 -n8:16:32".to_string()
27           }
28
29           abi::OsiOS => {
30             "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16\
31                 -i32:32:32-i64:32:64\
32                 -f32:32:32-f64:32:64-v64:64:64\
33                 -v128:128:128-a0:0:64-f80:128:128\
34                 -n8:16:32".to_string()
35           }
36
37           abi::OsWin32 => {
38             "e-p:32:32-f64:64:64-i64:64:64-f80:32:32-n8:16:32".to_string()
39           }
40
41           abi::OsLinux => {
42             "e-p:32:32-f64:32:64-i64:32:64-f80:32:32-n8:16:32".to_string()
43           }
44           abi::OsAndroid => {
45             "e-p:32:32-f64:32:64-i64:32:64-f80:32:32-n8:16:32".to_string()
46           }
47
48           abi::OsFreebsd => {
49             "e-p:32:32-f64:32:64-i64:32:64-f80:32:32-n8:16:32".to_string()
50           }
51         },
52
53         target_triple: target_triple,
54
55         cc_args: vec!("-m32".to_string()),
56     };
57 }