-
Notifications
You must be signed in to change notification settings - Fork 801
Description
Hi,
first of all, thank you for those great tools. Binaryen, especially wasm-opt has been very valuable to me.
The issue is regarding the whole aarch64 build of version 123.
I use wasm-opt for the build process of an app I am developing. It works fine on my amd64 machine. However, when I tried to move the building process (which uses wasm-opt) to a docker container running on my RPi4, the error below came. Also, to be sure that docker wasn't the issue, I ran them on my bare Raspbian shell, and it yielded the same error. After I tested around a bit, I noticed that none of the binaries provided work, all giving the same error.
Here is how I produced the error:
$ uname -a
Linux nas 6.12.34+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.12.34-1+rpt1~bookworm (2025-06-26) aarch64 GNU/Linux
$ curl --location -o /tmp/binaryen.tar.gz "https://github.com/WebAssembly/binaryen/releases/download/version_123/binaryen-version_123-aarch64-linux.tar.gz"
$ sudo tar -C /usr/local --strip-components=1 -xzf /tmp/binaryen.tar.gz
$ wasm-opt
Illegal instruction
$
I know this is a very unhelpful error, so if I can help you in any way, please let me know! Unfortunately I don't know that much about the internals of the binaryen tooling. I tried to run wasm-opt in GDB but it only returned the same error and no stack trace (except for one nameless hex address).
I tried to compile binaryen by source and it did actually (kind of) work! It was super slow on the RPi, and not all tools compiled correctly (it threw an error compiling a fuzz test), but wasm-opt and most of the other tools compiled without a problem. Here is how I produced that (if it helps):
$ git clone https://github.com/WebAssembly/binaryen.git --branch version_123 /tmp/binaryen
$ cd /tmp/binaryen/
$ git submodule update --init --recursive
[...]
$ cmake .
[...]
$ make -j $(nproc)
[...]
[ 98%] Building CXX object test/gtest/CMakeFiles/binaryen-unittests.dir/stringify.cpp.o
[ a typical gibberish C++ error ]
$ cmake -DBUILD_FUZZTEST=OFF .
$ make -j $(nproc) wasm-opt
[ 23%] Built target llvm_dwarf
[ 98%] Built target binaryen
[100%] Built target wasm-opt
$ bin/wasm-opt --version
wasm-opt version 123 (version_123)
$
Maybe it is helpful to note that the binaries as such are different:
$ file /usr/local/bin/wasm-opt # The precompiled version
/usr/local/bin/wasm-opt: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, BuildID[sha1]=b1ae49bec06c7c3f1a67b965a4878d39ffa2a63d, stripped
$ file /tmp/binaryen/bin/wasm-opt # Compiled on RPi4
/tmp/binaryen/bin/wasm-opt: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, BuildID[sha1]=59019ab3d49b89b71cc1bfea3dc9352eca63f027, for GNU/Linux 3.7.0, not stripped
So for now, building from source is a solution for my application, but of course, executable binary builds would still be a nice-to-have feature, especially when considering the slow compile times using a Raspberry Pi. Is RPi support a priority on your project?
Best Regards
Mira