question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:59 (20 by maintainers)

github_iconTop GitHub Comments

1reaction
Jason2866commented, Nov 17, 2022

Here it is. https://github.com/tasmota/platform-espressif32 How to use in github readme

1reaction
me-no-devcommented, Apr 2, 2022

@me-no-dev, could you publish to the registry the toolchains for patch2/patch3 for linux_aarch64?

{
  "name": "toolchain-xtensa-esp32",
  "version": "8.4.0+2021r2-patch3",
  "description": "GCC Toolchain for Espressif ESP32 Xtensa MCUs",
  "keywords": [
    "build tools",
    "compiler",
    "assembler",
    "linker",
    "preprocessor",
    "espressif",
    "esp32"
  ],
  "license": "GPL-2.0-or-later",
  "repository": {
    "type": "git",
    "url": "https://github.com/espressif/crosstool-NG"
  },
  "system": [
    "linux_aarch64"
  ]
}

Thanks!

I am uploading patch3 to the registry. Please use that and not patch2

Read more comments on GitHub >

github_iconTop Results From Across the Web

MultiarchCross - Ubuntu Wiki
Cross-architecture dependencies ... Toolchains depend and build-depend on libraries and -dev packages of specific architectures. In multiarch this ...
Read more >
CrossToolchains - Debian Wiki
Pre-built binary cross-toolchains (for amd64 and i386) and supporting packages are available from the Debian Cross-toolchains repository. See ' ...
Read more >
Developers - Support cross-arch toolchain packages - - Bountysource
An open source ecosystem for IoT development Cross-platform code builder and library manager. Continuous and IDE integration. Arduino, ESP8266 and MBED ...
Read more >
Cross-compiling tools package guidelines - ArchWiki
This page describes how to create packages for cross-compiler toolchains. Another method to cross-compile makes use of distcc on mixed ...
Read more >
Multiarch crossbuilding How to use it, and what still needs work
Emdebian dpkg-cross libc6 for armel to make libc6-armel-cross arch all ... build-essential-<arch> packages (waiting for toolchains). <triplet>-pkg-config.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found