2021-02-16 00:46:14 +00:00
|
|
|
use crate::abi::Endian;
|
2023-01-20 18:34:24 +01:00
|
|
|
use crate::spec::{SanitizerSet, StackProbeType, Target};
|
2021-02-16 00:46:14 +00:00
|
|
|
|
|
|
|
pub fn target() -> Target {
|
|
|
|
let mut base = super::linux_musl_base::opts();
|
|
|
|
base.endian = Endian::Big;
|
|
|
|
// z10 is the oldest CPU supported by LLVM
|
2022-03-22 11:43:05 +01:00
|
|
|
base.cpu = "z10".into();
|
2022-09-29 18:18:26 -07:00
|
|
|
// FIXME: The ABI implementation in cabi_s390x.rs is for now hard-coded to assume the no-vector
|
|
|
|
// ABI. Pass the -vector feature string to LLVM to respect this assumption. On LLVM < 16, we
|
|
|
|
// also strip v128 from the data_layout below to match the older LLVM's expectation.
|
2022-03-22 11:43:05 +01:00
|
|
|
base.features = "-vector".into();
|
2021-02-16 00:46:14 +00:00
|
|
|
base.max_atomic_width = Some(64);
|
|
|
|
base.min_global_align = Some(16);
|
|
|
|
base.static_position_independent_executables = true;
|
2022-09-26 13:40:24 -07:00
|
|
|
base.stack_probes = StackProbeType::Inline;
|
2023-01-20 18:34:24 +01:00
|
|
|
base.supported_sanitizers =
|
|
|
|
SanitizerSet::ADDRESS | SanitizerSet::LEAK | SanitizerSet::MEMORY | SanitizerSet::THREAD;
|
2021-02-16 00:46:14 +00:00
|
|
|
|
|
|
|
Target {
|
2022-03-22 11:43:05 +01:00
|
|
|
llvm_target: "s390x-unknown-linux-musl".into(),
|
2021-02-16 00:46:14 +00:00
|
|
|
pointer_width: 64,
|
2022-09-29 18:18:26 -07:00
|
|
|
data_layout: "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64".into(),
|
2022-03-22 11:43:05 +01:00
|
|
|
arch: "s390x".into(),
|
2021-02-16 00:46:14 +00:00
|
|
|
options: base,
|
|
|
|
}
|
|
|
|
}
|