Commit Graph

1035 Commits

Author SHA1 Message Date
Marcin Kolny
9a04c21075
Implement ns lookup allowlist (#1420)
The ns-lookup accepts domain names as well as suffixes, e.g.:

```
--allow-resolve=* # allow all domain names
--allow-resolve=example.com # only allow example.com name resolution
--allow-resolve=example.com --allow-resolve=*.example.com # allow example.com and its subdomains' name resolution
```
2022-09-02 19:26:31 +08:00
Huang Qi
c56fd8bd5b
Introduce basic CI for nuttx (#1444) 2022-09-02 11:07:59 +08:00
Marcin Kolny
df782c5f2a
Fix bug for IPv4 in sock_open (#1446) 2022-09-02 10:28:05 +08:00
Marcin Kolny
0ffac101a1
Add support for IPv6 in WAMR (#1411)
For now this implementation only covers posix platforms, as defined in MVP #1336
2022-09-01 22:20:53 +08:00
Wenyong Huang
d095876ae6
Enable memory leak check (#1429)
Report the memory leak info when building iwasm with
`cmake .. -DWAMR_BUILD_GC_VERIFY=1`
2022-09-01 16:15:00 +08:00
Qiang
18774805cc
Add more checks for Fast JIT (#1433)
Add more checks for Fast JIT to fix the issues reported by instrument test:
- add check for the jit_value before pushing it into the stack
- add check at the end of form_and_translate_func
- add checks after each jit pass
2022-09-01 15:31:00 +08:00
Huang Qi
c64186b704
Fix potential warning of printf in main.c of posix and windows (#1440) 2022-09-01 14:11:00 +08:00
YAMAMOTO Takashi
9f09e2661f
wamr-ide/VSCode-Extension: Make lldb binary path per platform (#1437)
hopefully this allows an extension package to run on multiple platforms.

cf. https://code.visualstudio.com/api/extension-guides/debugger-extension#anatomy-of-the-package.json-of-a-debugger-extension
2022-09-01 12:33:59 +08:00
Wenyong Huang
22c235b5ec
Fix multi-module and some other issues (#1435)
Fix multi-module issue:
  don't call the sub module's function with "$sub_module_name$func_name"
Fix the aot_call_function free argv1 issue
Modify some API comments in wasm_export.h
Fix the wamrc help info
2022-08-31 17:38:38 +08:00
YAMAMOTO Takashi
47f17ef8f5
wamr-ide/VSCode-Extension: "set -e" in shell scripts (#1436)
To avoid mysterious behaviors caused by ignored errors.
2022-08-31 17:27:24 +08:00
Huang Qi
77c516ac80
Add a new API to get free memory in memory pool (#1430) 2022-08-31 16:39:25 +08:00
Xu Jun
e0c2acd178
add language bindings in README (#1434)
* add language bindings in README

* minor update
2022-08-30 22:05:54 +08:00
YAMAMOTO Takashi
7e02be836f
nuttx: Add CONFIG_INTERPRETERS_WAMR_DEBUG_INTERP (#1426)
the corresponding nuttx PR: https://github.com/apache/incubator-nuttx-apps/pull/1299
2022-08-30 18:38:28 +08:00
YAMAMOTO Takashi
6b073af3b0
debug-engine: Reduce the default MAX_PACKET_SIZE (#1425) 2022-08-30 17:00:32 +08:00
YAMAMOTO Takashi
fba12e9969
debug-engine: constify several global variables (#1427) 2022-08-30 15:43:47 +08:00
liang.he
29dee732e9
Fix typo in simd_conversions.c (#1428)
Change "==" to "=" when setting trunc_type[] array elements.
2022-08-29 18:01:19 +08:00
YAMAMOTO Takashi
1985a251cd
debug-engine: Use default stack size for control thread (#1424) 2022-08-26 21:13:30 +08:00
YAMAMOTO Takashi
04c1eb30cf
debug-engine: allocate "tmpbuf" dynamically (#1423)
Some configurations (eg. esp32/nuttx) have limited space for BSS,
0x20000 byte buffer is huge on embedded systems, change to
allocate the buffer dynamically.
2022-08-26 19:49:57 +08:00
YAMAMOTO Takashi
3875c6649a
wasm_runtime_start_debug_instance: Allow to override port (#1421)
Allow the embedder to manage port number for this purpose by itself.
2022-08-26 16:33:47 +08:00
YAMAMOTO Takashi
ee98b583d5
debug-engine: Fix process_port handling (#1415)
process_port=1 means "use port 1"
2022-08-25 20:03:44 +08:00
YAMAMOTO Takashi
7c75f6cf63
wasm_debug_engine_create: Remove unused comment (#1416) 2022-08-25 19:29:26 +08:00
Wenyong Huang
903a27aff2
Fix fast jit destroy block issue (#1412)
Only destroy the block if it hasn't been pushed into the block stack,
or it will be destroyed again when destroying the block stack.
2022-08-24 22:00:16 +08:00
YAMAMOTO Takashi
ebcbe0b571
wasm_application.c: Do not start debug instance automatically (#1407)
Leave the control from wasm_application_execute_main to host embedders,
eg. product-mini.
2022-08-24 20:50:26 +08:00
Qiang
1dcc59f234
Fix fast jit destroy entry/exit basic block issue in jit_cc_destroy (#1401)
The entry and exit basic blocks might be destroyed before they are created.
Found by instrument test. Add checks to fix the issue.
2022-08-24 17:56:38 +08:00
YAMAMOTO Takashi
5586f7b82d
source debug: Remove unused platform_port (#1403) 2022-08-24 16:39:32 +08:00
YAMAMOTO Takashi
d41543f829
cmake: Use CMAKE_BINARY_DIR instead of ${CMAKE_CURRENT_SOURCE_DIR}/build (#1410) 2022-08-24 15:57:03 +08:00
Wenyong Huang
08eeeb748c
Add more fast jit fixed virtual regs (#1409)
Add fast jit fixed virtual register import_func_ptrs_reg and func_type_indexes_reg
for the preparation of further optimizations.
2022-08-24 14:05:51 +08:00
YAMAMOTO Takashi
f5283399ec
debug: Retire wasm_debug_(get|set)_engine_active mechanism (#1404)
They are no longer necessary because we no longer create
debug instances automatically for exec env at this layer.
2022-08-24 12:15:37 +08:00
Xu Jun
28d9fb60d2
Add missing symbols for arc aot relocation (#1408) 2022-08-23 17:38:55 +08:00
Wenyong Huang
ccd627d2c6
Fix linear memory page count issues (#1380)
Fix issue reported in #1289 and #1371.
Enable to set the max page count to 65536.
2022-08-23 16:05:13 +08:00
Wenyong Huang
e15db8d732
Destroy fast-jit compiler after destroy loaded modules (#1402)
Destroy Fast-JIT compiler after destroying the modules loaded by
multi-module feature, since the Fast JIT's code cache allocator may
be used by these modules. If the Fast JIT's code cache allocator was
destroyed, then runtime will fail to destroy these modules.

And fix the issue of destroying import module's memory instance.
2022-08-22 14:52:33 +08:00
Wenyong Huang
0e17ab2f75
Merge pull request #1392 from bytecodealliance/main
Merge main into dev/socket
2022-08-20 12:31:10 +08:00
YAMAMOTO Takashi
1fc01fab4b
wasm_create_exec_env_and_call_function: Remove "enable_debug" argument (#1398)
No one uses the `enable_debug` argument after the removal of
wasm_runtime_create_exec_env_and_call_wasm.
2022-08-19 20:28:10 +08:00
Wenyong Huang
a517bb249a
Fix socket sample issue reported by coverity (#1397) 2022-08-19 18:06:26 +08:00
YAMAMOTO Takashi
ccd664b81e
wasm_runtime_start_debug_instance: Don't create debug instance for AOT (#1395) 2022-08-19 17:10:50 +08:00
YAMAMOTO Takashi
0ec99e9522
Remove unused wasm_runtime_create_exec_env_and_call_wasm (#1396)
It's unused since the following commit:
  commit 260d36a62d
2022-08-19 15:23:31 +08:00
FromLiQg
a382a02ea9
Fix wasm_type_equal check in wasm_mini_loader.c (#1394)
Fix wasm_type_equal check error in wasm_mini_loader.c:
  wasm_type_equal(type, j) -> wasm_type_equal(type, module->types[j])
And remove unused comments in aot_runtime.h
2022-08-19 12:56:24 +08:00
liang.he
717e8a48e2
Enable the semantic version mechanism for WAMR (#1374)
Use the semantic versioning (https://semver.org) to replace the current date
versioning system, which is more general and is requested by some developers,
e.g. issue #1357.

There are three parts in the new version string:
- major. Any incompatible modification on ABIs and APIs will lead to an increment
  in the value of major, which mainly includes: AOT calling conventions, AOT file
  format, wasm_export.h, wasm_c_api.h, and so on.
- minor. It represents new features, including MVP/POST-MVP features, libraries,
  WAMR private ones, and so one.
- patch. It represents patches.

The new version will start from 1.0.0. Update the help info and version showing for
iwasm and wamrc.
2022-08-18 19:01:05 +08:00
FromLiQg
88bb4f3c81
Normalize wasm types (#1378)
Normalize wasm types, for the two wasm types, if their parameter types
and result types are the same, we only save one copy, so as to reduce
the footprint and simplify the type comparison in opcode CALL_INDIRECT.

And fix issue in interpreter globals_instantiate, and remove used codes.
2022-08-18 17:52:02 +08:00
Wenyong Huang
9cf7b88bad
Enhance cmake makefiles (#1390)
Upgrade `cmake_minimum_required` from `(VERSION 2.8)` to `(VERSION 2.9)` to
yield the warning:
"Compatibility with CMake < 2.8.12 will be removed from a future version of CMake"

Add "-Wno-unused" for CMAKE_CXX_FLAGS to yield the compilation warnings
when build LLVM JIT.

Fix the link error when code coverage is enabled.
2022-08-18 16:27:01 +08:00
YAMAMOTO Takashi
12931e7f59
Expose wasm_runtime_get_exec_env_singleton to the API users (#1388)
Sometimes it can be useful to access the singleton.
E.g. use wasm_runtime_set_user_data on it.
2022-08-17 16:13:46 +08:00
Wenyong Huang
6caa6b1d73
Support get return value for SGX os_printf/os_vprintf (#1387)
Fix the issue reported in #1359, change the implementation of
os_printf/os_vprintf for Intel SGX to get the actual bytes written.
2022-08-16 14:23:34 +08:00
liang.he
aa7d447ee5
Update Ubuntu CI platforms to 20.04 and 22.04 (#1385)
From Gtihub:
The ubuntu-18.04 environment is deprecated, consider switching to
ubuntu-20.04 (ubuntu-latest), or ubuntu-22.04 instead.
https://github.com/actions/runner-images/issues/6002
2022-08-16 10:02:02 +08:00
YAMAMOTO Takashi
e0a943ee9c
nuttx: Provide a default WASM_STACK_GUARD_SIZE (#1386)
Unbreak builds with a bit older nuttx/apps for now.

Note: The default value here (0) was chosen to match the new default
in nuttx/apps, which is different from the old value used before
the introduction of WASM_STACK_GUARD_SIZE. (1024)
2022-08-15 19:49:39 +08:00
dongheng
071b8c2510
esp-idf: Make esp-idf support Libc WASI (#1356)
esp-idf: Make esp-idf support Libc WASI

1. Support to get WASM APP libs' DIR from upper layer
2. Add SSP support for esp-idf platform
3. Change the errno of readlinkat
2022-08-15 16:17:28 +08:00
Xu Jun
3b641b17d8
Reserve one pointer size for fast-interp code_compiled_size (#1382)
Reserve one pointer size for fast-interp code_compiled_size: if the last opcode of
current function is to be dropped (e.g. OP_DROP), the peak memory usage will
be larger than the final code_compiled_size, we record the peak size to ensure
there won't be invalid memory access during the second traversing.
2022-08-15 11:33:20 +08:00
Wenyong Huang
6798637891
Remove some unused codes (#1379)
Remove some unused fields in module instance and the related codes,
which are introduced by emsdk some special mode (-DSIDE_MODULE=1),
and are not required now.
2022-08-15 10:13:37 +08:00
Xu Jun
bc86674a45
Let iwasm return non-zero value when running failed (#1377)
Let iwasm return non-zero value when running failed
so that the caller (e.g. test framework) can check the
running status according to the return value.
2022-08-12 18:03:14 +08:00
Xu Jun
872cc51881
Fix mini-loader issue (#1383) 2022-08-12 16:35:57 +08:00
Wenyong Huang
b65befd5e7
Fix load type not initialized issue for LLVMBuildLoad2 (#1381)
Fix the issue introduced by #1202, clear the compilation warning
when building wamrc based on LLVM 14/15.
2022-08-12 14:18:47 +08:00