setup-build-env: Fix cross-compilation dependencies - #230
Merged
Conversation
theihor
marked this pull request as ready for review
August 11, 2026 20:02
Cross-compilation is broken for every Debian target. glibc 2.43-3 entered
unstable on 2026-08-10, and libc6-dev:<arch> from 2.43 onwards declares
Breaks: libc6-dev-<arch>-cross (<< 2.43~)
while src:cross-toolchain-base is still at version 80 and ships
libc6-dev-<arch>-cross 2.42-12cross1. g++-<ver>-<arch>-linux-gnu depends on it
through libstdc++-<ver>-dev-<arch>-cross, so installing the cross toolchain and
the multiarch :<arch> -dev libraries in a single apt transaction is now
unsatisfiable. Waiting for the archive is not an option: cross-toolchain-base
cannot be rebuilt at all until its Build-Depends stop naming linux-source-6.18,
which sid left behind long ago (Debian #1130544, open since 2026-03-12; the
glibc skew itself is #1144098).
The root problem is that the target libraries are installed into the host dpkg
database. That subjects them to Multi-Arch: same version equality against the
host-arch copies, and to the Breaks above, neither of which has anything to do
with cross-compiling. Version skew between the builder image and the archive is
already fatal for a second, independent reason: the image carries libssl-dev
3.6.2-1 while the archive offers 3.6.3-1.
Download the target libraries and unpack them into the cross toolchain's own
triplet directory instead. apt-get download resolves no dependencies and writes
no dpkg state, so neither constraint can apply, and /usr/<arch>-linux-gnu is
already on the cross gcc's default search path, so no build flags change.
Drop linux-libc-dev:<arch>: it is Architecture: all, so the qualifier was a
no-op, and the target UAPI headers come from linux-libc-dev-<arch>-cross.
Verified on Debian sid with gcc-15, Ubuntu noble with gcc-14 and Ubuntu plucky
with gcc-15, building libbpf, a static cross bpftool, sign-file, and clang's
s390x userspace targets.
Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cross-compilation is broken for every Debian target. glibc 2.43-3 entered unstable on 2026-08-10, and libc6-dev: from 2.43 onwards declares
while src:cross-toolchain-base is still at version 80 and ships libc6-dev--cross 2.42-12cross1. g++---linux-gnu depends on it through libstdc++--dev--cross, so installing the cross toolchain and the multiarch : -dev libraries in a single apt transaction is now unsatisfiable. Waiting for the archive is not an option: cross-toolchain-base cannot be rebuilt at all until its Build-Depends stop naming linux-source-6.18, which sid left behind long ago (Debian #1130544, open since 2026-03-12; the glibc skew itself is #1144098).
The root problem is that the target libraries are installed into the host dpkg database. That subjects them to Multi-Arch: same version equality against the host-arch copies, and to the Breaks above, neither of which has anything to do with cross-compiling. Version skew between the builder image and the archive is already fatal for a second, independent reason: the image carries libssl-dev 3.6.2-1 while the archive offers 3.6.3-1.
Download the target libraries and unpack them into the cross toolchain's own triplet directory instead. apt-get download resolves no dependencies and writes no dpkg state, so neither constraint can apply, and /usr/-linux-gnu is already on the cross gcc's default search path, so no build flags change.
Drop linux-libc-dev:: it is Architecture: all, so the qualifier was a no-op, and the target UAPI headers come from linux-libc-dev--cross.
Verified on Debian sid with gcc-15, Ubuntu noble with gcc-14 and Ubuntu plucky with gcc-15, building libbpf, a static cross bpftool, sign-file, and clang's s390x userspace targets.