From 3465477cc15147377b072587d5329f60aec40cfe Mon Sep 17 00:00:00 2001 From: "Tate, Hongliang Tian" Date: Mon, 29 Apr 2019 00:56:02 +0800 Subject: [PATCH] Fix two bugs that prevents compilation and tests working --- deps/sefs | 2 +- src/libos/src/process/spawn/init_vm.rs | 4 ++-- src/pal/pal.c | 4 ++-- src/sgxenv.mk | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/deps/sefs b/deps/sefs index 2865c419..166616e5 160000 --- a/deps/sefs +++ b/deps/sefs @@ -1 +1 @@ -Subproject commit 2865c419b3d36a8b0e7ef843b115cb1ecb3176f8 +Subproject commit 166616e5ade1a5c929f705fd1564ef0ea337ba72 diff --git a/src/libos/src/process/spawn/init_vm.rs b/src/libos/src/process/spawn/init_vm.rs index 246a870a..9a0fc11e 100644 --- a/src/libos/src/process/spawn/init_vm.rs +++ b/src/libos/src/process/spawn/init_vm.rs @@ -4,8 +4,8 @@ use std::ptr; use xmas_elf::{header, program, sections, ElfFile}; pub const DEFAULT_STACK_SIZE: usize = 1 * 1024 * 1024; -pub const DEFAULT_HEAP_SIZE: usize = 10 * 1024 * 1024; -pub const DEFAULT_MMAP_SIZE: usize = 40 * 1024 * 1024; +pub const DEFAULT_HEAP_SIZE: usize = 8 * 1024 * 1024; +pub const DEFAULT_MMAP_SIZE: usize = 8 * 1024 * 1024; pub fn do_init(elf_file: &ElfFile, elf_buf: &[u8]) -> Result { let mut code_seg = get_code_segment(elf_file)?; diff --git a/src/pal/pal.c b/src/pal/pal.c index f0937c6a..87514a21 100644 --- a/src/pal/pal.c +++ b/src/pal/pal.c @@ -254,8 +254,8 @@ int SGX_CDECL main(int argc, const char *argv[]) uint64_t libos_startup_time, app_runtime; libos_startup_time = (libosready.tv_sec - startup.tv_sec) * 1000000 + (libosready.tv_usec - startup.tv_usec); app_runtime = (appdie.tv_sec - libosready.tv_sec) * 1000000 + (appdie.tv_usec - libosready.tv_usec); - printf("LibOS startup time: %d microseconds\n", libos_startup_time); - printf("Apps running time: %d microseconds\n", app_runtime); + printf("LibOS startup time: %lu microseconds\n", libos_startup_time); + printf("Apps running time: %lu microseconds\n", app_runtime); /* Destroy the enclave */ sgx_destroy_enclave(global_eid); diff --git a/src/sgxenv.mk b/src/sgxenv.mk index d57fb414..4c06ec85 100644 --- a/src/sgxenv.mk +++ b/src/sgxenv.mk @@ -38,7 +38,7 @@ else endif RUST_SGX_SDK_DIR := $(PROJECT_DIR)/deps/rust-sgx-sdk -SGX_COMMON_CFLAGS += -I$(RUST_SGX_SDK_DIR)/common/ -I$(RUST_SGX_SDK_DIR)/common/inc/ -I$(RUST_SGX_SDK_DIR)/edl/ +SGX_COMMON_CFLAGS += -I$(RUST_SGX_SDK_DIR)/common/ -I$(RUST_SGX_SDK_DIR)/edl/ ifneq ($(SGX_MODE), HW) Urts_Library_Name := sgx_urts_sim @@ -76,7 +76,7 @@ endif # Export flags used to compile or link untrusted modules # SGX_CFLAGS_T := $(SGX_COMMON_CFLAGS) -nostdinc -fvisibility=hidden -fpie -fstack-protector -SGX_CFLAGS_T += -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/stlport -I$(SGX_SDK)/include/epid +SGX_CFLAGS_T += -I$(RUST_SGX_SDK_DIR)/common/inc/ -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/stlport -I$(SGX_SDK)/include/epid # Before use this linker flag, the user should define $(_Other_Enclave_Libs), # and $(_Other_Link_Flags)