Closed
Description
What kind of issue is this?
- PlatformIO Core. If you’ve found a bug, please provide an information below.
Configuration
Operating system:
Armbian on Orange Pi Prime (Ubuntu Xenial based):
$ uname -a
Linux 88eda1b42c6c 4.14.8-sunxi64 #68 SMP Thu Dec 21 12:52:19 CET 2017 aarch64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.3 LTS
Release: 16.04
Codename: xenial
PlatformIO Version (platformio --version
):
$ platformio --version
PlatformIO, version 3.5.0
$ file ~/.platformio/packages/toolchain-xtensa/bin/xtensa-lx106-elf-c++
/root/.platformio/packages/toolchain-xtensa/bin/xtensa-lx106-elf-c++: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, for GNU/Linux 2.6.26, BuildID[sha1]=ad8066d871f3e7952a6b38339fb4b9e23a48d4ef, stripped
Description of problem
While PlatformIO itself installs correctly and can initialize a project, it would seems that binaries pulled for arm64v8 (aarch64) are not actually made for this architecture, so they cause exceptions and dump core.
Would be great to have an option to build a toolchain on the spot, rather than pulling a precompiled one.
$ pio run -v
[Thu Dec 28 22:31:32 2017] Processing esp01_1m (platform: espressif8266; board: esp01_1m; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------
Collected 23 compatible libraries
Looking for dependencies...
No dependencies
xtensa-lx106-elf-g++ -o .pioenvs/esp01_1m/src/test.o -c -fno-rtti -fno-exceptions -std=c++11 -Os -mlongcalls -mtext-section-literals -falign-functions=4 -ffunction-sections -fdata-sections -DARDUINO=20300 -DLWIP_OPEN_SRC -DF_CPU=80000000L -D__ets__ -DICACHE_FLASH -DPLATFORMIO=30500 -DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP01 -U__STRICT_ANSI__ -I/root/.platformio/packages/framework-arduinoespressif8266/tools/sdk/include -I/root/.platformio/packages/framework-arduinoespressif8266/tools/sdk/lwip/include -I/root/.platformio/packages/framework-arduinoespressif8266/cores/esp8266 -I/root/.platformio/packages/framework-arduinoespressif8266/variants/generic -Isrc -Iinclude src/test.cpp
xtensa-lx106-elf-ar rc .pioenvs/esp01_1m/libFrameworkArduinoVariant.a
xtensa-lx106-elf-g++ -o .pioenvs/esp01_1m/FrameworkArduino/Esp.o -c -fno-rtti -fno-exceptions -std=c++11 -Os -mlongcalls -mtext-section-literals -falign-functions=4 -ffunction-sections -fdata-sections -DARDUINO=20300 -DLWIP_OPEN_SRC -DF_CPU=80000000L -D__ets__ -DICACHE_FLASH -DPLATFORMIO=30500 -DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP01 -U__STRICT_ANSI__ -I/root/.platformio/packages/framework-arduinoespressif8266/tools/sdk/include -I/root/.platformio/packages/framework-arduinoespressif8266/tools/sdk/lwip/include -I/root/.platformio/packages/framework-arduinoespressif8266/cores/esp8266 -I/root/.platformio/packages/framework-arduinoespressif8266/variants/generic /root/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/Esp.cpp
xtensa-lx106-elf-g++ -o .pioenvs/esp01_1m/FrameworkArduino/FS.o -c -fno-rtti -fno-exceptions -std=c++11 -Os -mlongcalls -mtext-section-literals -falign-functions=4 -ffunction-sections -fdata-sections -DARDUINO=20300 -DLWIP_OPEN_SRC -DF_CPU=80000000L -D__ets__ -DICACHE_FLASH -DPLATFORMIO=30500 -DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP01 -U__STRICT_ANSI__ -I/root/.platformio/packages/framework-arduinoespressif8266/tools/sdk/include -I/root/.platformio/packages/framework-arduinoespressif8266/tools/sdk/lwip/include -I/root/.platformio/packages/framework-arduinoespressif8266/cores/esp8266 -I/root/.platformio/packages/framework-arduinoespressif8266/variants/generic /root/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/FS.cpp
Illegal instruction (core dumped)
*** [.pioenvs/esp01_1m/libFrameworkArduinoVariant.a] Error 132
Illegal instruction (core dumped)
*** [.pioenvs/esp01_1m/src/test.o] Error 132
Illegal instruction (core dumped)
*** [.pioenvs/esp01_1m/FrameworkArduino/Esp.o] Error 132
Illegal instruction (core dumped)
*** [.pioenvs/esp01_1m/FrameworkArduino/FS.o] Error 132
====================================================== [ERROR] Took 4.31 seconds ======================================================
Steps to Reproduce
On Orange Pi Prime (or assumably any Armbian/aarch64 board):
- git clone https://github.com/lobradov/docker-platformio.git
- cd docker-platformio
- docker build -t pio-build .
This will pull the latest debian-slim container image, install python, pull PlatformIO and try to compile an empty test.ino sketch. Feel free to ignore docker specifics.
Actual Results
On arm64v8 (aarch64), docker build breaks at compiling test.ino:
[...]
Converting test.ino
Illegal instruction (core dumped)
*** Error 132
AssertionError: :
File "/usr/local/lib/python2.7/dist-packages/platformio/builder/main.py", line 158:
env.SConscript("$BUILD_SCRIPT")
File "/root/.platformio/packages/tool-scons/script/../engine/SCons/Script/SConscript.py", line 541:
return _SConscript(self.fs, *files, **subst_kw)
File "/root/.platformio/packages/tool-scons/script/../engine/SCons/Script/SConscript.py", line 250:
exec _file_ in call_stack[-1].globals
File "/root/.platformio/platforms/espressif8266/builder/main.py", line 375:
target_elf = env.BuildProgram()
File "/root/.platformio/packages/tool-scons/script/../engine/SCons/Environment.py", line 224:
return self.method(*nargs, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/platformio/builder/tools/platformio.py", line 58:
env.BuildFrameworks(env.get("PIOFRAMEWORK"))
File "/root/.platformio/packages/tool-scons/script/../engine/SCons/Environment.py", line 224:
return self.method(*nargs, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/platformio/builder/tools/platformio.py", line 257:
env.ConvertInoToCpp()
File "/root/.platformio/packages/tool-scons/script/../engine/SCons/Environment.py", line 224:
return self.method(*nargs, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/platformio/builder/tools/piomisc.py", line 189:
out_file = c.convert(ino_nodes)
File "/usr/local/lib/python2.7/dist-packages/platformio/builder/tools/piomisc.py", line 54:
return self.process(contents)
File "/usr/local/lib/python2.7/dist-packages/platformio/builder/tools/piomisc.py", line 77:
assert self._gcc_preprocess(contents, out_file)
========================== [ERROR] Took 40.62 seconds ==========================
The command '/bin/sh -c python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/develop/scripts/get-platformio.py)" && pio settings set enable_telemetry No && pio init --board=esp01_1m -d /tmp/bootstrap && cd /tmp/bootstrap && pio lib --global install PubSubClient && pio lib --global install ArduinoJSON && pio run && rm -rf /var/lib/apt/lists/* && rm -rf /tmp/bootstrap' returned a non-zero code: 1
Expected Results
On amd64 (x86_64), build is normal and goes like:
$ docker build -t pio-build .
Sending build context to Docker daemon 75.26kB
Step 1/5 : FROM debian:stable-slim
stable-slim: Pulling from library/debian
[...]
[Thu Dec 28 22:46:30 2017] Processing esp01_1m (platform: espressif8266; board: esp01_1m; framework: arduino)
--------------------------------------------------------------------------------
PlatformManager: Installing espressif8266
Downloading
[...]
Verbose mode can be enabled via `-v, --verbose` option
Converting test.ino
Collected 25 compatible libraries
Looking for dependencies...
No dependencies
Compiling .pioenvs/esp01_1m/src/test.ino.o
Archiving .pioenvs/esp01_1m/libFrameworkArduinoVariant.a
Compiling .pioenvs/esp01_1m/FrameworkArduino/Esp.o
Compiling .pioenvs/esp01_1m/FrameworkArduino/FS.o
Compiling .pioenvs/esp01_1m/FrameworkArduino/HardwareSerial.o
[...]
Linking .pioenvs/esp01_1m/firmware.elf
Building .pioenvs/esp01_1m/firmware.bin
Calculating size .pioenvs/esp01_1m/firmware.elf
text data bss dec hex filename
221014 888 29408 251310 3d5ae .pioenvs/esp01_1m/firmware.elf
========================= [SUCCESS] Took 13.27 seconds =========================
---> 813b8b1cdc99
Removing intermediate container d99aef256aae
Successfully built 813b8b1cdc99
Successfully tagged pio-build:latest
If problems with PlatformIO Build System:
The content of platformio.ini
:
[env:esp01_1m]
platform = espressif8266
board = esp01_1m
framework = arduino
Source file to reproduce issue:
void setup() { };
void loop() { };