Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c171983
Merge pull request #7 from intel/master
wenyongh May 17, 2019
3b9cc32
Merge pull request #8 from intel/master
wenyongh May 17, 2019
a333655
Merge pull request #9 from intel/master
wenyongh May 20, 2019
81d4669
Merge pull request #10 from intel/master
wenyongh May 23, 2019
8d65395
Implement memory profiler, optimize memory usage, modify code indent
wenyongh May 23, 2019
0d60a69
Merge pull request #11 from intel/master
wenyongh May 23, 2019
f32965b
Implement memory.grow and limit heap space base offset to 1G; modify …
wenyongh May 31, 2019
0fede7b
Merge pull request #12 from intel/master
wenyongh May 31, 2019
ee19aff
Merge pull request #13 from intel/master
wenyongh Jun 8, 2019
1772183
Add a new extension library: connection
wenyongh Jun 11, 2019
624c58f
Fix bug of reading magic number and version in big endian platform
wenyongh Jun 14, 2019
c27a72d
Merge pull request #14 from intel/master
wenyongh Jun 14, 2019
5c0c30e
Merge pull request #15 from intel/master
wenyongh Jun 14, 2019
781f2ec
Merge pull request #16 from intel/master
wenyongh Jul 10, 2019
c290de7
Re-org platform APIs: move most platform APIs from iwasm to shared-lib
wenyongh Jul 22, 2019
186800a
Merge pull request #17 from intel/master
wenyongh Jul 22, 2019
d6d0e02
Merge pull request #18 from intel/master
wenyongh Aug 1, 2019
a59616e
Merge pull request #19 from intel/master
wenyongh Aug 2, 2019
d518e64
Enhance wasm loader to fix some security issues
wenyongh Aug 8, 2019
311ce9a
Merge pull request #20 from intel/master
wenyongh Aug 8, 2019
7a08c3d
Merge pull request #21 from intel/master
wenyongh Aug 14, 2019
6a318c4
Fix issue about illegal load of EXC_RETURN into PC on stm32 board
wenyongh Aug 14, 2019
ca601f5
Merge pull request #22 from intel/master
wenyongh Aug 14, 2019
e119204
Updates that let a restricted version of the interpreter run in SGX
wenyongh Aug 19, 2019
ad3c0f2
Merge pull request #1 from wenyongh/master
cmickeyb Aug 19, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,026 changes: 1,026 additions & 0 deletions core/iwasm/lib/native/libc/libc_wrapper_sgx.c

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/iwasm/lib/native/libc/wasm_libc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ set (WASM_LIBC_DIR ${CMAKE_CURRENT_LIST_DIR})
include_directories(${WASM_LIBC_DIR})


file (GLOB_RECURSE source_all ${WASM_LIBC_DIR}/*.c)
file (GLOB_RECURSE source_all ${WASM_LIBC_DIR}/libc_wrapper.c)

set (WASM_LIBC_SOURCE ${source_all})

23 changes: 23 additions & 0 deletions core/iwasm/lib/native/libc/wasm_libc_sgx.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (C) 2019 Intel Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set (WASM_LIBC_DIR ${CMAKE_CURRENT_LIST_DIR})

include_directories(${WASM_LIBC_DIR})


file (GLOB_RECURSE source_all ${WASM_LIBC_DIR}/libc_wrapper_sgx.c)

set (WASM_LIBC_SOURCE ${source_all})

89 changes: 89 additions & 0 deletions core/iwasm/products/linux-sgx/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Copyright (C) 2019 Intel Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

cmake_minimum_required (VERSION 2.8)

project (iwasm)

set (PLATFORM "linux-sgx")

# Reset default linker flags
set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
set (CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")

add_definitions(-DUSE_SGX=1)
add_definitions(-DOPS_INPUT_OUTPUT=1)
add_definitions(-DOPS_UNSAFE_BUFFERS=0)
add_definitions(-DWASM_ENABLE_LOG=0)

# Enable repl mode if want to test spec cases
# add_definitions(-DWASM_ENABLE_REPL)

if (NOT ("$ENV{VALGRIND}" STREQUAL "YES"))
add_definitions(-DNVALGRIND)
endif ()

# Currently build as 64-bit by default.
set (BUILD_AS_64BIT_SUPPORT "YES")

if (CMAKE_SIZEOF_VOID_P EQUAL 8)
if (${BUILD_AS_64BIT_SUPPORT} STREQUAL "YES")
# Add -fPIC flag if build as 64-bit
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -fPIC")
else ()
add_definitions (-m32)
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32")
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32")
endif ()
endif ()

if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif (NOT CMAKE_BUILD_TYPE)
message ("CMAKE_BUILD_TYPE = " ${CMAKE_BUILD_TYPE})

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 (SHARED_LIB_DIR ../../../shared-lib)

include_directories (.
../../runtime/include
../../runtime/platform/include
${SHARED_LIB_DIR}/include
$ENV{SGX_SDK}/include)

enable_language (ASM)

include (../../runtime/platform/${PLATFORM}/platform.cmake)
include (../../runtime/utils/utils.cmake)
include (../../runtime/vmcore-wasm/vmcore.cmake)
include (../../lib/native/base/wasm_lib_base.cmake)
include (../../lib/native/libc/wasm_libc_sgx.cmake)
include (${SHARED_LIB_DIR}/platform/${PLATFORM}/shared_platform.cmake)
include (${SHARED_LIB_DIR}/mem-alloc/mem_alloc.cmake)

#add_executable (iwasm main.c ext_lib_export.c)


add_library (vmlib
ext_lib_export.c
${WASM_PLATFORM_LIB_SOURCE}
${WASM_UTILS_LIB_SOURCE}
${VMCORE_LIB_SOURCE}
${WASM_LIB_BASE_DIR}/base_lib_export.c
${WASM_LIBC_SOURCE}
${PLATFORM_SHARED_SOURCE}
${MEM_ALLOC_SHARED_SOURCE})
21 changes: 21 additions & 0 deletions core/iwasm/products/linux-sgx/ext_lib_export.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright (C) 2019 Intel Corporation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "lib_export.h"

static NativeSymbol extended_native_symbol_defs[] = { };

#include "ext_lib_export.h"
4 changes: 3 additions & 1 deletion core/iwasm/runtime/platform/include/wasm_platform_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
#ifndef _WASM_PLATFORM_LOG
#define _WASM_PLATFORM_LOG

#define wasm_printf printf
#include "bh_platform.h"

#define wasm_printf bh_printf

#define wasm_vprintf vprintf

Expand Down
25 changes: 25 additions & 0 deletions core/iwasm/runtime/platform/linux-sgx/platform.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (C) 2019 Intel Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

add_definitions (-D__POSIX__ -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=199309L)

set (PLATFORM_LIB_DIR ${CMAKE_CURRENT_LIST_DIR})

include_directories(${PLATFORM_LIB_DIR})
include_directories(${PLATFORM_LIB_DIR}/../include)

file (GLOB_RECURSE source_all ${PLATFORM_LIB_DIR}/*.c)

set (WASM_PLATFORM_LIB_SOURCE ${source_all})

Loading