Skip to content

Commit

Permalink
fix sgx_urts undefined reference to t_signal_handler_ecall error
Browse files Browse the repository at this point in the history
Use signal feature to control compilation of sgx_urts::signal
  • Loading branch information
volcano0dr committed May 8, 2020
1 parent 9f85fdb commit 6b7a3f0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions sgx_urts/Cargo.toml
Expand Up @@ -16,6 +16,7 @@ crate-type = ["rlib"]
default = []
global_init = []
global_exit = []
signal = []


[dependencies]
Expand Down
1 change: 1 addition & 0 deletions sgx_urts/src/lib.rs
Expand Up @@ -32,6 +32,7 @@ pub mod pipe;
pub mod event;
pub mod thread;
pub mod net;
#[cfg(feature = "signal")]
pub mod signal;
pub mod process;
pub use enclave::*;
8 changes: 4 additions & 4 deletions sgx_urts/src/signal.rs
Expand Up @@ -41,7 +41,7 @@ extern "C" {
pub struct SigNum(i32);

impl SigNum {
// add code here

pub fn from_raw(signo: i32) -> Option<SigNum> {
if signo <= 0 || signo >= NSIG {
None
Expand All @@ -59,7 +59,7 @@ impl SigNum {
pub struct SigSet(sigset_t);

impl SigSet {
// add code here

pub fn new() -> SigSet {
let set = unsafe {
let mut set: sigset_t = mem::zeroed();
Expand All @@ -82,7 +82,7 @@ struct GlobalData {
}

impl GlobalData {
// add code here

fn get() -> &'static GlobalData {
unsafe { GLOBAL_DATA.as_ref().unwrap() }
}
Expand All @@ -101,7 +101,7 @@ struct SignalDispatcher {
}

impl SignalDispatcher {
// add code here

pub fn new () -> SignalDispatcher {
SignalDispatcher {
signal_set: Mutex::new(HashMap::new()),
Expand Down

0 comments on commit 6b7a3f0

Please sign in to comment.