-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
redesign of the interface to the unikernel HermitCore
- the old interface between HermitCore and the Rust Standard Library based on a small C library (newlib) - remove this interface and call directly the unikernel - remove the dependency to the HermitCore linker - use rust-lld as linker
- Loading branch information
Showing
51 changed files
with
2,388 additions
and
451 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//! Unwinding for *hermit* target. | ||
//! | ||
//! Right now we don't support this, so this is just stubs. | ||
use alloc::boxed::Box; | ||
use core::ptr; | ||
use core::any::Any; | ||
|
||
pub fn payload() -> *mut u8 { | ||
ptr::null_mut() | ||
} | ||
|
||
pub unsafe fn cleanup(_ptr: *mut u8) -> Box<dyn Any + Send> { | ||
extern "C" { pub fn __rust_abort() -> !; } | ||
__rust_abort(); | ||
} | ||
|
||
pub unsafe fn panic(_data: Box<dyn Any + Send>) -> u32 { | ||
extern "C" { pub fn __rust_abort() -> !; } | ||
__rust_abort(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
use crate::spec::{LinkArgs, LinkerFlavor, PanicStrategy, TargetOptions}; | ||
use crate::spec::{LldFlavor, LinkArgs, LinkerFlavor, PanicStrategy, TargetOptions}; | ||
use std::default::Default; | ||
|
||
pub fn opts() -> TargetOptions { | ||
let mut args = LinkArgs::new(); | ||
args.insert(LinkerFlavor::Gcc, vec![ | ||
"-Wl,-Bstatic".to_string(), | ||
"-Wl,--no-dynamic-linker".to_string(), | ||
"-Wl,--gc-sections".to_string(), | ||
"-Wl,--as-needed".to_string(), | ||
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, | ||
no_default_libraries: false, | ||
pre_link_args, | ||
no_default_libraries: true, | ||
panic_strategy: PanicStrategy::Abort, | ||
position_independent_executables: false, | ||
pre_link_args: args, | ||
position_independent_executables: true, | ||
relocation_model: "static".to_string(), | ||
target_family: Some("unix".to_string()), | ||
tls_model: "local-exec".to_string(), | ||
target_family: None, | ||
tls_model: "initial-exec".to_string(), | ||
.. Default::default() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.