STM32 (STSTM32) Arduino code on Alpine linux won't compile at all

Hi,

I’m trying to compile dummy Arduino code (with empty ‘setup’ and loop) for STM32WB55RG Nucleo. It works nice on Ubuntu but as I started to containerise environment, I switched to lightweight Alpine.
Once starting pio run, Platformio pulls framework and tools then starts compiling and the result is as follows:

Building in release mode
Compiling .pio/build/vrelnextgen/FrameworkArduinoVariant/PeripheralPins.c.o
Error relocating /app/.platformio/packages/toolchain-gccarmnoneeabi/libexec/gcc/arm-none-eabi/12.3.1/../../../libgmp.so.10: obstack_vprintf: symbol not found
Compiling .pio/build/vrelnextgen/FrameworkArduinoVariant/generic_clock.c.o
*** [.pio/build/vrelnextgen/FrameworkArduinoVariant/PeripheralPins.c.o] Error 1
Error relocating /app/.platformio/packages/toolchain-gccarmnoneeabi/libexec/gcc/arm-none-eabi/12.3.1/../../../libgmp.so.10: obstack_vprintf: symbol not found
*** [.pio/build/vrelnextgen/FrameworkArduinoVariant/generic_clock.c.o] Error 1

The platformio.ini file is as follows:

[env:vrelnextgen]
platform = ststm32
board = nucleo_wb55rg_p
framework = arduino
lib_deps = arduino-libraries/LiquidCrystal@^1.0.7
           adafruit/Adafruit SSD1351 library@^1.3.2
           adafruit/Adafruit GFX Library@^1.11.9
           zinggjm/GxEPD2@^1.5.0
           adafruit/Adafruit NeoPixel@^1.12.0
lib_ldf_mode = deep+

Thanks in advance for any help.

So, the arm-none-eabi toolchain, that was built using for probably a Debian target, fails to startup because the gcc-internal libgmp library can’t be loaded. Well.

https://www.gnu.org/software/gnulib/manual/gnulib.html#obstack_005fvprintf

13.36.5 obstack_vprintf
This function is missing on all non-glibc platforms: macOS 11.1, FreeBSD 14.0, NetBSD 10.0, OpenBSD 6.7, Minix 3.1.8, AIX 5.1, HP-UX 11, Solaris 11.4, Cygwin 2.9, mingw, MSVC 14, Android 9.0.

Instead of Ubuntu, use Debian. It’s more lightweight, and probably as lightwight as it will go, that is still a glibc based OS.

Or maybe that compatibility module will work its magic? https://wiki.alpinelinux.org/wiki/Running_glibc_programs