Compare commits

..

18 Commits

Author SHA1 Message Date
YAMAMOTO Takashi
cdf7ef30d6
Merge a73e3366fc into ea417d7619 2025-05-07 02:25:20 +00:00
YAMAMOTO Takashi
a73e3366fc test 2025-05-07 11:25:11 +09:00
YAMAMOTO Takashi
d6f22dc062 Revert "test"
This reverts commit 1cafd95143.
2025-05-07 09:47:07 +09:00
YAMAMOTO Takashi
1cafd95143 test 2025-05-07 09:32:54 +09:00
YAMAMOTO Takashi
e114bcc9a6 test 2025-05-07 08:45:50 +09:00
YAMAMOTO Takashi
54a14af17b CI: make macos' build_samples_wasm_c_api similar to ubuntu 2025-05-07 08:16:01 +09:00
YAMAMOTO Takashi
d8bc4f4172 samples/wasm-c-api: remove unused valgrind detection
* it's unused

* valgrind is basically a linux-only software.
  it isn't a good idea to make it a hard requirement.
  if we want to use valgrind, it's better to introduce
  a separate option to control it.
2025-05-07 08:16:01 +09:00
YAMAMOTO Takashi
56acae558b Revert "aot_create_comp_context: disable small data section"
This reverts commit 6ae395a8ce.
2025-05-07 08:16:01 +09:00
YAMAMOTO Takashi
721117a804 spec_test_on_nuttx.yml: disable xtensa xip 2025-05-07 08:16:01 +09:00
YAMAMOTO Takashi
7fd923eb42 Revert "wamr-test-suites: disable xtensa text section literals for now"
This reverts commit 6b7ff691fe.
2025-05-07 08:16:01 +09:00
YAMAMOTO Takashi
cb0ec6cb36 aot_create_comp_context: disable small data section
I observed errors like the following when trying to upgrade our
LLVM from 15 to 19.

```
AOT module load failed: resolve symbol .srodata.cst8 failed
```

The concept itself has been available since LLVM 9.
I don't know what exactly happened to trigger the use of it.

cf. https://reviews.llvm.org/D57493
2025-05-07 08:16:01 +09:00
YAMAMOTO Takashi
cdd9485d4b riscv: avoid llvm.cttz.i32/i64 for xip
LLVM 16 and later expands cttz intrinsic to a table lookup,
which involves some relocations. (unless ZBB is available,
in which case the native instructions are preferred over
the table-based lowering.)

cf. https://reviews.llvm.org/D128911
2025-05-07 08:16:01 +09:00
YAMAMOTO Takashi
08b05d4796 wamr-test-suites: disable xtensa text section literals for now 2025-05-07 08:16:01 +09:00
YAMAMOTO Takashi
b0aeea6453 aot_resolve_object_relocation_group: adapt to LLVM 19
cf.
https://github.com/llvm/llvm-project/pull/95031
https://github.com/llvm/llvm-project/pull/89693
2025-05-07 08:16:01 +09:00
YAMAMOTO Takashi
7c4bd0c9a2 aot_resolve_object_relocation_group: adapt to LLVM 16
cf. https://reviews.llvm.org/D123264
2025-05-07 08:16:01 +09:00
YAMAMOTO Takashi
cc9838be8b wamr-compiler: size_level=0 for sgx mode
cf. https://github.com/bytecodealliance/wasm-micro-runtime/issues/3035
2025-05-07 08:16:01 +09:00
YAMAMOTO Takashi
f56eeb3fa4 spec-test-script/runtest.py: --size-level=0 for x86-64
with the recent version of LLVM, wamrc --size-level=1 often
generates R_X86_64_32S relocations which fail on load with
the infamous error:

"relocation truncated to fit R_X86_64_32S failed"

it seems that these relocations are often for jump tables.

this commit workarounds it with --size-level=0.

an alternative is to disable jump tables. (although it seems that
jump tables are not the only source of these relocations.)

cf. https://github.com/bytecodealliance/wasm-micro-runtime/issues/3035

