|
| 1 | +use crate::spec::{Cc, FloatAbi, LinkerFlavor, Lld, Target, base}; |
| 2 | + |
| 3 | +pub(crate) fn target() -> Target { |
| 4 | + let mut base = base::helenos::opts(); |
| 5 | + base.abi = "eabi".into(); |
| 6 | + base.llvm_floatabi = Some(FloatAbi::Soft); |
| 7 | + base.max_atomic_width = Some(32); |
| 8 | + base.features = "+soft-float,+strict-align,+atomics-32".into(); |
| 9 | + base.has_thumb_interworking = true; |
| 10 | + base.linker = Some("arm-helenos-gcc".into()); |
| 11 | + base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-march=armv5te"]); |
| 12 | + |
| 13 | + // FIXME: these 3 flags are a hack to avoid generating R_*_RELATIVE relocations in code segment, |
| 14 | + // which cause the HelenOS loader to segfault. I believe the underlying issue is that HelenOS |
| 15 | + // doesn't map the code segment as writable, so the loader can't apply the relocations. |
| 16 | + // The same issue was with the i686-helenos target, I don't recall why the current combination |
| 17 | + // of flags avoids the issue there. |
| 18 | + base.crt_static_default = true; |
| 19 | + base.crt_static_respected = false; |
| 20 | + base.crt_static_allows_dylibs = true; |
| 21 | + |
| 22 | + Target { |
| 23 | + llvm_target: "armv5te-unknown-helenos-eabi".into(), |
| 24 | + metadata: crate::spec::TargetMetadata { |
| 25 | + description: Some("ARMv5te HelenOS".into()), |
| 26 | + tier: Some(3), |
| 27 | + host_tools: Some(false), |
| 28 | + std: Some(true), |
| 29 | + }, |
| 30 | + pointer_width: 32, |
| 31 | + data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(), |
| 32 | + arch: "arm".into(), |
| 33 | + options: base, |
| 34 | + } |
| 35 | +} |
0 commit comments