PlatformIO Community

Compiling fail for Bluepill STM32F103

I’ve tried to resolve below problem for a while now but need to reach out and ask for advice. I got this problem after a fresh installation of PlatformIO run as sudo.
Trying to compile my project on RPI Zero W running latest stable build of PIO Core.

Compilaton output

arm-none-eabi-gcc -o .pioenvs/prod/FrameworkArduinoVariant/PeripheralPins.c.o -c -std=gnu11 -Os -mcpu=cortex-m3 -mthumb -ffunction-sections -fdata-sections -Wall -nostdlib --param max-inline-insns-single=500 -DPLATFORMIO=30607 -DSTM32F1 -DSTM32F103xB -DARDUINO_BLUEPILL_F103C8 -DSTM32F1xx -DARDUINO=10808 -DARDUINO_ARCH_STM32 -DARDUINO_BLUEPILL_F103C8 -DBOARD_NAME=\"BLUEPILL_F103C8\" -DHAL_UART_MODULE_ENABLED -I/root/.platformio/packages/framework-arduinoststm32/cores/arduino/avr -I/root/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32 -I/root/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32/LL -I/root/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32/usb -I/root/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32/usb/hid -I/root/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32/usb/cdc -I/root/.platformio/packages/framework-arduinoststm32/system/Drivers/STM32F1xx_HAL_Driver/Inc -I/root/.platformio/packages/framework-arduinoststm32/system/Drivers/STM32F1xx_HAL_Driver/Src -I/root/.platformio/packages/framework-arduinoststm32/system/STM32F1xx -I/root/.platformio/packages/framework-arduinoststm32/system/Middlewares/ST/STM32_USB_Device_Library/Core/Inc -I/root/.platformio/packages/framework-arduinoststm32/system/Middlewares/ST/STM32_USB_Device_Library/Core/Src -I/root/.platformio/packages/framework-arduinoststm32/CMSIS/CMSIS/Core/Include -I/root/.platformio/packages/framework-arduinoststm32/system/Drivers/CMSIS/Device/ST/STM32F1xx/Include -I/root/.platformio/packages/framework-arduinoststm32/system/Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/gcc -I/root/.platformio/packages/framework-arduinoststm32/cores/arduino -I/root/.platformio/packages/framework-arduinoststm32/variants/BLUEPILL_F103XX -I/root/.platformio/packages/framework-arduinoststm32/variants/BLUEPILL_F103XX /root/.platformio/packages/framework-arduinoststm32/variants/BLUEPILL_F103XX/PeripheralPins.c

arm-none-eabi-g++ -o .pioenvs/prod/FrameworkArduinoVariant/variant.cpp.o -c -std=gnu++14 -fno-threadsafe-statics -fno-rtti -fno-exceptions -Os -mcpu=cortex-m3 -mthumb -ffunction-sections -fdata-sections -Wall -nostdlib --param max-inline-insns-single=500 -DPLATFORMIO=30607 -DSTM32F1 -DSTM32F103xB -DARDUINO_BLUEPILL_F103C8 -DSTM32F1xx -DARDUINO=10808 -DARDUINO_ARCH_STM32 -DARDUINO_BLUEPILL_F103C8 -DBOARD_NAME=\"BLUEPILL_F103C8\" -DHAL_UART_MODULE_ENABLED -I/root/.platformio/packages/framework-arduinoststm32/cores/arduino/avr -I/root/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32 -I/root/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32/LL -I/root/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32/usb -I/root/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32/usb/hid -I/root/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32/usb/cdc -I/root/.platformio/packages/framework-arduinoststm32/system/Drivers/STM32F1xx_HAL_Driver/Inc -I/root/.platformio/packages/framework-arduinoststm32/system/Drivers/STM32F1xx_HAL_Driver/Src -I/root/.platformio/packages/framework-arduinoststm32/system/STM32F1xx -I/root/.platformio/packages/framework-arduinoststm32/system/Middlewares/ST/STM32_USB_Device_Library/Core/Inc -I/root/.platformio/packages/framework-arduinoststm32/system/Middlewares/ST/STM32_USB_Device_Library/Core/Src -I/root/.platformio/packages/framework-arduinoststm32/CMSIS/CMSIS/Core/Include -I/root/.platformio/packages/framework-arduinoststm32/system/Drivers/CMSIS/Device/ST/STM32F1xx/Include -I/root/.platformio/packages/framework-arduinoststm32/system/Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/gcc -I/root/.platformio/packages/framework-arduinoststm32/cores/arduino -I/root/.platformio/packages/framework-arduinoststm32/variants/BLUEPILL_F103XX -I/root/.platformio/packages/framework-arduinoststm32/variants/BLUEPILL_F103XX /root/.platformio/packages/framework-arduinoststm32/variants/BLUEPILL_F103XX/variant.cpp

