Support cross-arch toolchain packages
See original GitHub issue- Feature Request. Start by telling us what problem you’re trying to solve. Often a solution already exists! Don’t send pull requests to implement new features without first getting our support. Sometimes we leave features out on purpose to keep the project small.
Configuration
Operating system: Debian 11 on aarch64
PlatformIO Version (platformio --version
): PlatformIO Core, version 5.2.5
Description of problem
Some processors support multiple instruction sets (e.g. x64 supports x86 binaries, arm64 supports arm32 binaries). Currently PlatformIO doesn’t know that it can use 32-bit packages on a 64-bit system, so it refuses to use a 32-bit package unless Python is run inside linux32
(which causes uname
to lie about the architecture, but actually doesn’t mean Python is running as a 32-bit binary). This is because platformio is currently just calling platform.machine()
to get a single architecture name: https://github.com/platformio/platformio-core/blob/834c7b0defe39ff998cd9dc856657aeb837c86ca/platformio/util.py#L92
I’m not sure of the best generic way to solve this; there are many different combinations of architectures that can be used together (e.g. x86 on x64, arm32 on arm64, ppc on ppc64, but also x86 on arm with qemu-user-binfmt
. Maybe it could default to checking what multiarch directories exist in /usr/lib
with a configuration override to enable extra architectures?
Steps to Reproduce
On aarch64:
# If not already enabled on your system
sudo dpkg --add-architecture armel
sudo apt update
sudo apt install libc6:armel libstdc++6:armel
# Now build hello world
mkdir /tmp/test
cd /tmp/test
pio project init --board esp32-c3-devkitm-1
pio run
linux32 pio run
Actual Results
pio run
fails with:
Error: Could not find the package with 'espressif/toolchain-xtensa-esp32 @ 8.4.0+2021r2' requirements for your system 'linux_aarch64'
linux32 pio run
succeeds
Expected Results
pio run
with or without linux32
succeeds.
If problems with PlatformIO Build System:
Exactly as generated by pio project init
:
The content of platformio.ini
:
[env:esp32-c3-devkitm-1]
platform = espressif32
board = esp32-c3-devkitm-1
framework = espidf
Source file to reproduce issue:
void app_main() {}
Additional info
See also https://github.com/espressif/crosstool-NG/issues/21 requesting that espressif/toolchain-xtensa-esp32
be built for aarch64; if that’s resolved, you won’t be able to use the reproduction steps above, but any other 32-on-64 combination will also be affected.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:59 (20 by maintainers)
Top GitHub Comments
Here it is. https://github.com/tasmota/platform-espressif32 How to use in github readme
I am uploading patch3 to the registry. Please use that and not patch2