Fix two bugs that prevents compilation and tests working
This commit is contained in:
		
							parent
							
								
									4b804703b9
								
							
						
					
					
						commit
						3465477cc1
					
				
							
								
								
									
										2
									
								
								deps/sefs
									
									
									
									
										vendored
									
									
								
							
							
								
								
								
								
								
									
									
								
							
						
						
									
										2
									
								
								deps/sefs
									
									
									
									
										vendored
									
									
								
							| @ -1 +1 @@ | |||||||
| Subproject commit 2865c419b3d36a8b0e7ef843b115cb1ecb3176f8 | Subproject commit 166616e5ade1a5c929f705fd1564ef0ea337ba72 | ||||||
| @ -4,8 +4,8 @@ use std::ptr; | |||||||
| use xmas_elf::{header, program, sections, ElfFile}; | use xmas_elf::{header, program, sections, ElfFile}; | ||||||
| 
 | 
 | ||||||
| pub const DEFAULT_STACK_SIZE: usize = 1 * 1024 * 1024; | pub const DEFAULT_STACK_SIZE: usize = 1 * 1024 * 1024; | ||||||
| pub const DEFAULT_HEAP_SIZE: usize = 10 * 1024 * 1024; | pub const DEFAULT_HEAP_SIZE: usize = 8 * 1024 * 1024; | ||||||
| pub const DEFAULT_MMAP_SIZE: usize = 40 * 1024 * 1024; | pub const DEFAULT_MMAP_SIZE: usize = 8 * 1024 * 1024; | ||||||
| 
 | 
 | ||||||
| pub fn do_init(elf_file: &ElfFile, elf_buf: &[u8]) -> Result<ProcessVM, Error> { | pub fn do_init(elf_file: &ElfFile, elf_buf: &[u8]) -> Result<ProcessVM, Error> { | ||||||
|     let mut code_seg = get_code_segment(elf_file)?; |     let mut code_seg = get_code_segment(elf_file)?; | ||||||
|  | |||||||
| @ -254,8 +254,8 @@ int SGX_CDECL main(int argc, const char *argv[]) | |||||||
|     uint64_t libos_startup_time, app_runtime; |     uint64_t libos_startup_time, app_runtime; | ||||||
|     libos_startup_time = (libosready.tv_sec - startup.tv_sec) * 1000000 + (libosready.tv_usec - startup.tv_usec); |     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); |     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("LibOS startup time: %lu microseconds\n", libos_startup_time); | ||||||
|     printf("Apps running time: %d microseconds\n", app_runtime); |     printf("Apps running time: %lu microseconds\n", app_runtime); | ||||||
| 
 | 
 | ||||||
|     /* Destroy the enclave */ |     /* Destroy the enclave */ | ||||||
|     sgx_destroy_enclave(global_eid); |     sgx_destroy_enclave(global_eid); | ||||||
|  | |||||||
| @ -38,7 +38,7 @@ else | |||||||
| endif | endif | ||||||
| 
 | 
 | ||||||
| RUST_SGX_SDK_DIR := $(PROJECT_DIR)/deps/rust-sgx-sdk | 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) | ifneq ($(SGX_MODE), HW) | ||||||
| 	Urts_Library_Name := sgx_urts_sim | 	Urts_Library_Name := sgx_urts_sim | ||||||
| @ -76,7 +76,7 @@ endif | |||||||
| # Export flags used to compile or link untrusted modules
 | # Export flags used to compile or link untrusted modules
 | ||||||
| #
 | #
 | ||||||
| SGX_CFLAGS_T := $(SGX_COMMON_CFLAGS) -nostdinc -fvisibility=hidden -fpie -fstack-protector | 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),
 | # Before use this linker flag, the user should define $(_Other_Enclave_Libs),
 | ||||||
| # and $(_Other_Link_Flags)
 | # and $(_Other_Link_Flags)
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user