Commit Graph

735 Commits

Author SHA1 Message Date
liang.he
f975a987bf
Separate MacOS workflows from the big one (#1236)
Separate MacOS workflows from the big one so as to avoid too much tasks
And optimize the total duration by reducing getting LLVM libraries times
2022-06-17 17:44:20 +08:00
dongsheng28849455
cc942e8c68
Add missing aot relocation symbols for xtensa target (#1235)
Some symbols are missing when loading the xtensa aot file.
2022-06-17 15:11:56 +08:00
Xu Jun
4b38205023
Fix some issues reported by klocwork (#1233)
Change memcpy to bh_memcpy_s and add some asserts to
enhance the security.
2022-06-16 19:50:47 +08:00
Xu Jun
188d5e70e9
Fix typo in wasm_mini_loader.c (#1232) 2022-06-16 12:07:32 +08:00
Xu Jun
b39f4c5c9b
Fix drop opcode issue in fast interpreter (#1231)
Fix fast interpreter issue reported in #1230
2022-06-16 09:51:01 +08:00
Xu Jun
e0a8aa09be
Fix build error when enable custom section without interpreter (#1229) 2022-06-15 18:14:39 +08:00
Xu Jun
1705ae569b
Update spec test script (#1227) 2022-06-15 11:07:39 +08:00
Xu Jun
77595c9560
Support emit specified custom sections into AoT file (#1207)
And add API to get the content of custom section with
section name for both wasm file and aot file.
2022-06-10 21:51:13 +08:00
Xu Jun
d404107d85
Fix typo in embed_wamr.md (#1214)
Fix typo in embed_wamr.md reported by #1211
2022-06-09 08:56:45 +08:00
Xu Jun
93607d0fac
Support print exception info in source debugger (#1212) 2022-06-08 12:17:48 +08:00
Wenyong Huang
48cdbee4e0
Update documents (#1203)
Mention the Python binding and Go binding in README.md and
embed_wamr.md.
Fix typo of esp-idf link in build_wamr.md.
2022-06-02 14:33:03 +08:00
YAMAMOTO Takashi
ec299554dd
Remove the code for WASM_ENABLE_GC (#1200)
Remove the code for WASM_ENABLE_GC as it is for a dev branch
2022-06-01 16:46:11 +08:00
Wenyong Huang
5b1dcf2fa2
Implement Go language binding (#1196)
Implement Go binding APIs of runtime, module and instance
Add sample, build scripts and update the document

Co-authored-by: venus-taibai <97893654+venus-taibai@users.noreply.github.com>
2022-06-01 11:35:05 +08:00
Wenyong Huang
3d34a91f0b
Implement Python language binding (#1192) (#1195)
Implement the first version of Python language binding

Co-authored-by: liang.he <liang.he@intel.com>
2022-05-31 16:39:46 +08:00
YAMAMOTO Takashi
3168ba8dcf
Add comments on trailing uint8[1] members in the "Common" structures (#1189)
Add comments to avoid abusing these members to store extra data.
2022-05-26 11:53:50 +08:00
YAMAMOTO Takashi
3fd763a95c
wasm_export.h: Make RuntimeInitArgs less config dependent (#1190)
This header file is supposed to be used by user code, which is not
a part of WAMR. Usually WAMR configuration is not available there,
remove DEBUG_INTERP macro control in it.
2022-05-25 18:15:51 +08:00
YAMAMOTO Takashi
2288695a33
product-mini/platforms/nuttx/wamr.mk: Build libc-wasi (#1129) 2022-05-24 16:12:08 +08:00
YAMAMOTO Takashi
da3b519642
core/shared/platform/nuttx: mock several APIs for libc-wasi (#1127) 2022-05-24 12:03:40 +08:00
liang.he
565c1c04db
Fix bh_vector extend_vector not locked issue (#1187)
Fix issue that func `extend_vector` isn't locked in vector insert and append.
2022-05-24 09:10:43 +08:00
YAMAMOTO Takashi
723a808106
nuttx: Use text heap for executable memory (#1181)
Based on nuttx patch "Add up_textheap_heapmember":
  https://github.com/apache/incubator-nuttx/pull/6306
2022-05-23 10:58:09 +08:00
YAMAMOTO Takashi
69c23aa2d4
aot_reloc_xtensa.c: define __packed if not available (#1179) 2022-05-21 16:46:02 +08:00
YAMAMOTO Takashi
c47b318aef
nuttx: add CONFIG_INTERPRETERS_WAMR_PERF_PROFILING (#1178)
Based on the corresponding nuttx patch:
  https://github.com/apache/incubator-nuttx-apps/pull/1166
2022-05-21 14:56:56 +08:00
YAMAMOTO Takashi
a50011a4dd
core/iwasm/common/wasm_application.c: Fix a typo of macro (#1180)
Change WAMR_ENABLE_PERF_PROFILING to WASM_ENABLE_PERF_PROFILING
2022-05-21 12:53:11 +08:00
Wenyong Huang
37cc6eac3b
Implement SGX getrandom/getentropy without ocall (#1176)
Implement SGX getrandom with sgx_read_rand and getentropy with `rdseed` instruction
instead of ocall to improve the security.
2022-05-21 12:21:09 +08:00
Wenyong Huang
c72501781a
Fix module_realloc with NULL ptr issue (#1175)
Fix module_realloc with NULL ptr issue reported by #1173.
2022-05-19 11:57:33 +08:00
Wenyong Huang
d7a2888b18
Fix Windows compilation warnings (#1171)
And update the Zephyr platform sample help, add arc target into usage list.
2022-05-16 09:12:58 +08:00
Namhyeon, Go
0993601d55
Add check for stack_min_addr in bound check with hardware trap (#1166)
Add return value check for os_thread_get_stack_boundary before touch_pages
in the initialization of memory access bound check with hardware trap.
2022-05-12 12:23:35 +08:00
Wenyong Huang
3d1dad7792
Fix x86-32 compile warning and update document (#1164) 2022-05-10 15:22:20 +08:00
liang.he
ceaf7dc660
Fix invalid calculation of total size of bytes to send and recv (#1162)
The total size of bytes to send and recv should be set to 0 before calculation,
but not including the size of iovec_app_t structure.
2022-05-10 10:43:34 +08:00
liang.he
3ba2d7e7de
Fix socket-api send/recv issue and c-api sample callback_chain issue (#1158)
Re-implement socket api send/recv in an atomic-like way, fix the return value
check in posix.c.
And fix wasm-c-api sample callback_chain calling malloc issue.
2022-05-09 16:52:43 +08:00
YAMAMOTO Takashi
362bd0cc5c
doc/wasm_c_api.md: Mention relationship with wasm_export.h (#1159) 2022-05-09 16:39:49 +08:00
Wenyong Huang
ca4b60b335
Auto dump mem/perf profiling in execute_main/execute_func (#1157)
Automatically dump memory/performance profiling data in
wasm_application_execute_main and wasm_application_execute_func when
the related feature is enabled.

And remove unused aot_compile_wasm_file func declaration in aot_compiler.h.
2022-05-09 15:19:55 +08:00
Xu Jun
474f081f56
Fix return value not checked issue reported by Coverity (#1156)
Fix return value not checked issue in function init_wasm_timer,
reported by Coverity
2022-05-07 19:22:00 +08:00
liang.he
ed512c6867
Fix issues detected by Coverity (#1154)
wasm_c_api.c: add more checks, fix LOG_WARNING invalid specifier
aot_emit_aot_file: fix strncpy max size length to copy
posix.c: fix potential socket not close issue
wasm-c-api samples: add return value checks for fseek/ftell
cJSON.c: remove dead code
2022-05-07 18:53:02 +08:00
Wenyong Huang
21e59d883f
Add return value checks for cJSON library (#1153) 2022-05-07 17:31:54 +08:00
Wenyong Huang
2bac6a42a7
Fix some issues reported by Coverity (#1150)
module_wasm_app.c: add return value check for wasm_runtime_call_wasm
aot_runtime.c: add return value check for aot_get_default_memory
aot_runtime.c: add return value check before calling wasm app malloc/free func
wasm_runtime_common.c: fix dead code warning in wasm_runtime_load_from_sections
aot_emit_memory.c: fix potential integer overflow issue
wasm_runtime.c: remove dead code in memory_instantiate, add assertion for globals
samples simple/gui/littlevgl: fix fields of struct sigaction initialization issue
host-tool: add return value check for sendto
2022-05-07 16:51:43 +08:00
Wenyong Huang
d62543c99c
Enlarge max pool size and fix bh_memcpy_s dest max size check (#1151)
Enlarge max pool size and fix bh_memcpy_s dest max size check to support
large linear memory, e.g. with initial page count 65535.
2022-05-07 16:09:16 +08:00
Xu Jun
a7f4c3c15c
Fix app manager/framework issues reported by Coverity (#1155)
runtime_sensor.c: add return value check for os_mutex_init
                             fix find_sensor_client
sensor_mgr_ref.c: add return value check for init_sensor_framework
app_manager_host.c: add return value check for app_manager_host_init
module_wasm_app.c: add bh_assert for m_data
                                   fix mkdir potential issue
sample littlevgl/gui/simple: add return value check for init_sensor_framework
host_tool: add more check for g_conn_fd
2022-05-07 15:43:34 +08:00
YAMAMOTO Takashi
3edb832f76
aot_reloc_arm.c: Implement R_ARM_MOVW_ABS_NC and R_ARM_MOVT_ABS (#1148)
Implement reloc type R_ARM_MOVW_ABS_NC and R_ARM_MOVT_ABS for arm,
refer to:
https://github.com/ARM-software/abi-aa/blob/main/aaelf32/aaelf32.rst#5614static-arm-relocations
2022-05-07 10:22:05 +08:00
YAMAMOTO Takashi
8db6f5978b
aot_emit_aot_file.c: Convert switch lookup table relocation (#1149)
Fix the symbol resolving failure with recent version of wamrc:
```
AOT module load failed: resolve symbol .Lswitch.table.aot _func#82.2 failed
```
Replace the relocations for such symbols with .rodata section.
2022-05-07 08:41:53 +08:00
YAMAMOTO Takashi
6fb402aeec
wasm_export.h: Add a few comments about heap and threads (#1147) 2022-05-06 18:30:48 +08:00
YAMAMOTO Takashi
03f2153270
wasm_runtime_common.c: add assertion for BH_MALLOC/BH_FREE (#1139)
Add assertion for BH_MALLOC/BH_FREE in wasm_runtime_common.c,
when building runtime, the BH_MALLOC/BH_FREE macros should be
defined as wasm_runtime_malloc/wasm_runtime_free.
2022-05-06 13:47:56 +08:00
Xu Jun
16cfd4764d
Fix atomic wait not thread safe issue (#1146)
Add lock for acquire_wait_info and release_wait_info, and
remove release_wait_info in wasm_runtime_atomic_notify.
2022-05-06 12:52:17 +08:00
Wenyong Huang
07829b90d7
Fix allocate zero size memory warning (#1143)
Fix allocate zero size memory warning reported by wasm_runtime_malloc
when allocating the import fun pointers if the import func count is 0:
    `warning: wasm_runtime_malloc with size zero`
2022-05-05 12:43:00 +08:00
Wenyong Huang
749f2f1f34
Fix wamrc build error with llvm-14 (#1140)
Fix aot compiler compilation errors when the llvm version is 14.0,
and clear one compilation warning of thread_manager.c.
2022-05-03 09:12:03 +08:00
Wenyong Huang
c6997aa68a
Fix execute_main not wait for other threads (#1137)
Fix wasm_application_execute_main/wasm_application_execute_func not waiting for
other threads to terminate in multi-thread mode, which causes that the exception
thrown by other threads may haven't been spreaded to current main thread, and
cannot be detected by the caller, as reported in #1131.
2022-04-29 15:47:43 +08:00
YAMAMOTO Takashi
2e27d506d8
posix os_socket_inet_network: Use inet_addr instead of inet_network (#1133) 2022-04-28 13:53:01 +08:00
YAMAMOTO Takashi
d9d0777051
Move dlfcn.h availability check to platform_common.h (#1134) 2022-04-28 12:31:28 +08:00
YAMAMOTO Takashi
814a76ee89
product-mini/platforms/nuttx/wamr.mk: Provide BH_MALLOC/BH_FREE (#1135) 2022-04-28 12:03:29 +08:00
Xu Jun
98431225f2
Store import function pointer in module instance (#1130)
Fix the issue reported by #1118 , use this approach since it avoids copying
unnecessary static information into instance and reduces the footprint.
2022-04-27 20:21:51 +08:00