]> git.lizzy.rs Git - rust.git/blob - src/librustc_back/target/le32_unknown_nacl.rs
rustc: Specify c_int width for each target
[rust.git] / src / librustc_back / target / le32_unknown_nacl.rs
1 // Copyright 2015 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 use LinkerFlavor;
12 use super::{LinkArgs, Target, TargetOptions, TargetResult};
13
14 pub fn target() -> TargetResult {
15     let mut pre_link_args = LinkArgs::new();
16     pre_link_args.insert(LinkerFlavor::Gcc,
17                          vec!["--pnacl-exceptions=sjlj".to_string(),
18                               "--target=le32-unknown-nacl".to_string(),
19                               "-Wl,--start-group".to_string()]);
20     let mut post_link_args = LinkArgs::new();
21     post_link_args.insert(LinkerFlavor::Gcc,
22                           vec!["-Wl,--end-group".to_string()]);
23
24     let opts = TargetOptions {
25         linker: "pnacl-clang".to_string(),
26         ar: "pnacl-ar".to_string(),
27
28         pre_link_args,
29         post_link_args,
30         dynamic_linking: false,
31         executables: true,
32         exe_suffix: ".pexe".to_string(),
33         linker_is_gnu: true,
34         allow_asm: false,
35         max_atomic_width: Some(32),
36         .. Default::default()
37     };
38     Ok(Target {
39         llvm_target: "le32-unknown-nacl".to_string(),
40         target_endian: "little".to_string(),
41         target_pointer_width: "32".to_string(),
42         target_c_int_width: "32".to_string(),
43         target_os: "nacl".to_string(),
44         target_env: "newlib".to_string(),
45         target_vendor: "unknown".to_string(),
46         data_layout: "e-i64:64:64-p:32:32:32-v128:32:32".to_string(),
47         arch: "le32".to_string(),
48         linker_flavor: LinkerFlavor::Gcc,
49         options: opts,
50     })
51 }