Stream: wamr

Topic: XIP and builtin intrisincs


view this post on Zulip Borja Tellado (May 28 2025 at 09:22):

Hi
I'm working on an STM32-based platform that runs a WebAssembly (WASM) application performing compute-intensive tasks involving double-precision and floating-point operations. Due to limited RAM and FLASH space, I aim to execute the WASM module directly from FLASH using Execute In Place (XIP).

Toolchain

Objective

Enable XIP to reduce memory footprint while maintaining full support for floating-point and double-precision computations.

Initial Approach

I compiled the WASM module using the following command:

./wamrc --xip --size-level=3 \
        --target=thumbv8m.base \
        --cpu=cortex-m33 \
        --target-abi=eabi \
        -o myfile_v8m.aot ./myfile.wasm

This enabled XIP as expected. However, at runtime, some double values were replaced by NaN, leading to incorrect calculations and integer overflows.

Following what it is described in https://github.com/bytecodealliance/wasm-micro-runtime/blob/main/doc/xip.md

I tried the following command.

```bash
./wamrc --xip --size-level=3 \
        --target=thumbv8m.base \
        --cpu=cortex-m33 \
        --target-abi=eabi \
        --enable-builtin-intrinsics=fp.common \ (
        -o myfile_v8m.aot ./myfile.wasm

With this configuration, the WASM module fails to load the  aot module and outputs the following error

** AOT module load failed: cannot apply relocation to text section for aot file generated with "--enable-indirect-mode" flag**

Am I missing something?

view this post on Zulip lum1n0us (May 28 2025 at 13:10):

Would you mind transferring this issue to GitHub https://github.com/bytecodealliance/wasm-micro-runtime/issues. so I can involve some customers with experience on that feature?

WebAssembly Micro Runtime (WAMR). Contribute to bytecodealliance/wasm-micro-runtime development by creating an account on GitHub.

view this post on Zulip Borja Tellado (May 28 2025 at 13:20):

Ok, great !! I will transfer the issue


Last updated: Dec 06 2025 at 07:03 UTC