craspberry-pi3webassemblyplatformioassemblyscript

Error using a RaspberryPi with PlatformIO and Wasm3


I get this Error, while trying to run C and wasm code (using wasm3) on an raspberrypi using platformio:

I am using a RaspberryPi 3 Model B with Raspian I program in Visual Studio Code on the Raspberry I installed PlatformIO as Extension in VS Code

Probably there is an issue with libc?

Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/linux_arm/raspberrypi_3b.html
PLATFORM: Linux ARM (1.6.0) > Raspberry Pi 3 Model B
HARDWARE: BCM2837 1200MHz, 1GB RAM, 1GB Flash
PACKAGES: 
 - framework-wiringpi @ 1.242.0 (2.42)
LDF: Library Dependency 
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 1 compatible libraries
Scanning dependencies...
Dependency Graph
|-- Wasm3 @ 0.5.0
Building in debug mode
Linking .pio/build/raspberrypi_3b/program
/usr/bin/ld: .pio/build/raspberrypi_3b/lib47f/Wasm3/m3_compile.o: in function `op_f64_Sqrt_s':
/home/admin/Dokumente/PlatformIO/Projects/WebAssembly/.pio/libdeps/raspberrypi_3b/Wasm3/src/m3_exec.h:272: undefined reference to `sqrt'
/usr/bin/ld: .pio/build/raspberrypi_3b/lib47f/Wasm3/m3_compile.o: in function `op_f64_Sqrt_r':
/home/admin/Dokumente/PlatformIO/Projects/WebAssembly/.pio/libdeps/raspberrypi_3b/Wasm3/src/m3_exec.h:272: undefined reference to `sqrt'
/usr/bin/ld: .pio/build/raspberrypi_3b/lib47f/Wasm3/m3_compile.o: in function `op_f64_Nearest_s':
/home/admin/Dokumente/PlatformIO/Projects/WebAssembly/.pio/libdeps/raspberrypi_3b/Wasm3/src/m3_exec.h:273: undefined reference to `rint'
/usr/bin/ld: .pio/build/raspberrypi_3b/lib47f/Wasm3/m3_compile.o: in function `op_f64_Nearest_r':
/home/admin/Dokumente/PlatformIO/Projects/WebAssembly/.pio/libdeps/raspberrypi_3b/Wasm3/src/m3_exec.h:273: undefined reference to `rint'
/usr/bin/ld: .pio/build/raspberrypi_3b/lib47f/Wasm3/m3_compile.o: in function `op_f64_Trunc_s':
/home/admin/Dokumente/PlatformIO/Projects/WebAssembly/.pio/libdeps/raspberrypi_3b/Wasm3/src/m3_exec.h:271: undefined reference to `trunc'
/usr/bin/ld: .pio/build/raspberrypi_3b/lib47f/Wasm3/m3_compile.o: in function `op_f64_Trunc_r':
/home/admin/Dokumente/PlatformIO/Projects/WebAssembly/.pio/libdeps/raspberrypi_3b/Wasm3/src/m3_exec.h:271: undefined reference to `trunc'
/usr/bin/ld: .pio/build/raspberrypi_3b/lib47f/Wasm3/m3_compile.o: in function `op_f64_Floor_s':
/home/admin/Dokumente/PlatformIO/Projects/WebAssembly/.pio/libdeps/raspberrypi_3b/Wasm3/src/m3_exec.h:270: undefined reference to `floor'
/usr/bin/ld: .pio/build/raspberrypi_3b/lib47f/Wasm3/m3_compile.o: in function `op_f64_Floor_r':
/home/admin/Dokumente/PlatformIO/Projects/WebAssembly/.pio/libdeps/raspberrypi_3b/Wasm3/src/m3_exec.h:270: undefined reference to `floor'
/usr/bin/ld: .pio/build/raspberrypi_3b/lib47f/Wasm3/m3_compile.o: in function `op_f64_Ceil_s':
/home/admin/Dokumente/PlatformIO/Projects/WebAssembly/.pio/libdeps/raspberrypi_3b/Wasm3/src/m3_exec.h:269: undefined reference to `ceil'
/usr/bin/ld: .pio/build/raspberrypi_3b/lib47f/Wasm3/m3_compile.o: in function `op_f64_Ceil_r':
/home/admin/Dokumente/PlatformIO/Projects/WebAssembly/.pio/libdeps/raspberrypi_3b/Wasm3/src/m3_exec.h:269: undefined reference to `ceil'
/usr/bin/ld: .pio/build/raspberrypi_3b/lib47f/Wasm3/m3_compile.o: in function `op_f32_Sqrt_s':
/home/admin/Dokumente/PlatformIO/Projects/WebAssembly/.pio/libdeps/raspberrypi_3b/Wasm3/src/m3_exec.h:272: undefined reference to `sqrtf'
/usr/bin/ld: .pio/build/raspberrypi_3b/lib47f/Wasm3/m3_compile.o: in function `op_f32_Sqrt_r':
/home/admin/Dokumente/PlatformIO/Projects/WebAssembly/.pio/libdeps/raspberrypi_3b/Wasm3/src/m3_exec.h:272: undefined reference to `sqrtf'
/usr/bin/ld: .pio/build/raspberrypi_3b/lib47f/Wasm3/m3_compile.o: in function `op_f32_Nearest_s':
/home/admin/Dokumente/PlatformIO/Projects/WebAssembly/.pio/libdeps/raspberrypi_3b/Wasm3/src/m3_exec.h:273: undefined reference to `rintf'
/usr/bin/ld: .pio/build/raspberrypi_3b/lib47f/Wasm3/m3_compile.o: in function `op_f32_Nearest_r':
/home/admin/Dokumente/PlatformIO/Projects/WebAssembly/.pio/libdeps/raspberrypi_3b/Wasm3/src/m3_exec.h:273: undefined reference to `rintf'
/usr/bin/ld: .pio/build/raspberrypi_3b/lib47f/Wasm3/m3_compile.o: in function `op_f32_Trunc_s':
/home/admin/Dokumente/PlatformIO/Projects/WebAssembly/.pio/libdeps/raspberrypi_3b/Wasm3/src/m3_exec.h:271: undefined reference to `truncf'
/usr/bin/ld: .pio/build/raspberrypi_3b/lib47f/Wasm3/m3_compile.o: in function `op_f32_Trunc_r':
/home/admin/Dokumente/PlatformIO/Projects/WebAssembly/.pio/libdeps/raspberrypi_3b/Wasm3/src/m3_exec.h:271: undefined reference to `truncf'
/usr/bin/ld: .pio/build/raspberrypi_3b/lib47f/Wasm3/m3_compile.o: in function `op_f32_Floor_s':
/home/admin/Dokumente/PlatformIO/Projects/WebAssembly/.pio/libdeps/raspberrypi_3b/Wasm3/src/m3_exec.h:270: undefined reference to `floorf'
/usr/bin/ld: .pio/build/raspberrypi_3b/lib47f/Wasm3/m3_compile.o: in function `op_f32_Floor_r':
/home/admin/Dokumente/PlatformIO/Projects/WebAssembly/.pio/libdeps/raspberrypi_3b/Wasm3/src/m3_exec.h:270: undefined reference to `floorf'
/usr/bin/ld: .pio/build/raspberrypi_3b/lib47f/Wasm3/m3_compile.o: in function `op_f32_Ceil_s':
/home/admin/Dokumente/PlatformIO/Projects/WebAssembly/.pio/libdeps/raspberrypi_3b/Wasm3/src/m3_exec.h:269: undefined reference to `ceilf'
/usr/bin/ld: .pio/build/raspberrypi_3b/lib47f/Wasm3/m3_compile.o: in function `op_f32_Ceil_r':
/home/admin/Dokumente/PlatformIO/Projects/WebAssembly/.pio/libdeps/raspberrypi_3b/Wasm3/src/m3_exec.h:269: undefined reference to `ceilf'
collect2: error: ld returned 1 exit status
*** [.pio/build/raspberrypi_3b/program] Error 1
====================== [FAILED] Took 4.48 seconds ======================

I already tried to add build_flags = -lm or lib_ldf_mode = chain+ to platformio.ini


Solution

  • I just commented out the lines in the m3_exec.h file. Seems like PlattformIO doesn't like floats in combination with wasm3.