Skip to content

AOT compiled WASM couldn't be loaded on macOS M1 environment #1365

@cosmo0920

Description

@cosmo0920

Step to replicates

  1. Build ./sample/basic WASM application
  2. Move to wamr-compiler and build wamrc
  3. Built AOT object from ./out/wasm-apps/testapp.wasm with wamrc:
/path/to/wamr-compiler/build/wamrc --cpu=apple-m1 --size-level=3 -o ./out/wasm-apps/testapp.aot ./out/wasm-apps/testapp.wasm
Create AoT compiler with:
  target:        arm64
  target cpu:    apple-m1
  cpu features:  
  opt level:     3
  size level:    3
  output format: AoT file
Compile success, file ./out/wasm-apps/testapp.aot was generated.
  1. Execute basic sample application with AOT object.
  2. Then, 💥!
$  ./out/basic -f out/wasm-apps/testapp.aot
Load wasm module failed. error: AOT module load failed: mmap memory failed

Environment

Software versions:

$ sw_vers
ProductName:	macOS
ProductVersion:	12.5
BuildVersion:	21G72

Host Compiler version:

$ clang --version
Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: arm64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

WASI SDK's compiler version:

$ ~/work/wasi-sdk-16.0/bin/clang --version
clang version 14.0.4 (https://github.com/llvm/llvm-project 29f1039a7285a5c3a9c353d054140bf2556d4c4d)
Target: wasm32-unknown-wasi
Thread model: posix
InstalledDir: ~/work/wasi-sdk-16.0/bin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions