arduino-cli on Alpine Linux on RPi

joji

New member
Greetings.

I've been trying to make a Raspberry Pi 3b as Teensyduino build system. It is running Alpine Linux and I installed arduino-cli on it. I'm able to compile sketches for Arduino Uno. However, compiling sketches for Teensy 4.1 is resulting in segmentation fault.

Error is:
$ arduino-cli compile -v --warnings all --fqbn teensy:avr:teensy41 TestSketch

FQBN: teensy:avr:teensy41
Using board 'teensy41' from platform in folder: /home/joji/.arduino15/packages/teensy/hardware/avr/1.59.0
Using core 'teensy4' from platform in folder: /home/joji/.arduino15/packages/teensy/hardware/avr/1.59.0

Detecting libraries used...
/home/joji/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++17 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=159 -DARDUINO=10607 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/home/joji/.arduino15/packages/teensy/hardware/avr/1.59.0/cores/teensy4 /home/joji/.cache/arduino/sketches/80108471299174CDCBFA60F9F46DBB42/sketch/TestSketch.ino.cpp -o /dev/null
Error while detecting libraries included by /home/joji/.cache/arduino/sketches/80108471299174CDCBFA60F9F46DBB42/sketch/TestSketch.ino.cpp
Generating function prototypes...
/home/joji/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++17 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=159 -DARDUINO=10607 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/home/joji/.arduino15/packages/teensy/hardware/avr/1.59.0/cores/teensy4 /home/joji/.cache/arduino/sketches/80108471299174CDCBFA60F9F46DBB42/sketch/TestSketch.ino.cpp -o /tmp/1261320771/sketch_merged.cpp

Used platform Version Path
teensy:avr 1.59.0 /home/joji/.arduino15/packages/teensy/hardware/avr/1.59.0
Error during build: signal: segmentation fault


It turns out the problem seems to be related to Alpine Linux using musl libraries. I've installed the gcompat package.

I tried the following command:

$ ldd /home/joji/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/arm-none-eabi-g++
/lib/ld-linux-aarch64.so.1 (0x7fa1650000)
libc.so.6 => /lib/ld-linux-aarch64.so.1 (0x7fa1650000)
ld-linux-aarch64.so.1 => /lib/ld-linux-aarch64.so.1 (0x7fa162f000)
Error relocating /home/joji/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/arm-none-eabi-g++: __realpath_chk: symbol not found
Error relocating /home/joji/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/arm-none-eabi-g++: __sprintf_chk: symbol not found
Error relocating /home/joji/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/arm-none-eabi-g++: __snprintf_chk: symbol not found
Error relocating /home/joji/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/arm-none-eabi-g++: __printf_chk: symbol not found
Error relocating /home/joji/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/arm-none-eabi-g++: __vfprintf_chk: symbol not found
Error relocating /home/joji/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/arm-none-eabi-g++: __fprintf_chk: symbol not found
Error relocating /home/joji/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/arm-none-eabi-g++: __vsprintf_chk: symbol not found
Error relocating /home/joji/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/arm-none-eabi-g++: __strcat_chk: symbol not found
Error relocating /home/joji/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/arm-none-eabi-g++: __read_chk: symbol not found

Does aybody else use a similar setup and have they overcome this issue? Any help/suggestions will be greatly appreciated.

Thank you.
 
Back
Top