Commit Graph
39 Commits
Author SHA1 Message Date
Benbuck NasonandGitHub 2b5e2d9c2c libc-emcc: Use alternate method to check getrandom support (#3848) 2024-10-10 10:57:47 +08:00
Benbuck NasonandGitHub 72872cbd44 Fix mac build of libc_emcc_wrapper.c (#3836) 2024-10-05 15:46:23 +08:00
Benbuck NasonandGitHub e9cc8731da Restore cmake hidden compile symbol visibility (#3796)
This was originally fixed in #3655, but regressed in #3762 which removed
the `-fvisibility=hidden` flag from the CMakeLists.txt file.

This also removes extraneous ending whitespace from the file.
2024-09-18 10:24:30 +08:00
Benbuck NasonandGitHub d64a3ab6ec Fix aot multi export memory support (#3791) 2024-09-14 10:53:01 +08:00
Benbuck NasonandGitHub 926f662231 Add memory instance support apis (#3786)
Now that WAMR supports multiple memory instances, this PR adds some APIs
to access them in a standard way.

This involves moving some existing utility functions out from the
`WASM_ENABLE_MULTI_MODULE` blocks they were nested in, but multi-memory
and multi-module seem independent as far as I can tell so I assume that's okay.

APIs added:
```C
wasm_runtime_lookup_memory
wasm_runtime_get_default_memory
wasm_runtime_get_memory
wasm_memory_get_cur_page_count
wasm_memory_get_max_page_count
wasm_memory_get_bytes_per_page
wasm_memory_get_shared
wasm_memory_get_base_address
wasm_memory_enlarge
```
2024-09-14 10:31:13 +08:00
Benbuck NasonandGitHub c276aca202 Fix compile error when multi-module and tags are enabled (#3781) 2024-09-10 09:55:15 +08:00
Benbuck NasonandGitHub 1362a305f4 Restore linux iwasm default visibility (#3691)
Revert commit 6d8d60d0f0c53d5fb2477506a33bb7308b08596b:
"Set linux iwasm default visibility to hidden also"

Address comments for pull request #3655.
2024-08-07 15:12:38 +08:00
Benbuck NasonandGitHub 6be4b53bdf Add emscripten_sleep() wrapper to libc-emcc (#3669) 2024-07-30 10:52:44 +08:00
Benbuck NasonandGitHub a9cd8ba87a Set posix thread name for debug build (#3657) 2024-07-30 07:50:34 +08:00
Benbuck NasonandGitHub c05b93f992 aot runtime: Add missing arm/thumb relocations (#3660) 2024-07-25 11:06:41 +08:00
Benbuck NasonandGitHub 5be8f3580d Set compile symbol visibility to hidden in cmake (#3655)
Set compile symbol visibility to hidden in cmake of root folder and
product-mini/platforms/linux.
2024-07-24 11:37:41 +08:00
Benbuck NasonandGitHub b086d5820a Change log of import function to be consistent (#3656) 2024-07-23 09:14:49 +08:00
Benbuck NasonandGitHub 501d7d5adf Add apis to get package version (#3601)
Add three APIs:
- wasm_runtime_get_file_package_version
- wasm_runtime_get_module_package_version
- wasm_runtime_get_current_package_version
2024-07-16 08:15:59 +08:00
Benbuck NasonandGitHub 8a6379bd0a Add wasm_runtime_get_module_package_type() and wasm_runtime_get_file_package_type() (#3600)
wasm_runtime_get_file_package_type() is the counterpart of get_file_package_type().

See discussion in #3595.
2024-07-10 10:45:19 +08:00
Benbuck NasonandGitHub 8aba85825c Avoid redefining WASMMemoryType (#3602) 2024-07-10 10:05:47 +08:00
Benbuck NasonandGitHub 777121217e CMakeLists.txt: Fix Android pthread linkage (#3591)
https://developer.android.com/ndk/guides/stable_apis#core_cc

> Note that on Android, unlike Linux, there are no separate libpthread or librt libraries.
That functionality is included directly in libc, which does not need to be explicitly linked against.

Set `THREADS_PREFER_PTHREAD_FLAG` ON and find package `Threads`, then link
`${CMAKE_THREAD_LIBS_INIT}` instead of `-lpthread`.

ps.
https://cmake.org/cmake/help/latest/module/FindThreads.html
2024-07-04 10:07:57 +08:00
Benbuck NasonandGitHub e3074dc496 Add more arm AOT reloc entries (#3587)
Add missing reloc entries for Arm AOT. Also sort and remove duplicate.
2024-07-03 14:44:40 +08:00
Benbuck NasonandGitHub 837ff63662 Use 64-bit wasm_runtime_enlarge_memory() increment (#3573)
ps.
https://github.com/bytecodealliance/wasm-micro-runtime/pull/3569#discussion_r1654398315
2024-06-27 14:34:43 +08:00
Benbuck NasonandGitHub 74dbafc699 Export API wasm_runtime_enlarge_memory (#3569)
Export API wasm_runtime_enlarge_memory to support memory growth.
2024-06-26 11:07:16 +08:00
Benbuck NasonandGitHub e8df3b5c48 Consistent const keyword position in wasm_export.h (#3558) 2024-06-21 11:40:34 +08:00
Benbuck NasonandGitHub 7d3bac62af Add linked field comment for aot import type (#3557) 2024-06-21 10:24:56 +08:00
Benbuck NasonandGitHub 3746534010 Add table type API support (#3515)
Add `wasm_runtime_get_export_table_inst` and `wasm_table_get_func_inst`,
and related wasm_table_type_get_xxx APIs.
2024-06-19 14:50:46 +08:00
Benbuck NasonandGitHub 5d1f19fc09 Fix wasm_mini_loader.c build when jit or multi-module is enabled (#3502)
This PR fixes compilation error when building with
`-DWAMR_BUILD_MINI_LOADER=1 -DWAMR_BUILD_JIT=1` or
`-DWAMR_BUILD_MINI_LOADER=1 -DWAMR_BUILD_MULTI_MODULE=1`,
though normally we don't use wasm mini loader when JIT or multi-module
is enabled.
2024-06-06 09:53:22 +08:00
Benbuck NasonandGitHub 421a6c4301 Fix posix build when libc wasi is disabled and debug interp is enabled (#3503)
This change supports building with `-DWAMR_BUILD_LIBC_WASI=0` and
`-DWAMR_BUILD_DEBUG_INTERP=1`, otherwise the os_socket_* functions
will be undefined.
2024-06-06 09:37:28 +08:00
Benbuck NasonandGitHub 8239dd4aa7 Add wasm_export.h APIs to expose memory type (#3496)
Support to get `wasm_memory_type_t memory_type` from API
`wasm_runtime_get_import_type` and `wasm_runtime_get_export_type`,
and then get shared flag, initial page cout, maximum page count
from the memory_type:
```C
bool
wasm_memory_type_get_shared(const wasm_memory_type_t memory_type);
uint32_t
wasm_memory_type_get_init_page_count(const wasm_memory_type_t memory_type);
uint32_t
wasm_memory_type_get_max_page_count(const wasm_memory_type_t memory_type);
```
2024-06-06 09:20:24 +08:00
Benbuck NasonandGitHub 56b42908a8 Fix internal global getter types (#3495) 2024-06-04 11:29:31 +08:00
Benbuck NasonandGitHub c5ab862dbb Add api to get export global instance (#3452)
Add API
```C
bool
wasm_runtime_get_export_global_inst(const wasm_module_inst_t module_inst,
                                    const char *name,
                                    wasm_global_inst_t *global_inst);
```
2024-05-22 16:59:44 +08:00
Benbuck NasonandGitHub 0ceffe74a7 Add cmake static/shared library build settings (#3443)
Allow builds to target either static library only, shared library only, or both (default).
2024-05-18 21:15:11 +08:00
Benbuck NasonandGitHub 7744e84607 ssp_config.h: Fix ifdef for android random api (#3444)
It looks like the preferred preprocessor check for Android is `__ANDROID__`
instead of `ANDROID`:
https://groups.google.com/g/android-ndk/c/cf9_f1SLXls

Change `(defined(ANDROID) && __ANDROID_API__ < 28)` to
`((defined(ANDROID) || defined(__ANDROID__)) && (__ANDROID_API__ < 28))`.
2024-05-18 20:23:34 +08:00
Benbuck NasonandGitHub 0f17a1464e Add comments to global type function declarations (#3431) 2024-05-14 11:38:18 +08:00
Benbuck NasonandGitHub dbd8790681 Add WASM_V128 in wasm_valkind_enum (#3412)
Add WASM_V128 in wasm_valkind_enum and handle the the type accordingly
in wasm_c_api.c and wasm_runtime_common.c, and fix a typo in V128 union.
2024-05-14 10:22:42 +08:00
Benbuck NasonandGitHub b349d844f8 Fix workspaces path in build_wamr.sh (#3414)
This should match the path inside of .devcontainer/Dockerfile.
2024-05-13 11:47:28 +08:00
Benbuck NasonandGitHub c85bada2a9 Add wasm module global type information APIs (#3406)
Support getting global type from `wasm_runtime_get_import_type` and
`wasm_runtime_get_export_type`, and add two APIs:

```C
wasm_valkind_t
wasm_global_type_get_valkind(const wasm_global_type_t global_type);

bool
wasm_global_type_get_mutable(const wasm_global_type_t global_type);
```
2024-05-10 09:15:58 +08:00
Benbuck NasonandGitHub 432a940735 Fix clang compile warnings (#3396) 2024-05-08 16:43:47 +08:00
Benbuck NasonandGitHub 1c2a8fca4e Fix some more spelling issues (#3393) 2024-05-08 09:30:29 +08:00
Benbuck NasonandGitHub ca61184ced Fix some spelling issues (#3385)
Fix some of the spelling issues found by CSpell.
2024-05-06 07:56:48 +08:00
Benbuck NasonandGitHub c0e33f08b0 Expose API to get import/export function's param/result valkind (#3363)
Export API:
```C
   wasm_func_type_get_param_count
   wasm_func_type_get_param_valkind
   wasm_func_type_get_result_count
   wasm_func_type_get_result_valkind
```
And change wasm_import_type/wasm_export_type to wasm_import_t/wasm_export_t.
2024-05-03 09:41:08 +08:00
Benbuck NasonandGitHub 4abf288c94 Fix typo for 'native' in wasm_export.h (#3376)
Trivial spelling fix.
2024-04-30 08:57:49 +08:00
Benbuck NasonandGitHub 8253c417a8 Add functions to expose module import/export info (#3330)
Resolves #3329.
2024-04-20 08:57:39 +08:00