PlatformIO Community

Docker Alpine Linux : arm-none-eabi-gcc not found


I’ve made an update on my docker Alpine, and my environment is not broken. Platformio is unable to find gcc for stm32 anymore.

GCC seems to be correctly installed as the command “docker container exec qapi_web_1 find / -name arm-none-eabi-gcc” returns “/root/.platformio/packages/toolchain-gccarmnoneeabi/bin/arm-none-eabi-gcc”.

Here is the log of my pio run command :

docker container exec qapi_web_1 platformio run -d /project/NUCLEO-F072RB/

Processing nucleo_f072rb (platform: ststm32; board: nucleo_f072rb; framework: stm32cube)
Verbose mode can be enabled via `-v, --verbose` option
PLATFORM: ST STM32 (15.4.1) > ST Nucleo F072RB
HARDWARE: STM32F072RBT6 48MHz, 16KB RAM, 128KB Flash
DEBUG: Current (stlink) On-board (stlink) External (blackmagic, cmsis-dap, jlink)
 - framework-stm32cubef0 @ 1.11.3
 - tool-ldscripts-ststm32 @ 0.2.0
 - toolchain-gccarmnoneeabi @ 1.70201.0 (7.2.1)
LDF: Library Dependency Finder ->
LDF Modes: Finder ~ off, Compatibility ~ soft

Gate build configuration:
        * TinyJSON translation format selected.

Pipe build configuration:
        * SERIAL mode selected.
        * NUCLEO-F0 HAL selected.

Luos engine build configuration:

/usr/local/bin/python -m pip install pyluos --upgrade --quiet
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead:

        * Pyluos revision 2.2.8 ready.
        * STM32F0 HAL selected for Luos and Robus.
        * Telemetry enabled.

Found 26 compatible libraries
Scanning dependencies...
Dependency Graph
|-- luos_engine @ 2.7.0+sha.024a688
|-- led @ 0.7.0
|   |-- luos_engine @ 2.7.0+sha.024a688
|-- Blinker_App @ 1.0.0
|   |-- luos_engine @ 2.7.0+sha.024a688
|-- Pipe @ 1.3.0
|   |-- luos_engine @ 2.7.0+sha.024a688
|-- Gate @ 1.5.0
|   |-- luos_engine @ 2.7.0+sha.024a688
|-- Inspector @ 1.4.0
|   |-- luos_engine @ 2.7.0+sha.024a688
Building in release mode
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_adc.o
sh: arm-none-eabi-gcc: not found
sh: arm-none-eabi-gcc: not found
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_adc_ex.o
sh: arm-none-eabi-gcc: not found
*** [.pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal.o] Error 127
*** [.pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_adc.o] Error 127
*** [.pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_adc_ex.o] Error 127
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_can.o
sh: arm-none-eabi-gcc: not found
*** [.pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_can.o] Error 127
========================== [FAILED] Took 6.75 seconds ==========================

Do you have any ideas ?

When you open a shell in the docker container and execute that with --version, what do you get?

docker container exec qapi_web_1 ls -ll
-rwxr-xr-x 1 root root 977368 Nov 30 2017 /root/.platformio/packages/toolchain-gccarmnoneeabi/bin/arm-none-eabi-gcc

A version from Nov 30 2017. Strange…

docker container exec qapi_web_1 sh /root/.platformio/packages/toolchain-gccarmnoneeabi/bin/arm-none-eabi-gcc -v
/root/.platformio/packages/toolchain-gccarmnoneeabi/bin/arm-none-eabi-gcc: line 1: ELF: not found
/root/.platformio/packages/toolchain-gccarmnoneeabi/bin/arm-none-eabi-gcc: line 1: syntax error: unterminated quoted string

I wonder if GCC version is correct or not

Maybe this applies? c - Executable says "line 1: ELF: not found" when starts - Stack Overflow

What does PIO say about your system type?

docker container exec qapi_web_1 sh pio system info

(or pio may be in /root/.platformio/penv/bin/pio or something.)

Thank you, but the apply doesn’t help me.

docker container exec qapi_web_1 pio system info
(without the “sh”)

PlatformIO Core 6.1.5
Python 3.9.4-final.0
System Type linux_x86_64
Platform Linux-5.15.0-52-generic-x86_64-with
File System Encoding utf-8
Locale Encoding UTF-8
PlatformIO Core Directory /root/.platformio
PlatformIO Core Executable /usr/local/bin/platformio
Python Executable /usr/local/bin/python
Global Libraries 0
Development Platforms 1
Tools & Toolchains 4

I had an old version of pio, so I made an upgrade. Arm-none-eabi-gcc generates the same error.

I think it’s more a docker configuration issue than a platformio issue. It was working a few days ago but I have regenerated my docker. I’m quite newbie to docker, so I’ve maybe forgotten to do an easy step :slight_smile:

Well, adter after a few hours reading many website, my problem is solved.

Alpine docker has a new release, so i had to :

1- Update Alpine public keys
2- Edit the Dockerfile and add these 3 libs : “apk add gcompat libc6-compat libstdc++”