Commit Graph

522 Commits

Author SHA1 Message Date
Huang Qi
3fa91df754
Simplify some string size calculation when emitting AOT file (#813)
Simplify some string size calculation when emitting AOT file

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-11-01 20:03:13 +08:00
Wenyong Huang
4d14e41ce9
Build projects in wamr-test-suites with multiple cores (#811)
Build several projects in wamr-test-suites with multiple cores to reduce
the compilation time.
2021-10-30 21:03:46 +08:00
Xu Jun
83df8600f7
Support random debug port by assigning port = 0 (#807)
Support random debug port by assigning port = 0,
and update help and document.
2021-10-30 02:44:41 -05:00
Qinkun Bao
40ca5469dc
Remove duplicated wasi_dircookie_t typedef in libc_wasi_wrapper.h (#808)
Remove duplicated wasi_dircookie_t typedef in libc_wasi_wrapper.h to
fix clang warnings.
2021-10-30 14:41:57 +08:00
Wenyong Huang
5face80e0c
Fix spec test workflow issue and CI Dockerfile issue (#810)
Fix llvm binaries cache missed issue in spec test workflow,
fix CI Dockerfile issue and refine code format for libc_builtin_wrapper.c.
2021-10-30 09:24:03 +08:00
Xu Jun
164c3bff69
Fix lldb wasm patch to enable source debugging for windows (#806) 2021-10-27 21:26:53 +08:00
liang.he
3d5a0bff0f
Enhance workflows by caching llvm directories directly (#805)
Enhance workflows by caching llvm directories directly instead of
caching the llvm-xxx.tar.gz packages, so as to reduce the time
consumption of unpacking the cached LLVM packages.
2021-10-27 17:26:17 +08:00
Huang Qi
51a00a4c2b
Disable source debugging by default (#804)
For cmake based project, there are default values in .cmake,
but for other build system, may these symbols were not defined in their
build system and warnings (XXX is not defined) were generated while building.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-10-26 18:52:30 +08:00
Javan
788e14ed6c
Enable emitting custom name section to aot file (#794)
Enable emitting custom name section to aot file when adding
`--enable-dump-call-stack` or `--enable-dump-call-stack` to
wamrc and there is custom name section in wasm file, which
can be generated by wasi-sdk/emcc "-g" option. So aot runtime
can also get the function name from the custom name section
instead of export section,  to which developer should use
`--export-all` for wasi-sdk/emcc to generate export function
names.
2021-10-26 16:32:52 +08:00
liang.he
1a987ae59b
Refine wamr-sdk build scripts (#801)
Avoid hardcoding the path of wasi-sdk in wamr_toolchain.cmake,
allow passing -w [wasi-sdk path] to build_sdk.sh,
allow passing OUT_DIR to app-sdk and runtime-sdk,
and optimize message information.
2021-10-26 14:20:29 +08:00
Wenyong Huang
6b3a939370
Enable auto install wasi-sdk when build wamr-sdk (#796)
And fix -q[<App Name>] show error in host_tool help.
2021-10-22 16:53:25 +08:00
Wenyong Huang
32242988ed
Apply clang-format for more source files (#795)
Apply clang-format for C source files in folder core/app-mgr,
core/app-framework, and test-tools.
And rename folder component_test to component-test, update
zephyr build document.

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2021-10-21 13:58:34 +08:00
liang.he
225f5d0a64
Enable to trigger code guideline checks when PR is created (#790)
Enable to trigger code guideline checks for C/C++ source codes when PR is created
2021-10-19 17:42:54 +08:00
YAMAMOTO Takashi
68d72c300f
Fix a wrong alignment assumption when emitting aot file (#792)
The size used to apply "size = align_uint(size, 4)" may be different
when calculating total size (in get_object_data_sections_size) and
emitting actual data (in aot_emit_object_data_section_info) for the
object data section.

This patch fixes the "Error: emit object data section info failed".
2021-10-19 17:11:24 +08:00
YAMAMOTO Takashi
808ad2e4f1
Add __umodsi3 to target symbol map in aot_reloc_arm.c (#793)
The symbol _umodsi3 may be used by AOT file generated with "wamrc --target=armv7".
2021-10-19 17:04:09 +08:00
Wenyong Huang
3dff80157b
Fix app heap corrupted unchecked issue (#788)
Check whether app heap is corrupted in gc_migrate() and gci_dump(),
and handle the failures in wasm/aot_enlarge_memory().
2021-10-15 20:56:41 +08:00
Huang Qi
a121e45a1e
Simplify build setup for zephyr (#789)
Zephyr can apply board specific .conf and .overlay automatically,
move .conf to boards to make it easy to support different board without
addition command parameters.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-10-15 20:15:17 +08:00
liang.he
b46b663c16
Enhance spec test workflow to support x86_32 target (#787)
Enable test spec cases on x86_32 target when PR is created.
And Format shell script with [shellfmt](https://marketplace.visualstudio.com/items?itemName=foxundermoon.shell-format).
2021-10-15 17:05:07 +08:00
Carlos
dd9b4e021e
Fix WASI type/macro misalignments (#766)
Some of the WASI definitions in libc-wasi are out of sync with those of [wasi-libc](https://github.com/WebAssembly/wasi-libc/blob/main/libc-bottom-half/headers/public/wasi/api.h).

This PR fixed the misalignments of type __wasi_dirnamlen_t, __wasi_linkcount_t and __wasi_dirent_t, and WASI RIGHT related macros.
2021-10-14 21:56:30 +08:00
liang.he
250aba6874
Sync up with wabt latest modification (#296) (#786)
- Remove "--enable-reference-types" and "--enable-bulk-memory" for wat2wasm
to support finished proposals.

- Ignore invalid module in the thread spec repo:
``` wast
;; my_elem.wast
(module
  (table $t 10 funcref)
  (func $f)
  (elem $t (i32.const 0) 0)
  (elem $t (i32.const 0) $f $f)
  (elem $t (offset (i32.const 0)) $f $f)
)
```

run with reference interpreter under spec/interpreter:
``` shell
$ ./wasm ../../../my_elem.wast
../../../my_elem.wast:5.9-5.11: syntax error: duplicate elem segment $t
```

- use a specific commit instead of the latest commit on the thread spec repo
2021-10-14 15:48:45 +08:00
Wenyong Huang
17f62ad472
Apply clang-format for core/shared and product-mini files (#785)
Apply clang-format for core/shared and product-mini files
2021-10-14 09:12:07 +08:00
Wenyong Huang
fb4afc7ca4
Apply clang-format for core/iwasm compilation and libraries (#784)
Apply clang-format for core/iwasm/compilation and core/iwasm/libraries files.
Add wasm-c-api empty_imports sample to workflow test.
And enable triggering workflow when core/config.h changes.
2021-10-13 15:13:00 +08:00
dslk
dc65d2910a
Set APP_THREAD_STACK_SIZE_DEFAULT/MIN for POSIX platforms (#779)
Set APP_THREAD_STACK_SIZE_DEFAULT/MIN to PTHREAD_STACK_DEFAULT/MIN
when the macros are defined.

Signed-off-by: zhouliang3 <zhouliang3@xiaomi.com>
2021-10-12 18:11:32 +08:00
Michael Martin
c94e752532
Allow empty import array for wasm-c-api wasm_instance_new (#782)
Allow empty import array (but not NULL) for wasm-c-api wasm_instance_new,
which makes the code more robust, especially in use cases where imports
might be constructed dynamically.
And add a test case in samples/wasm-c-api/src/empty_imports.c to test it.
2021-10-12 16:06:38 +08:00
Wenyong Huang
8edca21df2
Enable triggering workflows on push events (#783)
And enable cmake build in workflows with multiple cpu cores.
2021-10-12 14:52:16 +08:00
Wenyong Huang
ee1ae4dc2c
Fix CI issues (#781)
Fix spec_test.yml llvm-library cache key name invalid issue.
Trigger CI when core/shared, product-mini and wamr-compiler change.
2021-10-12 11:30:58 +08:00
Wenyong Huang
03494f9487
Refactor CI rules: merge ubuntu/macos/android, enable spec test (#777)
Refactor CI rules:
- merge ubuntu/macos/android into one job file
- add job file to test spec cases
- add compilation for lazy jit, debug interpreter and debug aot
- add compilation for performance profile, dump call stack and mini-loader
- re-org llvm build script to build lldb

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2021-10-11 20:32:29 +08:00
Xu Jun
0be1f687af
Fix source debugging issues (#776)
- fix data race issue between debug control thread and main thread
- fix possible memory leaks in breakpoints list
- fix memory uninitialized issues
- remove unused data structures
- add more checks when handling packet and args
- fix mini-loader issues
- fix config_common.cmake fast interp prompt issue
2021-10-09 15:56:58 +08:00
Wenyong Huang
52b6c73d9c
Apply clang-format for more src files and update spec test script (#775)
Apply clang-format for core/iwasm/include, core/iwasm/common and
core/iwasm/aot files.

Update spec cases test script:
- Checkout latest commit of https://github.com/WebAssembly/spec
- Checkout main branch but not master of https://github.com/WebAssembly/threads
- Update wabt to latest version

And update source debugging document.

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2021-10-08 17:47:11 +08:00
Wenyong Huang
6415e1b006
Apply clang-format for interpreter source files (#772)
And update source debugging document.
2021-10-08 11:44:39 +08:00
Karl Fessel
8d9bf18ac3
Make include headers follow strict protoype rule (#773)
Change function arguments to (void) instead of () to avoid compilation warnings
when compiling with '-Wstrict-prototypes' flag.
2021-10-08 11:24:48 +08:00
Wenyong Huang
7191ecf880
Customize clang-format coding styles based on Mozilla template (#770)
Customize clang-format coding styles for C source files based on Mozilla template.
To check whether the C source codes are well formatted:
``` bash
$ cd ${wamr-root}
$ clang-format --Werror --dry-run --style=file path/to/file
```
To format the C source codes in place
``` bash
$ cd ${wamr_root}
$ clang-format -i --style=file path/to/file
```

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2021-10-06 09:54:36 +08:00
Wenyong Huang
9ef37dd781
Implement source debugging for interpreter and AOT (#769)
Implement source debugging feature for classic interpreter and AOT:
- use `cmake -DWAMR_BUILD_DEBUG_INTERP=1` to enable interpreter debugging
- use `cmake -DWAMR_BUILD_DEBUG_AOT=1` to enable AOT debugging

See doc/source_debugging.md for more details.
2021-09-29 13:36:46 +08:00
Wenyong Huang
b5a67cb91e
Fix several issues of document, spec test script and simd (#767)
Fix document issues: add ARC to supported targets, fix how to build wamrc for MacOS.
Fix spec case test script issue: the latest wabt has enabled simd by default, no need to
add "--enable-simd" option for test script.
Fix simd LLVM IR compilation issue: using index calculated by opcode to access array
element should not be out of array boundary, add bh_assert() for it.

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2021-09-29 11:13:38 +08:00
Wenyong Huang
1ad76f489b
zephyr: add module.yml and fix riscv compile error (#763) 2021-09-24 17:43:02 +08:00
Wenyong Huang
7be0d385a6
Implement SIMD latest opcodes and update LLVM to 13.0 (#758)
Implement the latest SIMD opcodes and update LLVM 13.0,
update the llvm build scripts, update the sample workloads‘ build scripts,
and build customized wasi-sdk to build some workloads.
Also refine the CI rules.

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2021-09-17 19:12:57 +08:00
Wenyong Huang
7e60a5db8d
Update document: add SGX to key feature list (#755) 2021-09-16 16:59:04 +08:00
Wenyong Huang
310feb6536
Fix compilation warnings (#754) 2021-09-16 16:36:42 +08:00
Saju Pillai
76d641c7ea
Update wasm_c_api to use vector types (#751)
The WASM C API now requires the use of vector types in certain apis.
Switching WAMR to use the new call signatures improves "drop in"
compilation compatibility between WAMR and other implementations
from a C-api embedding program's perspective.

* wasm_func_callback_t type has been updated to use wasm_val_vec_t
* wasm_func_callback_with_env_t type has been updated to use wasm_val_vec_t
* wasm_func_call() has been updated to use wasm_val_vec_t
* wasm_instance_new() has been updated to use wasm_extern_vec_t*
* wasm_instance_new_with_args() has been updated to use wasm_extern_vec_t*
* wasm_runtime_invoke_c_api_native() has been updated to support vector types
  in native callbacks without modifying the contract with the interpreter code.
* All users of the modified functions (including samples/wasm-c-api/src/*.c)
  have been appropriately updated.
2021-09-16 14:54:25 +08:00
Wenyong Huang
ed32693fc8
Fix calling multi-module import func issue (#748)
Before calling import function of sub module inst in multi-module mode,
we should copy the arguments to output area by using the func inst of
sub module inst but not func inst of current module inst.
2021-09-14 11:28:44 +08:00
Saju Pillai
b1173d1bfc
Allocate correct space for results before native callback is run (#747) 2021-09-13 09:55:05 +08:00
Carlos
e07b58062f
Change arg name 'export' to other to fix keyword conflict in C++11 (#745)
Some of the function arguments were named as "export" in core/iwasm/common/wasm_runtime_common.h, which result in conflicts with the C++11 keyword. Change them to other to fix the compilation error.
2021-09-11 18:53:27 +08:00
YAMAMOTO Takashi
ea835db54c
Enable wamr-test-suites on MacOS (#740) 2021-09-10 10:11:46 +08:00
Wenyong Huang
88192ab13b
Merge pull request #739 from no1wudi/main
Apply aot intrinsics to riscv
2021-09-09 16:12:05 +08:00
Huang Qi
b31804b64e Apply aot intrinsics to riscv
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Change-Id: If1e813f5f8ead2c0d9b640f8ea4e87e2155db534
2021-09-09 07:59:12 +00:00
Wenyong Huang
00663f0cd5
Import test suites to test spec cases (#736) 2021-09-09 12:49:46 +08:00
Wenyong Huang
4b0d6083a3
Enable lazy Orc JIT feature (#732)
The feature is disabled by default, to enable it, please use
`cmake -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_LAZY_JIT=1`
to build iwasm.
2021-09-07 11:39:57 +08:00
Bernard Xiong
7e60b8608e
Add ia32 support and fix compiling issue for RT-Thread (#730) 2021-09-07 10:20:14 +08:00
YAMAMOTO Takashi
336abc2b27
Fix a build on alpine, whose libc is musl (#726)
Change __syscall_slong_t to __SYSCALL_SLONG_TYPE, and use it when macro __SYSCALL_SLONG_TYPE is defined.
2021-09-07 10:03:54 +08:00
YAMAMOTO Takashi
79f163d08b
Appease some UBSan complaints (#720) 2021-09-04 10:09:30 +08:00