it might be better to do this in wamrc itself. however, currently
target info is not available there in case of native compilation.
related: https://github.com/bytecodealliance/wasm-micro-runtime/issues/3356
2025-05-07 08:16:01 +09:00
YAMAMOTO Takashi
a329d2aa60 build-scripts/build_llvm.py: bump to llvm 19
cf. https://github.com/bytecodealliance/wasm-micro-runtime/issues/4210

why 19, not 20?
because, as of writing this, 19 is the latest released version for
the xtensa fork of llvm: https://github.com/espressif/llvm-project
while we can use different versions for different targets,
it's nicer to use the same version everywhere when possible.
2025-05-07 08:15:56 +09:00
4 changed files with 5 additions and 12 deletions

View File

@ -424,7 +424,7 @@ jobs:
VERBOSE=1 VERBOSE=1
cmake -S . -B build ${{ matrix.make_options }} cmake -S . -B build ${{ matrix.make_options }}
cmake --build build --config Debug --parallel 4 cmake --build build --config Debug --parallel 4
ctest --test-dir build --output-on-failure ctest -V --test-dir build --output-on-failure
working-directory: samples/wasm-c-api working-directory: samples/wasm-c-api
build_samples_others: build_samples_others:

View File

@ -5711,7 +5711,6 @@ orcjit_thread_callback(void *arg)
static void static void
orcjit_stop_compile_threads(WASMModule *module) orcjit_stop_compile_threads(WASMModule *module)
{ {
#if WASM_ENABLE_LAZY_JIT != 0
uint32 i, thread_num = (uint32)(sizeof(module->orcjit_thread_args) uint32 i, thread_num = (uint32)(sizeof(module->orcjit_thread_args)
/ sizeof(OrcJitThreadArg)); / sizeof(OrcJitThreadArg));
@ -5720,7 +5719,6 @@ orcjit_stop_compile_threads(WASMModule *module)
if (module->orcjit_threads[i]) if (module->orcjit_threads[i])
os_thread_join(module->orcjit_threads[i], NULL); os_thread_join(module->orcjit_threads[i], NULL);
} }
#endif
} }
static bool static bool
@ -5743,7 +5741,7 @@ compile_jit_functions(WASMModule *module, char *error_buf,
if (os_thread_create(&module->orcjit_threads[i], orcjit_thread_callback, if (os_thread_create(&module->orcjit_threads[i], orcjit_thread_callback,
(void *)&module->orcjit_thread_args[i], (void *)&module->orcjit_thread_args[i],
APP_THREAD_STACK_SIZE_DEFAULT) APP_THREAD_STACK_SIZE_DEFAULT * 2)
!= 0) { != 0) {
set_error_buf(error_buf, error_buf_size, set_error_buf(error_buf, error_buf_size,
"create orcjit compile thread failed"); "create orcjit compile thread failed");

View File

@ -2493,7 +2493,6 @@ orcjit_thread_callback(void *arg)
static void static void
orcjit_stop_compile_threads(WASMModule *module) orcjit_stop_compile_threads(WASMModule *module)
{ {
#if WASM_ENABLE_LAZY_JIT != 0
uint32 i, thread_num = (uint32)(sizeof(module->orcjit_thread_args) uint32 i, thread_num = (uint32)(sizeof(module->orcjit_thread_args)
/ sizeof(OrcJitThreadArg)); / sizeof(OrcJitThreadArg));
@ -2502,7 +2501,6 @@ orcjit_stop_compile_threads(WASMModule *module)
if (module->orcjit_threads[i]) if (module->orcjit_threads[i])
os_thread_join(module->orcjit_threads[i], NULL); os_thread_join(module->orcjit_threads[i], NULL);
} }
#endif
} }
static bool static bool

View File

@ -1,17 +1,14 @@
# WAMR API # WARM API
* **Notice**: The python package `wamr.wamrapi.wamr` requires a python version >= `3.10`. * **Notice**: The python package `wamr.wamrapi.wamr` need python >= `3.10`.
## Setup ## Setup
### Pre-requisites ### Pre-requisites
#### Install requirements
Before proceeding it is necessary to make sure your Python environment is correctly configured. To do ths open a terminal session in this directory and perfom the following:
Install requirements,
```shell ```shell
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt pip install -r requirements.txt
``` ```