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:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-".to_owned()+
26 "f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-"+
27 "s0:64:64-f80:128:128-n8:16:32:64"
28 }
29
30 abi::OsWin32 => {
31 // FIXME: Test this. Copied from linux (#2398)
32 "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-".to_owned()+
33 "f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-"+
34 "s0:64:64-f80:128:128-n8:16:32:64-S128"
35 }
36
37 abi::OsLinux => {
38 "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-".to_owned()+
39 "f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-"+
40 "s0:64:64-f80:128:128-n8:16:32:64-S128"
41 }
42 abi::OsAndroid => {
43 "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-".to_owned()+
44 "f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-"+
45 "s0:64:64-f80:128:128-n8:16:32:64-S128"
46 }
47
48 abi::OsFreebsd => {
49 "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-".to_owned()+
50 "f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-"+
51 "s0:64:64-f80:128:128-n8:16:32:64-S128"
52 }
53 },
54
55 target_triple: target_triple,
56
57 cc_args: vec!("-m64".to_owned()),
58 };
59 }