使用PlatformIO和Wasm3时出现了RaspberryPi错误。

huangapple go评论64阅读模式
英文:

Error using a RaspberryPi with PlatformIO and Wasm3

问题

我在尝试在树莓派上使用wasm3运行C和wasm代码(使用wasm3)时遇到了这个错误,使用platformio:

我使用的是带有Raspian的RaspberryPi 3 Model B。
我在树莓派上使用Visual Studio Code进行编程。
我在VS Code中安装了PlatformIO扩展。

可能与libc有关吗?

我已经尝试添加build_flags = -lmlib_ldf_mode = chain+platformio.ini文件中。

英文:

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

答案1

得分: 0

我刚刚在m3_exec.h文件中注释掉了这些行。
似乎PlattformIO不喜欢将浮点数与wasm3结合使用。

英文:

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

huangapple
  • 本文由 发表于 2023年7月13日 18:18:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/76678288.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定