(index<- ) ./librustc/back/x86.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
12 use back::target_strs;
13 use driver::session::sess_os_to_meta_os;
14 use metadata::loader::meta_section_name;
15 use syntax::abi;
16
17 pub fn get_target_strs(target_triple: ~str, target_os: abi::Os) -> target_strs::t {
18 return target_strs::t {
19 module_asm: "".to_owned(),
20
21 meta_sect_name: meta_section_name(sess_os_to_meta_os(target_os)).to_owned(),
22
23 data_layout: match target_os {
24 abi::OsMacos => {
25 "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16".to_owned() +
26 "-i32:32:32-i64:32:64" +
27 "-f32:32:32-f64:32:64-v64:64:64" +
28 "-v128:128:128-a0:0:64-f80:128:128" + "-n8:16:32"
29 }
30
31 abi::OsWin32 => {
32 "e-p:32:32-f64:64:64-i64:64:64-f80:32:32-n8:16:32".to_owned()
33 }
34
35 abi::OsLinux => {
36 "e-p:32:32-f64:32:64-i64:32:64-f80:32:32-n8:16:32".to_owned()
37 }
38 abi::OsAndroid => {
39 "e-p:32:32-f64:32:64-i64:32:64-f80:32:32-n8:16:32".to_owned()
40 }
41
42 abi::OsFreebsd => {
43 "e-p:32:32-f64:32:64-i64:32:64-f80:32:32-n8:16:32".to_owned()
44 }
45 },
46
47 target_triple: target_triple,
48
49 cc_args: vec!("-m32".to_owned()),
50 };
51 }