Commit Graph

529 Commits

Author SHA1 Message Date
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
Wang Xin
8c826700ae Add TSC members 2021-07-04 15:48:20 +08:00
Wang Xin
85c0bc2d9d
Merge branch 'bytecodealliance:main' into master 2021-07-04 03:26:31 -04:00
Wang Xin
e92fa8744c Create TSC_Charter.md 2021-07-04 15:04:25 +08:00
Wenyong Huang
cba4c78273
Enable call wasm-c-api native func directly from interpreter (#656)
And update loader error messages for latest spec cases, fix aot compiler build error based on latest LLVM code base.
2021-06-28 11:59:49 +08:00
LiFeng
c6783ef258
IO: support populate fds into WASM application (#655)
Add new API wasm_runtime_set_wasi_args_ex to support populate stdio fds

Signed-off-by: LiFeng <lifeng68@huawei.com>
2021-06-22 14:41:49 +08:00
LiFeng
38c2ca63d0
sgx: fix the build warning (#653)
fix the warnings as below:

App/App.cpp: In function ‘int wamr_pal_init(const wamr_pal_attr*)’:
App/App.cpp:759:1: warning: control reaches end of non-void function [-Wreturn-type]
  759 | }
      | ^
In file included from /usr/include/string.h:495,
                 from App/App.cpp:9:
In function ‘char* strncpy(char*, const char*, size_t)’,
    inlined from ‘int enclave_init(sgx_enclave_id_t*)’ at App/App.cpp:104:16:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:34: warning: ‘char* __builtin___strncpy_chk(char*, const char*, long unsigned int, long unsigned int)’ specified bound depends on the length of the source argument [-Wstringop-overflow=]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
App/App.cpp: In function ‘int enclave_init(sgx_enclave_id_t*)’:
App/App.cpp:102:16: note: length computed here
  102 |         (strlen(home_dir) + strlen("/") + sizeof(TOKEN_FILENAME) + 1) <= MAX_PATH) {
      |          ~~~~~~^~~~~~~~~~

Signed-off-by: LiFeng <lifeng68@huawei.com>
2021-06-18 12:45:34 +08:00
Wenyong Huang
77c71e559a
Add wasm-c-api nested function calls sample (#652)
And enable to copy back the return value of wasm main function when calling wasm_application_execute_main, add license headers in wasm-c-api samples, fix several issues reported by klocwork.
2021-06-16 15:26:28 +08:00
Wenyong Huang
1a4aa5ac2f
Enable multi-thread for tensorflow sample, update wasm-c-api document (#651) 2021-06-14 08:58:32 +08:00
Huang Qi
5d9597f064
platform/nuttx: Support riscv based chips (#648)
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-06-07 15:37:09 +08:00
Wenyong Huang
a5ffd656fa
Fix wasm-c-api trap message format issue (#644)
And fix two compile warnings.
2021-06-01 15:05:35 +08:00
Masayuki Ishikawa
af793385bf
product-mini/nuttx: Add support for ARMV7A (#643)
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-06-01 14:23:20 +08:00