Commit Graph

1153 Commits

Author SHA1 Message Date
Callum Macmillan
6eaf779a2d
Install patched LLDB on vscode extension activation (#1637)
Download and install the WAMR patched LLDB binary on vscode extension activation.

This allows the user to download the packaged .vsix file, where the activation script
should handle determining what LLDB binary they should use, and install it in the
correct location.
2022-12-01 10:39:14 +08:00
Wenyong Huang
ce3458da99
Refine AOT exception check when function return (#1752)
Refine AOT exception check in the caller when returning from callee function,
remove the exception check instructions when hw bound check is enabled to
improve the performance: create guard page to trigger signal handler when
exception occurs.
2022-11-30 20:18:28 +08:00
Wenyong Huang
7cb1ebc771
Fix compile warning in wasm_shared_memory.c (#1772) 2022-11-30 18:17:41 +08:00
Enrico Loparco
5737783f92
Update document for MacOS compilation (#1770)
When building LLVM, if multiple SDKs are installed in `/Library/Developer/CommandLineTools/SDKs`,
headers from multiple SDKs are picked, generating build errors as describe here:
    https://github.com/bytecodealliance/wasm-micro-runtime/issues/1758.

Without disabling the bound checks (i.e. -DWAMR_DISABLE_HW_BOUND_CHECK=1)
when building `iwasm`, the `-g=127.0.0.1:1234` parameter makes the runtime crash.

Update the document to avoid the issues.

Signed-off-by: eloparco <eloparco@amazon.com>
2022-11-30 17:51:28 +08:00
Andy
3e8927a31b
Adding option to pass user data to allocator functions (#1765)
Add an option to pass user data to the allocator functions. It is common to
do this so that the host embedder can pass a struct as user data and access
that struct from the allocator, which gives the host embedder the ability to
do things such as track allocation statistics within the allocator.

Compile with `cmake -DWASM_MEM_ALLOC_WITH_USER_DATA=1` to enable
the option, and the allocator functions provided by the host embedder should
be like below (an extra argument `data` is added):
void *malloc(void *data, uint32 size) { .. }
void *realloc(void *data, uint32 size) { .. }
void free(void *data, void *ptr) { .. }

Signed-off-by: Andrew Chambers <ncham@amazon.com>
2022-11-30 16:19:18 +08:00
liang.he
216b2cb540
Fix a typo in workflow (#1760) 2022-11-30 14:00:30 +08:00
Marcin Kolny
f8701560df
Fix warnings in the posix socket implementation (#1768) 2022-11-29 20:04:07 +08:00
Marcin Kolny
4cbfeec1f5
Fix scenario where the timeout for atomic wait is set to negative number (#1767)
The code, when received -1, performed -1/1000 operation which rounds to 0,
i.e. no wait (instead of infinite wait)
2022-11-29 18:45:07 +08:00
guangyuhu
8d2aedca77
Compile WAMR on platforms that don't support IPV6 (#1754)
Modify posix_socket.c to support compile WAMR on platforms
that don't support IPV6
2022-11-29 07:45:25 +08:00
TianlongLiang
be7a4abee2
Fix source debugger error handling: continue executing when detached (#1725)
Change main thread hangs when encounter debugger encounters error to
main thread exits when debugger encounters error
Change main thread blocks when debugger detaches to
main thread continues executing when debugger detaches, and main thread
exits normally when finishing executing
2022-11-28 22:12:46 +08:00
Wenyong Huang
12bcc20710
Implement invokeNative asm code for MinGW (#1753)
And update the document of building iwasm for MinGW.
2022-11-28 17:48:06 +08:00
Wenyong Huang
ec5ab8274d
Fix zephyr sample build errors (#1757) 2022-11-28 11:23:51 +08:00
Huang Qi
9c5e1cb600
wamr-test-suites: Add support for ARM/RISCV by QEMU (#1704)
Enhance wamr-test-suites to add QEMU and Firmware options:
`./test_wamr.sh -Q <qemu> -F <firmware>`
2022-11-28 10:45:32 +08:00
Huang Qi
93d3d09aa1
Clear some warnings and enable -Werror for NuttX (#1756) 2022-11-28 09:44:33 +08:00
Andy
1465901f6f
Create trap for error message when wasm_instance_new fails (#1751)
Create trap for error message when wasm_instance_new fails:
- Similar to [this PR](https://github.com/bytecodealliance/wasm-micro-runtime/pull/1526),
   but create a wasm_trap_t to output the error msg instead of adding error_buf to the API.
- Trap will need to be deleted by the caller but is not a breaking change as it is only
   created if trap is not NULL.
- Add error messages for all failure cases here, try to make them accurate but welcome
  feedback for improvements.

Signed-off-by: Andrew Chambers <ncham@amazon.com>
2022-11-25 17:45:19 +08:00
Wenyong Huang
96570cca22
Remove unused LLVM JIT wapper functions (#1747)
Only create the necessary wrapper functions for LLVM JIT
2022-11-25 11:26:08 +08:00
Huang Qi
0456043d8d
Fix missing intrinsics for risc-v which were reported by spec test (#1750) 2022-11-25 09:20:38 +08:00
liang.he
eaedceca2f
Add bh_print_proc_mem() to dump memory info of current process (#1734)
Only support Posix platforms currently, read memory consumption info from
file "/proc/self/status".
2022-11-25 08:33:44 +08:00
Wenyong Huang
29b76dd275
Create module hash for each module in SGX lib-rats (#1745)
Current SGX lib-rats wasm module hash is stored in a global buffer,
which may be overwritten if there are multiple wasm module loadings.
We move the module hash into the enclave module to resolve the issue.

And rename the SGX_IPFS macro/variable in Makefile and Enclave.edl to
make the code more consistent.

And refine the sgx-ra sample document.
2022-11-24 21:48:50 +08:00
YAMAMOTO Takashi
1032aac60b
Add wasm_runtime_get_wasi_exit_code (#1748)
Refer to https://github.com/bytecodealliance/wasm-micro-runtime/issues/1738
2022-11-24 20:26:18 +08:00
Wenyong Huang
8dc9d6dc4f
Enlarge the default wasm operand stack size to 64KB (#1746)
Enlarge the default wasm operand stack size to 64KB since the original default
size 16KB is a little small, and the operand stack overflow exception is often
thrown when running wasm apps.
2022-11-24 15:50:05 +08:00
dongsheng28849455
c4defb8877
Update xtensa LLVM version to 15.x (#1741)
Fix the issue that xtensa .aot size cannot be over 256K.
2022-11-24 12:48:31 +08:00
dependabot[bot]
2c5e7bc650
Bump tensorflow from 2.10.0 to 2.10.1 in /core/iwasm/libraries/wasi-nn/test (#1735)
Bumps [tensorflow](https://github.com/tensorflow/tensorflow) from 2.10.0 to 2.10.1.
- [Release notes](https://github.com/tensorflow/tensorflow/releases)
- [Changelog](https://github.com/tensorflow/tensorflow/blob/master/RELEASE.md)
- [Commits](https://github.com/tensorflow/tensorflow/compare/v2.10.0...v2.10.1)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-22 16:21:06 +08:00
Wenyong Huang
da7117a092
Refine the stack frame size check in interpreter (#1730)
Limit max_stack_cell_num/max_csp_num to be no larger than UINT16_MAX,
and don't check all_cell_num in interpreter again.

And refine some codes in interpreter.
2022-11-22 15:32:48 +08:00
Zeuson
656a8427e6
linux-sgx: Improve the remote attestation (#1695)
The current implementation of remote attestation does not take into
account the integrity of the wasm module. The SHA256 of the wasm
module has been put into user_data to generate the quote, and more
parameters are exposed for further verification.
2022-11-22 14:45:03 +08:00
Wenyong Huang
87c3195d47
Revert "Implement call Fast JIT function from LLVM JIT jitted code" (#1737)
Reverts bytecodealliance/wasm-micro-runtime#1714, which was merged mistakenly.
2022-11-22 14:04:48 +08:00
Wenyong Huang
440bbea81e
Fix interp/fast-jit float min/max issues (#1733) 2022-11-22 09:14:20 +08:00
TianlongLiang
d9f9e3a92b
Update README.md to add link for document website (#1722) 2022-11-21 18:02:02 +08:00
Wenyong Huang
89f9d695ed
Fix fast jit issue of translating opcode i32.rem_s/i64.rem_s (#1731) 2022-11-21 16:37:10 +08:00
Wenyong Huang
cf7b01ad82
Implement call Fast JIT function from LLVM JIT jitted code (#1714)
Basically implement the Multi-tier JIT engine.
And update document and wamr-test-suites script.
2022-11-21 10:42:18 +08:00
liang.he
3daa512925
Remove unused export index check in wasm-c-api (#1720) 2022-11-20 18:47:02 +08:00
Huang Qi
4e5ba6f6ef
Fix issue of thumb relocation R_ARM_THM_MOVT_ABS (#1723) 2022-11-19 19:36:02 +08:00
Xu Jun
032b9aa74b
Fix issue of restoring wasm operand stack (#1721) 2022-11-18 18:51:13 +08:00
liang.he
021130f4a3
Add more compilation groups of fast jit into CI (#1717) 2022-11-17 16:46:25 +08:00
Huang Qi
b5efadf205
nuttx: Enable ref types by Kconfig (#1711) 2022-11-17 11:56:59 +08:00
Therdel
b68477267c
Refine the build_wasm_app.md formatting (#1713) 2022-11-17 11:55:51 +08:00
TrellixVulnTeam
7ad3412591
Adding tarfile member sanitization to extractall() (#1709)
Fix a widespread bug named CVE-2007-4559, which is a 15 year old bug
in the Python tarfile package. By using extract() or extractall() on a tarfile
object without sanitizing input, a maliciously crafted .tar file could
perform a directory path traversal attack. This patch essentially checks to
see if all tarfile members will be extracted safely and throws an exception
otherwise.
2022-11-17 11:52:30 +08:00
Wenyong Huang
6c16ff7654
Update document and clear compile warnings (#1701)
Update build wasm app document, add how to set buildflags for Rust
project to reduce the footprint.

Clear Windows warnings and a shadow warning in aot_emit_numberic.c
2022-11-15 15:02:23 +08:00
Wenyong Huang
375a2c9a49
Fix sample ref-types/wasm-c-api build error with wat2wasm low version (#1702)
Fix build error in sample ref-types and wasm-c-api caused by the
version of wat2wasm: refine makefile to auto detect the wat2wasm
version and add the compile flag accordingly.
2022-11-15 13:51:03 +08:00
liang.he
c718e76dea
Use wabt binary instead of building from source in spec test (#1700)
Directly download wabt binary and use it in spec test instead of
building it from source to fasten the spec test.
2022-11-14 15:16:22 +08:00
Wenyong Huang
c70e1ebc3d
Avoid generating some unused LLVM IRs (#1696)
Refine the generated LLVM IRs at the beginning of each LLVM AOT/JIT function
to fasten the LLVM IR optimization:
- Only create argv_buf if there are func calls in this function
- Only create native stack bound if stack bound check is enabled
- Only create aux stack info if there is opcode set_global_aux_stack
- Only create native symbol if indirect_mode is enabled
- Only create memory info if there are memory operations
- Only create func_type_indexes if there is opcode call_indirect
2022-11-14 14:32:35 +08:00
Huang Qi
4b0660cf24
Fix missing float cmp for XIP (#1699) 2022-11-14 11:58:38 +08:00
Wenyong Huang
cef4e74fee
Clear "redundant move" warning when build LLVM (#1697)
Clear warnings like below when building LLVM JIT and wamrc:
  llvm-project/llvm/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h:73:25:
  warning: redundant move in return statement [-Wredundant-move]
  73 |         return std::move(Err);
2022-11-14 10:51:18 +08:00
YAMAMOTO Takashi
ff4ee4a95f
Add comments around wasm_runtime_set_wasi_args (#1692) 2022-11-09 17:18:22 +08:00
liang.he
30ee992762
Add wasm_module_obtain() to clone wasm_module_t (#1660)
Also add support for wasm_shared_module_t, and add lock for
wasm_module_t related operations.

And add wasm-c-api sample threads, update sample clone.
2022-11-09 12:50:58 +08:00
dongsheng28849455
f59ffa0d63
Enable Nuttx spec test option and register aot symbols (#1687)
Enable spec test option on Nuttx platform.
Register sqrt/sqrtf in aot global symbol map and
_fixdfdi/__floatundidf in xtensa symbol map.
2022-11-08 12:42:19 +08:00
Jämes Ménétrey
328fd59f43
linux-sgx: Allow to open files with arbitrary paths in the sandbox using IPFS (#1685)
A limitation of the current implementation of SGX IPFS in WAMR is that
it prevents to open files which are not in the current directory.
This restriction is lifted and can now open files in paths, similarly to the
WASI openat call, which takes into account the sandbox of the file system.
2022-11-07 19:56:16 +08:00
Wenyong Huang
7fd37190e8
Add control for the native stack check with hardware trap (#1682)
Add a new options to control the native stack hw bound check feature:
- Besides the original option `cmake -DWAMR_DISABLE_HW_BOUND_CHECK=1/0`,
  add a new option `cmake -DWAMR_DISABLE_STACK_HW_BOUND_CHECK=1/0`
- When the linear memory hw bound check is disabled, the stack hw bound check
   will be disabled automatically, no matter what the input option is
- When the linear memory hw bound check is enabled, the stack hw bound check
  is enabled/disabled according to the value of input option
- Besides the original option `--bounds-checks=1/0`, add a new option
  `--stack-bounds-checks=1/0` for wamrc

Refer to: https://github.com/bytecodealliance/wasm-micro-runtime/issues/1677
2022-11-07 18:26:33 +08:00
Huang Qi
810007857b
wamr-test-suites: Update runtest.py to support python3 (#1684)
Update runtest.py of wamr-test-suites to support both python2 and python3
2022-11-07 14:16:10 +08:00
Xu Jun
e278861206
Avoid raising exception when debugging with VSCode (#1686) 2022-11-07 11:57:53 +08:00