Compare commits

..

15 Commits

Author SHA1 Message Date
YAMAMOTO Takashi
a2c55b1410
Merge 10e7fb7012 into 0e8b57d8a8 2025-05-07 18:16:09 +09:00
YAMAMOTO Takashi
10e7fb7012 JIT: don't join worker threads twice
in case of WASM_ENABLE_LAZY_JIT==0, compile_jit_functions should
have already joined these threads. joining them again here is
an undefined behavior.
2025-05-07 18:15:54 +09:00
YAMAMOTO Takashi
0860d7fda6 CI: make macos' build_samples_wasm_c_api similar to ubuntu 2025-05-07 13:16:29 +09:00
YAMAMOTO Takashi
0df6dc42af Revert "aot_create_comp_context: disable small data section"
This reverts commit 6ae395a8ce.
2025-05-07 13:16:29 +09:00
YAMAMOTO Takashi
26c35cbb6c spec_test_on_nuttx.yml: disable xtensa xip 2025-05-07 13:16:29 +09:00
YAMAMOTO Takashi
db6ea1d0f4 Revert "wamr-test-suites: disable xtensa text section literals for now"
This reverts commit 6b7ff691fe.
2025-05-07 13:16:29 +09:00
YAMAMOTO Takashi
14be14f337 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 13:16:29 +09:00
YAMAMOTO Takashi
0c9dd5a346 wamr-test-suites: disable xtensa text section literals for now 2025-05-07 13:16:29 +09:00
YAMAMOTO Takashi
4d73ab0bbc 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 13:16:29 +09:00
YAMAMOTO Takashi
b8bd1ef274 wamr-compiler: size_level=0 for sgx mode
cf. https://github.com/bytecodealliance/wasm-micro-runtime/issues/3035
2025-05-07 13:16:29 +09:00
YAMAMOTO Takashi
766145a166 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 13:16:29 +09:00
YAMAMOTO Takashi
3f3a214411 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 13:16:29 +09:00
Chris Woods
0e8b57d8a8
More detail to python setup, and fixed small typo (#4247)
Some checks are pending
compilation on SGX / build_iwasm (-DWAMR_DISABLE_HW_BOUND_CHECK=1, $FAST_INTERP_BUILD_OPTIONS, ubuntu-22.04, linux-sgx) (push) Waiting to run
compilation on SGX / build_iwasm (-DWAMR_DISABLE_HW_BOUND_CHECK=1, $FAST_JIT_BUILD_OPTIONS, ubuntu-22.04, linux-sgx) (push) Waiting to run
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $AOT_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (push) Blocked by required conditions
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $CLASSIC_INTERP_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (push) Blocked by required conditions
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $FAST_INTERP_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (push) Blocked by required conditions
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $FAST_JIT_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $SIMD_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $XIP_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, classic-interp, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, fast-jit, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / build (-DWAMR_BUILD_AOT=0) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=0) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_CUSTOM_NAME_SECTION=1) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_DEBUG_INTERP=1) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_LIBC_UVWASI=0 -DWAMR_BUILD_LIBC_WASI=1) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_LIB_PTHREAD=1) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_LIB_WASI_THREADS=1) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_REF_TYPES=1) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_SIMD=1) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_TAIL_CALL=1) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_DISABLE_HW_BOUND_CHECK=1) (push) Waiting to run
compilation on windows-latest / test (classic-interp, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (classic-interp, $MULTI_MODULES_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (classic-interp, $THREADS_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (classic-interp, $WASI_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (fast-interp, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (fast-interp, $MULTI_MODULES_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (fast-interp, $THREADS_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (fast-interp, $WASI_TEST_OPTIONS) (push) Blocked by required conditions
2025-05-07 11:32:43 +08:00
YAMAMOTO Takashi
88b5f6a535
samples/wasm-c-api: remove unused valgrind detection (#4249)
- 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 11:32:29 +08:00
YAMAMOTO Takashi
ac2fe552d5
aot_resolve_object_relocation_group: adapt to LLVM 16 (#4250)
cf. https://reviews.llvm.org/D123264
2025-05-07 11:32:14 +08:00
4 changed files with 12 additions and 5 deletions

View File

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

View File

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

View File

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

View File

@ -1,14 +1,17 @@
# WARM API
# WAMR API
* **Notice**: The python package `wamr.wamrapi.wamr` need python >= `3.10`.
* **Notice**: The python package `wamr.wamrapi.wamr` requires a python version >= `3.10`.
## Setup
### 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
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
```