about summary refs log tree commit diff
path: root/compiler/rustc_target/src/spec/hermit_base.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_target/src/spec/hermit_base.rs')
-rw-r--r--compiler/rustc_target/src/spec/hermit_base.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/compiler/rustc_target/src/spec/hermit_base.rs b/compiler/rustc_target/src/spec/hermit_base.rs
new file mode 100644
index 00000000000..e063c94cf2c
--- /dev/null
+++ b/compiler/rustc_target/src/spec/hermit_base.rs
@@ -0,0 +1,25 @@
+use crate::spec::{LinkArgs, LinkerFlavor, LldFlavor, PanicStrategy};
+use crate::spec::{RelocModel, TargetOptions, TlsModel};
+
+pub fn opts() -> TargetOptions {
+    let mut pre_link_args = LinkArgs::new();
+    pre_link_args.insert(
+        LinkerFlavor::Lld(LldFlavor::Ld),
+        vec!["--build-id".to_string(), "--hash-style=gnu".to_string(), "--Bstatic".to_string()],
+    );
+
+    TargetOptions {
+        linker: Some("rust-lld".to_owned()),
+        executables: true,
+        has_elf_tls: true,
+        linker_is_gnu: true,
+        pre_link_args,
+        panic_strategy: PanicStrategy::Abort,
+        position_independent_executables: true,
+        static_position_independent_executables: true,
+        relocation_model: RelocModel::Pic,
+        target_family: None,
+        tls_model: TlsModel::InitialExec,
+        ..Default::default()
+    }
+}