mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-06-18 02:59:21 +00:00
Compare commits
11 Commits
df13e6ef67
...
7ec1ebd15f
Author | SHA1 | Date | |
---|---|---|---|
![]() |
7ec1ebd15f | ||
![]() |
0e8b57d8a8 | ||
![]() |
88b5f6a535 | ||
![]() |
ac2fe552d5 | ||
![]() |
ea417d7619 | ||
![]() |
bb36a43fa4 | ||
![]() |
6aa94f0edf | ||
![]() |
7daf2d346d | ||
![]() |
e07859026d | ||
![]() |
10d579cf8a | ||
![]() |
9ae55e7ee7 |
|
@ -898,6 +898,17 @@ aot_intrinsic_fill_capability_flags(AOTCompContext *comp_ctx)
|
||||||
if (!strncmp(comp_ctx->target_arch, "riscv32", 7)) {
|
if (!strncmp(comp_ctx->target_arch, "riscv32", 7)) {
|
||||||
add_i64_common_intrinsics(comp_ctx);
|
add_i64_common_intrinsics(comp_ctx);
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
* LLVM 16 and later expands cttz intrinsic to a table lookup,
|
||||||
|
* which involves some relocations. (unless ZBB is available,
|
||||||
|
* in which case the native instructions are preferred over
|
||||||
|
* the table-based lowering.)
|
||||||
|
* https://reviews.llvm.org/D128911
|
||||||
|
*/
|
||||||
|
#if LLVM_VERSION_MAJOR >= 16
|
||||||
|
add_intrinsic_capability(comp_ctx, AOT_INTRINSIC_FLAG_I32_CTZ);
|
||||||
|
add_intrinsic_capability(comp_ctx, AOT_INTRINSIC_FLAG_I64_CTZ);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else if (!strncmp(comp_ctx->target_arch, "xtensa", 6)) {
|
else if (!strncmp(comp_ctx->target_arch, "xtensa", 6)) {
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -4007,8 +4007,12 @@ aot_resolve_object_relocation_group(AOTObjectData *obj_data,
|
||||||
&& (str_starts_with(relocation->symbol_name, ".LCPI")
|
&& (str_starts_with(relocation->symbol_name, ".LCPI")
|
||||||
|| str_starts_with(relocation->symbol_name, ".LJTI")
|
|| str_starts_with(relocation->symbol_name, ".LJTI")
|
||||||
|| str_starts_with(relocation->symbol_name, ".LBB")
|
|| str_starts_with(relocation->symbol_name, ".LBB")
|
||||||
|| str_starts_with(relocation->symbol_name,
|
|| str_starts_with(relocation->symbol_name, ".Lswitch.table.")
|
||||||
".Lswitch.table."))) {
|
#if LLVM_VERSION_MAJOR >= 16
|
||||||
|
/* cf. https://reviews.llvm.org/D123264 */
|
||||||
|
|| str_starts_with(relocation->symbol_name, ".Lpcrel_hi")
|
||||||
|
#endif
|
||||||
|
)) {
|
||||||
/* change relocation->relocation_addend and
|
/* change relocation->relocation_addend and
|
||||||
relocation->symbol_name */
|
relocation->symbol_name */
|
||||||
LLVMSectionIteratorRef contain_section;
|
LLVMSectionIteratorRef contain_section;
|
||||||
|
|
|
@ -9197,6 +9197,15 @@ preserve_referenced_local(WASMLoaderContext *loader_ctx, uint8 opcode,
|
||||||
loader_ctx->preserved_local_offset += 2;
|
loader_ctx->preserved_local_offset += 2;
|
||||||
emit_label(EXT_OP_COPY_STACK_TOP_I64);
|
emit_label(EXT_OP_COPY_STACK_TOP_I64);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* overflow */
|
||||||
|
if (preserved_offset > loader_ctx->preserved_local_offset) {
|
||||||
|
set_error_buf_v(error_buf, error_buf_size,
|
||||||
|
"too much local cells 0x%x",
|
||||||
|
loader_ctx->preserved_local_offset);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
emit_operand(loader_ctx, local_index);
|
emit_operand(loader_ctx, local_index);
|
||||||
emit_operand(loader_ctx, preserved_offset);
|
emit_operand(loader_ctx, preserved_offset);
|
||||||
emit_label(opcode);
|
emit_label(opcode);
|
||||||
|
|
|
@ -4778,6 +4778,11 @@ preserve_referenced_local(WASMLoaderContext *loader_ctx, uint8 opcode,
|
||||||
loader_ctx->preserved_local_offset += 2;
|
loader_ctx->preserved_local_offset += 2;
|
||||||
emit_label(EXT_OP_COPY_STACK_TOP_I64);
|
emit_label(EXT_OP_COPY_STACK_TOP_I64);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* overflow */
|
||||||
|
bh_assert(preserved_offset
|
||||||
|
<= loader_ctx->preserved_local_offset);
|
||||||
|
|
||||||
emit_operand(loader_ctx, local_index);
|
emit_operand(loader_ctx, local_index);
|
||||||
emit_operand(loader_ctx, preserved_offset);
|
emit_operand(loader_ctx, preserved_offset);
|
||||||
emit_label(opcode);
|
emit_label(opcode);
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
# WARM API
|
# WAMR API
|
||||||
|
|
||||||
* **Notice**: The python package `wamr.wamrapi.wamr` need python >= `3.10`.
|
* **Notice**: The python package `wamr.wamrapi.wamr` requires a python version >= `3.10`.
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
### Pre-requisites
|
### Pre-requisites
|
||||||
|
#### Install requirements
|
||||||
|
Before proceeding it is necessary to make sure your Python environment is correctly configured. To do ths open a terminal session in this directory and perfom the following:
|
||||||
|
|
||||||
Install requirements,
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
python3 -m venv venv
|
||||||
|
source venv/bin/activate
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,8 @@ WAMR_BUILD_LIBC_WASI = 1
|
||||||
|
|
||||||
VMLIB_BUILD_DIR ?= $(CURDIR)/../build
|
VMLIB_BUILD_DIR ?= $(CURDIR)/../build
|
||||||
LIB_RATS_SRC ?= $(VMLIB_BUILD_DIR)/_deps/librats-build
|
LIB_RATS_SRC ?= $(VMLIB_BUILD_DIR)/_deps/librats-build
|
||||||
LIB_RATS_INSTALL_DIR := $(VMLIB_BUILD_DIR)/librats/lib/librats
|
LIB_RATS_INSTALL_DIR := $(VMLIB_BUILD_DIR)/_deps/librats-build
|
||||||
LIB_RATS_INCLUDE_DIR := $(VMLIB_BUILD_DIR)/librats/include
|
LIB_RATS_INCLUDE_DIR := $(VMLIB_BUILD_DIR)/_deps/librats-src/include
|
||||||
|
|
||||||
ifeq ($(shell getconf LONG_BIT), 32)
|
ifeq ($(shell getconf LONG_BIT), 32)
|
||||||
SGX_ARCH := x86
|
SGX_ARCH := x86
|
||||||
|
@ -99,7 +99,7 @@ else
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(WAMR_BUILD_LIB_RATS), 1)
|
ifeq ($(WAMR_BUILD_LIB_RATS), 1)
|
||||||
App_Link_Flags += -L$(LIB_RATS_INSTALL_DIR) -L$(SGX_SSL)/lib64 -lrats_u -lsgx_dcap_ql -lsgx_dcap_quoteverify -lsgx_ukey_exchange -lsgx_usgxssl
|
App_Link_Flags += -L$(LIB_RATS_SRC)/tee/sgx/untrust -L$(SGX_SSL)/lib64 -lrats_u -lsgx_dcap_ql -lsgx_dcap_quoteverify -lsgx_ukey_exchange -lsgx_usgxssl
|
||||||
endif
|
endif
|
||||||
|
|
||||||
App_Cpp_Objects := $(App_Cpp_Files:.cpp=.o)
|
App_Cpp_Objects := $(App_Cpp_Files:.cpp=.o)
|
||||||
|
@ -152,7 +152,19 @@ else
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(WAMR_BUILD_LIB_RATS), 1)
|
ifeq ($(WAMR_BUILD_LIB_RATS), 1)
|
||||||
Rats_Lib_Link_Dirs := -L$(LIB_RATS_INSTALL_DIR) -L$(LIB_RATS_INSTALL_DIR)/attesters -L$(LIB_RATS_INSTALL_DIR)/verifiers -L$(SGX_SSL)/lib64 -L$(VMLIB_BUILD_DIR)/external/libcbor/src/libcbor/lib -L$(LIB_RATS_INSTALL_DIR)/crypto_wrappers
|
Rats_Lib_Link_Dirs := -L$(LIB_RATS_INSTALL_DIR) \
|
||||||
|
-L$(LIB_RATS_SRC)/tee/sgx/trust \
|
||||||
|
-L$(LIB_RATS_SRC)/attesters/sgx-ecdsa \
|
||||||
|
-L$(LIB_RATS_SRC)/attesters/nullattester \
|
||||||
|
-L$(LIB_RATS_SRC)/attesters/sgx-la \
|
||||||
|
-L$(LIB_RATS_SRC)/verifiers/nullverifier \
|
||||||
|
-L$(LIB_RATS_SRC)/verifiers/sgx-la \
|
||||||
|
-L$(LIB_RATS_SRC)/verifiers/sgx-ecdsa-qve \
|
||||||
|
-L$(SGX_SSL)/lib64 \
|
||||||
|
-L$(VMLIB_BUILD_DIR)/external/libcbor/src/libcbor/lib \
|
||||||
|
-L$(LIB_RATS_SRC)/crypto_wrappers/openssl \
|
||||||
|
-L$(LIB_RATS_SRC)/crypto_wrappers/openssl \
|
||||||
|
-L$(LIB_RATS_SRC)/crypto_wrappers/nullcrypto
|
||||||
Rats_Lib_W_Link_libs := -lattester_nullattester -lattester_sgx_ecdsa -lattester_sgx_la \
|
Rats_Lib_W_Link_libs := -lattester_nullattester -lattester_sgx_ecdsa -lattester_sgx_la \
|
||||||
-lverifier_nullverifier -lverifier_sgx_la -lverifier_sgx_ecdsa_qve -lcbor \
|
-lverifier_nullverifier -lverifier_sgx_la -lverifier_sgx_ecdsa_qve -lcbor \
|
||||||
-lrats_lib -lsgx_tsgxssl -lcrypto_wrapper_nullcrypto -lcrypto_wrapper_openssl
|
-lrats_lib -lsgx_tsgxssl -lcrypto_wrapper_nullcrypto -lcrypto_wrapper_openssl
|
||||||
|
@ -171,7 +183,7 @@ Enclave_Edl_Search_Path = --search-path ../Enclave \
|
||||||
--search-path $(SGX_SDK)/include \
|
--search-path $(SGX_SDK)/include \
|
||||||
--search-path $(WAMR_ROOT)/core/shared/platform/linux-sgx
|
--search-path $(WAMR_ROOT)/core/shared/platform/linux-sgx
|
||||||
ifeq ($(WAMR_BUILD_LIB_RATS), 1)
|
ifeq ($(WAMR_BUILD_LIB_RATS), 1)
|
||||||
Enclave_Edl_Search_Path += --search-path $(LIB_RATS_INCLUDE_DIR)/librats/edl --search-path $(SGX_SSL)/include
|
Enclave_Edl_Search_Path += --search-path $(LIB_RATS_INCLUDE_DIR)/edl --search-path $(SGX_SSL)/include
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,9 +20,9 @@ $ cd $HOME
|
||||||
$ OS_PLATFORM=ubuntu20.04
|
$ OS_PLATFORM=ubuntu20.04
|
||||||
$ OS_CODE_NAME=`lsb_release -sc`
|
$ OS_CODE_NAME=`lsb_release -sc`
|
||||||
$ SGX_PLATFORM=$OS_PLATFORM-server
|
$ SGX_PLATFORM=$OS_PLATFORM-server
|
||||||
$ SGX_RELEASE_VERSION=1.17
|
$ SGX_RELEASE_VERSION=1.22
|
||||||
$ SGX_DRIVER_VERSION=1.41
|
$ SGX_DRIVER_VERSION=1.41
|
||||||
$ SGX_SDK_VERSION=2.20.100.4
|
$ SGX_SDK_VERSION=2.25.100.3
|
||||||
|
|
||||||
# install the dependencies
|
# install the dependencies
|
||||||
$ sudo apt-get update
|
$ sudo apt-get update
|
||||||
|
@ -53,7 +53,7 @@ $ # Verify that the paths are correctly set
|
||||||
$ which ar as ld objcopy objdump ranlib
|
$ which ar as ld objcopy objdump ranlib
|
||||||
$ cd ../
|
$ cd ../
|
||||||
$ git clone https://github.com/intel/intel-sgx-ssl.git
|
$ git clone https://github.com/intel/intel-sgx-ssl.git
|
||||||
$ wget https://www.openssl.org/source/openssl-1.1.1v.tar.gz -O intel-sgx-ssl/openssl_source/openssl-1.1.1v.tar.gz
|
$ wget https://www.openssl.org/source/openssl-3.0.14.tar.gz -O intel-sgx-ssl/openssl_source/openssl-3.0.14.tar.gz
|
||||||
$ cd intel-sgx-ssl/Linux
|
$ cd intel-sgx-ssl/Linux
|
||||||
$ source /opt/intel/sgxsdk/environment
|
$ source /opt/intel/sgxsdk/environment
|
||||||
$ make all
|
$ make all
|
||||||
|
|
|
@ -205,12 +205,3 @@ foreach(EX ${EXAMPLES})
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
)
|
)
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|
||||||
find_program(VALGRIND
|
|
||||||
valgrind
|
|
||||||
REQUIRED
|
|
||||||
)
|
|
||||||
|
|
||||||
# run `ctest -T memcheck -V --test-dir build`
|
|
||||||
endif()
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user