Skip to content

setup-build-env: Fix cross-compilation dependencies - #230

Merged
theihor merged 1 commit into
mainfrom
cross-sysroot
Aug 11, 2026
Merged

setup-build-env: Fix cross-compilation dependencies#230
theihor merged 1 commit into
mainfrom
cross-sysroot

Conversation

@theihor

@theihor theihor commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

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

Breaks: libc6-dev-<arch>-cross (<< 2.43~)

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.

@theihor
theihor marked this pull request as ready for review August 11, 2026 20:02
@theihor theihor changed the title setup-build-env: unpack target libraries into a sysroot setup-build-env: Fix cross-compilation dependencies Aug 11, 2026
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>
@theihor
theihor merged commit 5fe6651 into main Aug 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant