1 // Copyright 2018 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.
13 use super::{LinkerFlavor, Target, TargetOptions, PanicStrategy};
15 pub fn target() -> Result<Target, String> {
16 const PRE_LINK_ARGS: &[&str] = &[
30 "-Wl,--error-unresolved-symbols",
31 "-Wl,--no-undefined-version",
33 "-Wl,--export-dynamic",
35 const EXPORT_SYMBOLS: &[&str] = &[
45 let opts = TargetOptions {
46 dynamic_linking: false,
49 max_atomic_width: Some(64),
50 panic_strategy: PanicStrategy::Abort,
52 position_independent_executables: true,
53 pre_link_args: iter::once(
54 (LinkerFlavor::Gcc, PRE_LINK_ARGS.iter().cloned().map(String::from).collect())
56 override_export_symbols: Some(EXPORT_SYMBOLS.iter().cloned().map(String::from).collect()),
60 llvm_target: "x86_64-unknown-linux-gnu".into(),
61 target_endian: "little".into(),
62 target_pointer_width: "64".into(),
63 target_c_int_width: "32".into(),
64 target_os: "unknown".into(),
65 target_env: "sgx".into(),
66 target_vendor: "fortanix".into(),
67 data_layout: "e-m:e-i64:64-f80:128-n8:16:32:64-S128".into(),
68 arch: "x86_64".into(),
69 linker_flavor: LinkerFlavor::Gcc,