BUG: CLI not building on RaspberryPI

Hello,

After trying quite hard and having still no solution, am posting here ;-). The pio CLI (nor Visual Code plugin) does not build on the Raspi4.

My Raspi installation:
Linux raspi4 4.19.97-v8+ #1294 SMP PREEMPT Thu Jan 30 13:27:08 GMT 2020 aarch64 GNU/Linux
(Yes, it’s x64 kernel, as the MS Visual Code is only x64 in their latest releases.)

I’ve installed also the Arduino IDE x32 (x64 doesn’t run) and it runs/builds normally.

I’ve installed the pio onto the Raspi4 - I can run “project init”, “boards” etc. (i.e. it’s running), but can not build.

When freshly installed, it gave me right away errors missing gcc components, which I installed manually:
apt install gcc-avr, binutils-avr, avr-libc

Now another error comes:
avr-g++: error trying to exec ‘cc1plus’: execvp: No such file or directory

Search for it:
find / -name cc1plus
/home/xxx/.platformio/packages/toolchain-atmelavr/libexec/gcc/avr/5.4.0/cc1plus
/home/xxx/Downloads/arduino-1.8.12/hardware/tools/avr/libexec/gcc/avr/7.3.0/cc1plus
/root/.platformio/packages/toolchain-atmelavr/libexec/gcc/avr/5.4.0/cc1plus
/usr/lib/gcc/avr/5.4.0/cc1plus
/usr/lib/gcc/arm-linux-gnueabihf/8/cc1plus

Before this error, there is a warning:
avr-gcc-ar: Cannot find plugin ‘liblto_plugin.so’

Searching for it:
find / -name liblto_plugin.so
/home/xxx/.platformio/packages/toolchain-atmelavr/libexec/gcc/avr/5.4.0/liblto_plugin.so
/home/xxx/Downloads/arduino-1.8.12/hardware/tools/avr/libexec/gcc/avr/7.3.0/liblto_plugin.so
/root/.platformio/packages/toolchain-atmelavr/libexec/gcc/avr/5.4.0/liblto_plugin.so
/usr/lib/gcc/avr/5.4.0/liblto_plugin.so
/usr/lib/gcc/arm-linux-gnueabihf/8/liblto_plugin.so
/usr/lib/bfd-plugins/liblto_plugin.so

I’m not sure if the process break because of iblto_plugin.so (I guess so) or the cc1plus. But before spending even more days into this, I thought this is surely not normal, as it should run just like that :smile:!

Any of you able to use pio on the Raspi?

Thank you

Can you open a shell and run file <that file path>? Maybe it’s an architecture mismatch.

What’s the content of /home/xxx/.platformio/packages/toolchain-atmelavr/package.json?

1 Like

Hello,

Thank you for trying to help me out ;-)!

file: symbolic link to liblto_plugin.so.0.0.0

file plugin.so.0.0.0: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, BuildID[sha1]=ee1f2f7c7f40f4492c1e3e3c017e194abe3e9bd0, not stripped

atmelavr/package.json
{
“description”: “avr-gcc”,
“name”: “toolchain-atmelavr”,
“system”: “linux_aarch64”,
“url”: “Smart | Connected | Secure | Microchip Technology”,
“version”: “1.50400.190710”
}

Thx!

This shouldn’t even have happened in the first place. PIO installs its own toolchains under ~/.platformio/packages/, as seen with /home/xxx/.platformio/packages/toolchain-atmelavr/. If it cannot find its own installed compiled, that must be fixed primarily. Can you temporarily remove your default avr-gcc and friends? Does the error message change?

I’ve removed the pakages. The errors stayed like this:
Archiving .pio/build/uno/libFrameworkArduinoVariant.a
avr-gcc-ar: Cannot find plugin ‘liblto_plugin.so’
avr-g++: error trying to exec ‘cc1plus’: execvp: No such file or directory