wasm-micro-runtime: samples/multi-thread build failed

reproduce steps:

cd wasm-micro-runtime/samples/multi-thread
cmake .
make

output log

[ 90%] Building C object wasm-apps/CMakeFiles/test.wasm.dir/main.c.o
[ 92%] Linking C executable test.wasm
[wasm-validator error in function 1] unexpected false: Atomic operations require threads [--enable-threads], on 
(i32.atomic.rmw.cmpxchg
 (i32.const 1272)
 (i32.const 0)
 (i32.const 1)
)
[wasm-validator error in function 1] unexpected false: Bulk memory operations require bulk memory [--enable-bulk-memory], on 
(memory.init $0
 (i32.const 1024)
 (i32.const 0)
 (i32.const 234)
)
[wasm-validator error in function 1] unexpected false: Bulk memory operations require bulk memory [--enable-bulk-memory], on 
(memory.fill
 (i32.const 1260)
 (i32.const 0)
 (i32.const 12)
)
[wasm-validator error in function 1] unexpected false: Atomic operations require threads [--enable-threads], on 
(i32.atomic.store
 (i32.const 1272)
 (i32.const 2)
)
[wasm-validator error in function 1] unexpected false: Atomic operations require threads [--enable-threads], on 
(memory.atomic.notify
 (i32.const 1272)
 (i32.const -1)
)
[wasm-validator error in function 1] unexpected false: Atomic operations require threads [--enable-threads], on 
(memory.atomic.wait32
 (i32.const 1272)
 (i32.const 1)
 (i64.const -1)
)
[wasm-validator error in function 1] unexpected false: Bulk memory operations require bulk memory [--enable-bulk-memory], on 
(data.drop $0)
[wasm-validator error in module] unexpected false: shared memory requires threads [--enable-threads], on 
memory
[wasm-validator error in module] unexpected false: nonzero segment flags require bulk memory [--enable-bulk-memory], on 
Fatal: error validating input
clang-16: error: linker command failed with exit code

About this issue

  • Original URL
  • State: open
  • Created 5 months ago
  • Comments: 18 (1 by maintainers)

Most upvoted comments

The issue is caused by wasm-opt of binaryen (which I guess is in $PATH) who can’t share clang’s command options for now. https://github.com/llvm/llvm-project/issues/55781 could give more details.

The workaround is to remove wasm-opt from $PATH.