Commit Graph

490 Commits

Author SHA1 Message Date
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
Wenyong Huang
4e4d48e72b
Fix several coding style and return value unchecked issues (#722)
And enable building Windows CI with multi cores
2021-09-04 10:08:34 +08:00
Huang Qi
3953f819bc
Use builtin intrinsic for float/integer conversion (#719) 2021-09-02 18:19:19 +08:00
Huang Qi
cef7d35be1
Implement float and integer conversion intrinsics (#718) 2021-09-02 16:39:53 +08:00
Huang Qi
bb0e4503cb
Move type definition of IntCond and FloatCond to aot.h (#713) 2021-09-02 12:49:01 +08:00
Wenyong Huang
3f316a99a0
Fix windows compile error and warning (#715) 2021-09-01 18:50:08 +08:00
YAMAMOTO Takashi
ee24d78483
Fix Debug build error with clang-11 on linux (#714)
Remove bound-strict flag from -fno-sanitize list in Linux Debug build with clang as clang-11 doesn't have bounds-strict
2021-09-01 18:36:27 +08:00
Huang Qi
1687b7be32
Add missing symbols from libgcc for thumb platform (#712)
Add missing aot relocation symbols from libgcc for thumb platform

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-09-01 18:26:03 +08:00
Huang Qi
5d2882f05f
Make aot intrinsic flags readable (#711)
Make aot intrinsic flags easier to read and understand

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-09-01 18:24:16 +08:00
Huang Qi
6ef74778c7
Correct confusing usage of intirnsic check (#707) 2021-08-27 19:03:18 +08:00
YAMAMOTO Takashi
e80715f352
lib-pthread: Fix pthread_create callback arg issue (#701)
The last argument arg of pthread_create passed from wasm app is opaque
for the library and host, it should be returned back to the wasm app without
any interpretation. There is no point to translate it to a native address.
Actually it harms because the validation seems broken.
2021-08-19 18:21:56 +08:00
Ming, Bai
473546739b
Fix issue of conflicting target names in Windows (#702)
The output file name of the iwasm library should be unique, otherwise some of the output files from two different targets (iwasm and libiwasm) will overwrite each other and produce corrupted output files. Currently Windows debugging is broken due to the corrupted pdb files, and this PR fixes the issue.
2021-08-19 18:11:59 +08:00
YAMAMOTO Takashi
ef14ace027
small doc fixes (#700)
doc/embed_wamr.md: WASMModuleInstanceCommon -> wasm_module_inst_t
wamr-sdk/README.md: fix a link
2021-08-19 14:44:14 +08:00
Huang Qi
6a7fd3e688
Make sp 8 byte aligned in invokeNative on ARM (#697)
Make sp 8 byte aligned in invokeNative assembly on ARM.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-08-18 10:21:38 +08:00
Wenyong Huang
db695fada4
Implement XIP feature and enable ARC target support (#694)
Implement XIP (Execution In Place) feature for AOT mode to enable running the AOT code inside AOT file directly, without memory mapping the executable memory for AOT code and applying relocations for text section. Developer can use wamrc with "--enable-indirect-mode --disable-llvm-intrinsics" flags to generate the AOT file and run iwasm with "--xip" flag. Known issues: there might still be some relocations in the text section which access the ".rodata" like sections.

And also enable ARC target support for both interpreter mode and AOT mode.

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2021-08-12 17:44:39 +08:00
Huang Qi
8fd89bd415
Implement clock() wrapper for built-in libc (#691) 2021-08-07 21:21:25 +08:00
Wenyong Huang
0db04e0b8f
Fix some compile issues of samples (#690)
Fix compile errors of workloads due to emsdk version upgrade,
enable BUILD_TARGET auto set for some samples,
and call wasm_runtime_init_thread_env() for in thread routine which
was created by pthread_create but not runtime in spawn-thread sample.

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2021-08-06 18:12:21 +08:00
Wenyong Huang
541f577164
Implement wasm_runtime_init_thread_env for Windows platform (#683)
Implement wasm_runtime_init_thread_env() for Windows platform by calling os_thread_env_init(): if current thread is created by developer himself but not runtime, developer should call wasm_runtime_init_thread_env() to init the thread environment before calling wasm function, and call wasm_runtime_destroy_thread_env() before thread exits.
And clear compile warnings for Windows platform, fix compile error for AliOS-Things platform

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2021-08-03 10:49:50 +08:00
Wang Xin
445722cac3
update the readme.md for TSC member (#681)
* Update README.md

* Update the TSC member
2021-08-02 10:46:21 +08:00
Wenyong Huang
7cdfc9fe11
Fix issues reported by gcc -fsanitize flag (#678)
And refine some coding styles, fix JIT compiler data wasm table create issue, add license header for some files.
2021-07-30 15:21:17 +08:00
Huang Qi
62fb3c9a89
Unify product-mini main.c implementation for POSIX compatible system (#675)
Unify product-mini main.c implementation for POSIX compatible system: create a shared main.c under platforms/posix/main.c, and in other POSIX platforms' main.c, just keep a line "#include ../posix/main.c".

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-07-29 14:38:25 +08:00
Wenyong Huang
edb184f709
Implement most missing wasm-c-api APIs (#303) (#676)
Remove unnecessary functions and implement more APIs:
- wasm_##name##same
- wasm##name##as_ref
- wasm_ref_as##name##
- wasm_ref_delete
- wasm_module_validate
- wasm_table_get/set/size
- wasm_memory_size
- wasm_config_new
- wasm_foreign_new

And add more wasm-c-api samples, update the related documen, add more CI rules.

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2021-07-28 21:53:37 +08:00
Wang Xin
4193949ef5
Update README.md (#674) 2021-07-27 13:14:56 +08:00
Wang Xin
ce2f65f3da
Merge branch 'master' into main 2021-07-27 01:07:48 -04:00
Wenyong Huang
d11743b8e2
Enable mpu stack for latest zephyr to enable app manager (#673)
And output detail info when install wasm app failed, update document and fix some compile warnings and errors.

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2021-07-27 12:22:22 +08:00
Huang Qi
586752735b
Enable to build wamrc with custom llvm and fix some compile warnings (#672)
Enable to build wamrc with custom llvm, enable to auto detect processor on apple silicon, and fix some compile warnings.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-07-26 09:29:19 +08:00
Wenyong Huang
28f104036c
Fix some compile warnings and update document (#670)
And implement clock_gettime wrapper for libc-built.
2021-07-22 19:39:53 +08:00
Huang Qi
04e7afe55d
Update documents (#669)
Update CI rules to improve CI build speed, update document about arch support and update document of wamrc help.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-07-22 13:52:48 +08:00
Huang Qi
e4023c8e02
Implement AOT support for RISCV (#649)
Enable RISCV AOT support, the supported ABIs are LP64 and LP64D for riscv64, ILP32 and ILP32D for riscv32.
For wamrc:
    use --target=riscv64/riscv32 to specify the target arch of output AOT file,
    use --target-abi=lp64d/lp64/ilp32d/ilp32 to specify the target ABI,
    if --target-abi isn't specified, by default lp64d is used for riscv64, and ilp32d is used for riscv32.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Co-authored-by: wenyongh <wenyong.huang@intel.com>
2021-07-22 11:16:47 +08:00
Wenyong Huang
ea06c19a9d
Implement wasm-c-api wasm_config related APIs (#665)
And add wasm_engine_new_with_args() declaration in wasm_c_api.h
Fix wasm-c-api frame func_offset issue in fast interp mode
Remove sanitize compiler flag in product-mini linux CMakeLists.txt
2021-07-15 10:47:40 +08:00
Wenyong Huang
0f1ce9ef3d
Implement wasm-c-api frame/trap APIs for AOT mode (#663)
And update CI workflow to build/cache llvm and run wasm-c-api samples.
2021-07-13 09:01:03 +08:00
Wenyong Huang
b554a9d05d
Implement wasm-c-api frame/trap APIs for interpreter mode (#660)
And enable to cache compiled AOT file buffer for wasm-c-api JIT mode
Avoid checks that rely on undefined C behavior
Fix issues of wasm-c-api sample trap and callback_chain

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2021-07-06 17:05:59 +08:00
Wang Xin
d91047cc37
Add the PTSC member names (#659)
* littlevgl sample update

* sample gui update

* Add TSC members
2021-07-06 09:24:09 +08:00