arm-none-eabi-g++ -o .pioenvs/prod/FrameworkArduino/HardwareSerial.cpp.o -c -std=gnu++14 -fno-threadsafe-statics -fno-rtti -fno-exceptions -Os -mcpu=cortex-m3 -mthumb -ffunction-sections -fdata-sections -Wall -nostdlib --param max-inline-insns-single=500 -DPLATFORMIO=30607 -DSTM32F1 -DSTM32F103xB -DARDUINO_BLUEPILL_F103C8 -DSTM32F1xx -DARDUINO=10808 -DARDUINO_ARCH_STM32 -DARDUINO_BLUEPILL_F103C8 -DBOARD_NAME=\"BLUEPILL_F103C8\" -DHAL_UART_MODULE_ENABLED -I/root/.platformio/packages/framework-arduinoststm32/cores/arduino/avr -I/root/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32 -I/root/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32/LL -I/root/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32/usb -I/root/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32/usb/hid -I/root/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32/usb/cdc -I/root/.platformio/packages/framework-arduinoststm32/system/Drivers/STM32F1xx_HAL_Driver/Inc -I/root/.platformio/packages/framework-arduinoststm32/system/Drivers/STM32F1xx_HAL_Driver/Src -I/root/.platformio/packages/framework-arduinoststm32/system/STM32F1xx -I/root/.platformio/packages/framework-arduinoststm32/system/Middlewares/ST/STM32_USB_Device_Library/Core/Inc -I/root/.platformio/packages/framework-arduinoststm32/system/Middlewares/ST/STM32_USB_Device_Library/Core/Src -I/root/.platformio/packages/framework-arduinoststm32/CMSIS/CMSIS/Core/Include -I/root/.platformio/packages/framework-arduinoststm32/system/Drivers/CMSIS/Device/ST/STM32F1xx/Include -I/root/.platformio/packages/framework-arduinoststm32/system/Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/gcc -I/root/.platformio/packages/framework-arduinoststm32/cores/arduino -I/root/.platformio/packages/framework-arduinoststm32/variants/BLUEPILL_F103XX -I/root/.platformio/packages/framework-arduinoststm32/variants/BLUEPILL_F103XX /root/.platformio/packages/framework-arduinoststm32/cores/arduino/HardwareSerial.cpp

In file included from /root/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/include/c++/7.2.1/bits/uniform_int_dist.h:35:0,
from /root/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/include/c++/7.2.1/bits/stl_algo.h:66,
from /root/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/include/c++/7.2.1/algorithm:62,
from /root/.platformio/packages/framework-arduinoststm32/cores/arduino/wiring_constants.h:26,
from /root/.platformio/packages/framework-arduinoststm32/cores/arduino/wiring.h:34,
from /root/.platformio/packages/framework-arduinoststm32/cores/arduino/Arduino.h:32,
from /root/.platformio/packages/framework-arduinoststm32/cores/arduino/HardwareSerial.cpp:26:
/root/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/include/c++/7.2.1/limits:1599:7: internal compiler error: Illegal instruction

min() _GLIBCXX_USE_NOEXCEPT { return __FLT_MIN__; }

Platformio.ini

[env:prod]
platform = ststm32
framework = arduino
board = bluepill_f103c8

Advice?

Does the problem always appear, even with a simple LED code?

Above output are from compilation of a simple Blink sketch. So yes it does allways appear