]> git.lizzy.rs Git - rust.git/blob - src/librustc_back/target/s390x_unknown_linux_gnu.rs
aad9effacd440460898b21f105a3818b2b314ef9
[rust.git] / src / librustc_back / target / s390x_unknown_linux_gnu.rs
1 // Copyright 2016 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 target::{Target, TargetResult};
13
14 pub fn target() -> TargetResult {
15     let mut base = super::linux_base::opts();
16     // z10 is the oldest CPU supported by LLVM
17     base.cpu = "z10".to_string();
18     // FIXME: The data_layout string below and the ABI implementation in
19     // cabi_s390x.rs are for now hard-coded to assume the no-vector ABI.
20     // Pass the -vector feature string to LLVM to respect this assumption.
21     base.features = "-vector".to_string();
22     base.max_atomic_width = Some(64);
23     // see #36994
24     base.exe_allocation_crate = None;
25     base.min_global_align = Some(16);
26
27     Ok(Target {
28         llvm_target: "s390x-unknown-linux-gnu".to_string(),
29         target_endian: "big".to_string(),
30         target_pointer_width: "64".to_string(),
31         data_layout: "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-a:8:16-n32:64".to_string(),
32         arch: "s390x".to_string(),
33         target_os: "linux".to_string(),
34         target_env: "gnu".to_string(),
35         target_vendor: "unknown".to_string(),
36         linker_flavor: LinkerFlavor::Gcc,
37         options: base,
38     })
39 }