alnyan/yggdrasil: add support for x86_64
This commit is contained in:
@@ -1270,6 +1270,7 @@ supported_targets! {
|
||||
("armv7-unknown-linux-ohos", armv7_unknown_linux_ohos),
|
||||
|
||||
("aarch64-unknown-yggdrasil", aarch64_unknown_yggdrasil),
|
||||
("x86_64-unknown-yggdrasil", x86_64_unknown_yggdrasil),
|
||||
}
|
||||
|
||||
/// Cow-Vec-Str: Cow<'static, [Cow<'static, str>]>
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
use crate::spec::{PanicStrategy, Target};
|
||||
|
||||
// Have specific requirements about how segments are aligned
|
||||
const LINKER_SCRIPT: &str = include_str!("./x86_64_unknown_yggdrasil_linker_script.ld");
|
||||
|
||||
pub fn target() -> Target {
|
||||
let mut base = super::yggdrasil_base::opts();
|
||||
|
||||
base.disable_redzone = true;
|
||||
base.panic_strategy = PanicStrategy::Abort;
|
||||
base.link_script = Some(LINKER_SCRIPT.into());
|
||||
|
||||
Target {
|
||||
llvm_target: "x86_64-unknown-linux-gnu".into(),
|
||||
pointer_width: 64,
|
||||
arch: "x86_64".into(),
|
||||
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
|
||||
.into(),
|
||||
options: base,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
ENTRY(runtime_entry)
|
||||
|
||||
BASE_ADDR = 0x400000;
|
||||
|
||||
SECTIONS {
|
||||
. = BASE_ADDR;
|
||||
|
||||
.text : {
|
||||
*(.text*)
|
||||
*(.plt*)
|
||||
}
|
||||
|
||||
. = ALIGN(4K);
|
||||
|
||||
.rodata : {
|
||||
*(.rodata*)
|
||||
}
|
||||
|
||||
. = ALIGN(4K);
|
||||
|
||||
.data : {
|
||||
*(.data*)
|
||||
*(.got*)
|
||||
}
|
||||
|
||||
. = ALIGN(4K);
|
||||
|
||||
.bss : {
|
||||
*(COMMON)
|
||||
*(.bss*)
|
||||
}
|
||||
}
|
||||
@@ -133,6 +133,7 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
|
||||
Ok(OsError::NotADirectory) => ErrorKind::NotADirectory,
|
||||
Ok(OsError::DirectoryNotEmpty) => ErrorKind::DirectoryNotEmpty,
|
||||
Ok(OsError::Interrupted) => ErrorKind::Interrupted,
|
||||
Ok(OsError::WouldBlock) => ErrorKind::WouldBlock,
|
||||
|
||||
// Memory and general
|
||||
Ok(OsError::OutOfMemory) => ErrorKind::OutOfMemory,
|
||||
|
||||
+1
-1
Submodule yggdrasil-rt updated: adfc37dde4...ed2cf05838
Reference in New Issue
Block a user