Enhance wasm loader and interpreter, enhance code security and update document (#149)

This commit is contained in:
wenyongh
2019-12-13 15:30:30 +08:00
committed by GitHub
parent 1c81ad6da5
commit 631b7a2403
45 changed files with 678 additions and 646 deletions

View File

@ -3,6 +3,30 @@
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
*/
/**
* Currently WAMR supports libc for WASM applications in two modes:
* (1) the built-in libc subset for embedded environment and
* (2) WASI for standard libc
* so here the libc syscall mode is disabled by default, if developer
* wants to enable the libc syscall mode, please set the following
* macro to 1, and implements the related syscall wrappers. Here some
* syscall wrapper examples are given.
*/
#define WASM_TEST_SYSCALL_WRAPPER 0
#if WASM_TEST_SYSCALL_WRAPPER == 0
#include "wasm_native.h"
void*
wasm_platform_native_func_lookup(const char *module_name,
const char *func_name)
{
return NULL;
}
#else
#ifndef _GNU_SOURCE
#define _GNU_SOURCE /* for O_DIRECT */
#endif
@ -337,3 +361,5 @@ wasm_platform_native_func_lookup(const char *module_name,
return NULL;
}
#endif /* end of WASM_TEST_SYSCALL_WRAPPER */