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.
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.
11 use back::target_strs;
13 use driver::session::sess_os_to_meta_os;
14 use metadata::loader::meta_section_name;
16 pub fn get_target_strs(target_os: session::os) -> target_strs::t {
17 return target_strs::t {
20 meta_sect_name: meta_section_name(sess_os_to_meta_os(target_os)),
22 data_layout: match target_os {
23 session::os_macos => {
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" +
31 session::os_win32 => {
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" +
39 session::os_linux => {
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" +
47 session::os_android => {
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" +
55 session::os_freebsd => {
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" +
64 target_triple: match target_os {
65 session::os_macos => ~"mips-apple-darwin",
66 session::os_win32 => ~"mips-pc-mingw32",
67 session::os_linux => ~"mips-unknown-linux-gnu",
68 session::os_android => ~"mips-unknown-android-gnu",
69 session::os_freebsd => ~"mips-unknown-freebsd"