Fix sgx porting issues: incorrect compile flags, porting func impl, document, etc. (#145)
* Fix sgx porting issues: incorrect compilation flags, porting function impl, document, etc. * Update bh_platform.c Add check for function bh_vprintf_sgx: check whether print_function is not NULL.
This commit is contained in:
@ -16,6 +16,7 @@ add_definitions(-DOPS_INPUT_OUTPUT=1)
|
||||
add_definitions(-DOPS_UNSAFE_BUFFERS=0)
|
||||
add_definitions(-DWASM_ENABLE_LOG=0)
|
||||
add_definitions(-Dbh_printf=bh_printf_sgx)
|
||||
add_definitions(-Dvprintf=bh_vprintf_sgx)
|
||||
|
||||
if (NOT ("$ENV{VALGRIND}" STREQUAL "YES"))
|
||||
add_definitions(-DNVALGRIND)
|
||||
@ -78,13 +79,17 @@ endif ()
|
||||
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections")
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -fdata-sections -Wall -Wno-unused-parameter -Wno-pedantic")
|
||||
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -nostdinc -fvisibility=hidden -fpie -ffunction-sections -fdata-sections")
|
||||
|
||||
set (SHARED_LIB_DIR ../../../shared-lib)
|
||||
|
||||
include_directories (.
|
||||
../../runtime/include
|
||||
../../runtime/platform/include
|
||||
${SHARED_LIB_DIR}/include
|
||||
$ENV{SGX_SDK}/include)
|
||||
$ENV{SGX_SDK}/include
|
||||
$ENV{SGX_SDK}/include/tlibc
|
||||
$ENV{SGX_SDK}/include/libcxx)
|
||||
|
||||
enable_language (ASM)
|
||||
|
||||
|
||||
@ -4,6 +4,8 @@
|
||||
*/
|
||||
|
||||
enclave {
|
||||
from "sgx_tstdc.edl" import *;
|
||||
|
||||
trusted {
|
||||
/* define ECALLs here. */
|
||||
public void ecall_iwasm_main(void);
|
||||
|
||||
@ -14,14 +14,8 @@
|
||||
#include "wasm_platform_log.h"
|
||||
#include "bh_common.h"
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <pwd.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user