From 1eacbd50fadec3ea4b881d5f2dfa181e5e1f69b1 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Thu, 15 Dec 2022 21:27:59 +0100 Subject: [PATCH] Support non-multiarch toolchains on 32-bit ARM (#4191) fixes https://github.com/esphome/issues/issues/3904 --- docker/Dockerfile | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index a49ad5a9ef..0dd505a9b8 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -12,6 +12,9 @@ FROM debian:bullseye-20221024-slim AS base-docker FROM base-${BASEIMGTYPE} AS base +ARG TARGETARCH +ARG TARGETVARIANT + RUN \ apt-get update \ # Use pinned versions so that we get updates with build caching @@ -36,6 +39,14 @@ ENV \ # Store globally installed pio libs in /piolibs PLATFORMIO_GLOBALLIB_DIR=/piolibs +# Support legacy binaries on Debian multiarch system. There is no "correct" way +# to do this, other than using properly built toolchains... +# See: https://unix.stackexchange.com/questions/553743/correct-way-to-add-lib-ld-linux-so-3-in-debian +RUN \ + if [ "$TARGETARCH$TARGETVARIANT" = "armv7" ]; then \ + ln -s /lib/arm-linux-gnueabihf/ld-linux.so.3 /lib/ld-linux.so.3; \ + fi + RUN \ # Ubuntu python3-pip is missing wheel pip3 install --no-cache-dir \