Package: clang-21 Version: 1:21.1.8-7+b3 Tags: patch User: [email protected] Usertags: cross-satisfiability
Packages that build-depend on clang cannot be cross built because bin:clang from src:llvm-defaults depends on bin:clang-$MAJORVER which in turn depends on binutils. I used the attached patch to build llvm-toolchain-21 on arm64/s390x. Then I used the produced binary packages and successfully cross built (on amd64 for arm64/s390x) a bunch of packages that build-depend on clang, including the package I'm interested in, libobjc2 (not yet in Debian). We at the GNUstep team plan to package the GNUstep Objective-C runtime which was specifically written for Clang, and to provide dual runtime support on architectures where it will be available. We've spent considerable efforts to make the GNUstep stack cross-buildable during the trixie release cycle and it would be a pity to lose that feature. In case you consider applying the patch, the same should be done for other (relevant) llvm-toolchain-* packages. Thanks. P.S.: I see that some packages (e.g., filament) build-depend on clang:native, have a cross-specific make conditional in debian/rules and pass --target accordingly. This won't work in our case because bin:gnustep-make must depend on clang and the :native annotation can be used only for build-dependencies, IIRC.
>From b9616f0212f5becf511b36e68d6769701c727884 Mon Sep 17 00:00:00 2001 From: Yavor Doganov <[email protected]> Date: Thu, 25 Jun 2026 23:51:03 +0300 Subject: [PATCH] Make clang-21 depend on binutils-for-host instead of binutils --- debian/changelog | 4 ++++ debian/control | 2 +- debian/control.in | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index bf26acc5..e6fdf658 100644 --- a/debian/changelog +++ b/debian/changelog @@ -22,6 +22,10 @@ llvm-toolchain-21 (1:21.1.8-8) UNRELEASED; urgency=medium clang-21-doc package. Without them, clang-doc fails with "default index.js file missing at .../share/clang-doc/index.js". + [ Yavor Doganov ] + * d/control: Let clang-21 depend on binutils-for-host instead of + binutils so that it's installable for cross builds (Closes: #-1). + -- Matthias Klose <[email protected]> Sat, 09 May 2026 09:55:55 +0200 llvm-toolchain-21 (1:21.1.8-7) unstable; urgency=medium diff --git a/debian/control b/debian/control index 3564589e..12524e44 100644 --- a/debian/control +++ b/debian/control @@ -50,7 +50,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ${dep:devlibs}, libllvm21 (= ${binary:Version}), libclang-common-21-dev (= ${binary:Version}), llvm-21-linker-tools (= ${binary:Version}), - libclang1-21 (= ${binary:Version}), libc6-dev, binutils + libclang1-21 (= ${binary:Version}), libc6-dev, binutils-for-host Provides: c-compiler, objc-compiler, c++-compiler, objc++-compiler Recommends: llvm-21-dev, python3, clang-tools-21 # libomp-21-dev diff --git a/debian/control.in b/debian/control.in index 7a6bd011..e4c8f4ae 100644 --- a/debian/control.in +++ b/debian/control.in @@ -50,7 +50,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ${dep:devlibs}, libllvm@LLVM_VERSION@ (= ${binary:Version}), libclang-common-@LLVM_VERSION@-dev (= ${binary:Version}), llvm-@LLVM_VERSION@-linker-tools (= ${binary:Version}), - libclang1-@LLVM_VERSION@ (= ${binary:Version}), libc6-dev, binutils + libclang1-@LLVM_VERSION@ (= ${binary:Version}), libc6-dev, binutils-for-host Provides: c-compiler, objc-compiler, c++-compiler, objc++-compiler Recommends: llvm-@LLVM_VERSION@-dev, python3, clang-tools-@LLVM_VERSION@ # libomp-@LLVM_VERSION@-dev -- 2.53.0

