]> git.lizzy.rs Git - rust.git/blob - src/librustc/back/x86_64.rs
librustc: Always use session target triple.
[rust.git] / src / librustc / back / x86_64.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 back::target_strs;
13 use driver::session::sess_os_to_meta_os;
14 use driver::session;
15 use metadata::loader::meta_section_name;
16
17 pub fn get_target_strs(target_triple: ~str, target_os: session::os) -> target_strs::t {
18     return target_strs::t {
19         module_asm: ~"",
20
21         meta_sect_name: meta_section_name(sess_os_to_meta_os(target_os)),
22
23         data_layout: match target_os {
24           session::os_macos => {
25             ~"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-"+
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           session::os_win32 => {
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-"+
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           session::os_linux => {
38             ~"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-"+
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           session::os_android => {
43             ~"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-"+
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           session::os_freebsd => {
49             ~"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-"+
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: ~[~"-m64"]
58     };
59 }