From 76f884abb979656f368ef39d0338b609323e43aa Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Wed, 5 May 2021 01:03:50 +0200 Subject: [PATCH] rename LLVM target for RustyHermit RustyHermit ist is a library operating system. In this case, we link a static library as kernel to the application. The final result is a bootable application. The library and the application have to use the same target. Currently, the targets are different (see also https://github.com/rust-lang/rust/blob/master/compiler/rustc_target/src/spec/x86_64_unknown_hermit.rs). Consequently, this commit change the LLVM target to 'hermit'. This kernel spec is needed to disable the usage of FPU registers, which are not allowed in kernel space. In contrast to Linux, everything is running in ring 0 and also in the same address space. Signed-off-by: Stefan Lankes --- .../rustc_target/src/spec/x86_64_unknown_none_hermitkernel.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_target/src/spec/x86_64_unknown_none_hermitkernel.rs b/compiler/rustc_target/src/spec/x86_64_unknown_none_hermitkernel.rs index 28d9801b78cb5..359cb0f6881de 100644 --- a/compiler/rustc_target/src/spec/x86_64_unknown_none_hermitkernel.rs +++ b/compiler/rustc_target/src/spec/x86_64_unknown_none_hermitkernel.rs @@ -11,7 +11,7 @@ pub fn target() -> Target { base.stack_probes = StackProbeType::Call; Target { - llvm_target: "x86_64-unknown-none-elf".to_string(), + llvm_target: "x86_64-unknown-hermit".to_string(), pointer_width: 64, data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" .to_string(),