[Android-tools-devel] Bug#1123019: mini-soong: support cross compilation

Helmut Grohne helmut at subdivi.de
Mon Dec 15 20:31:08 GMT 2025


Package: mini-soong
Version: 0.20201028
Tags: patch
User: debian-cross at lists.debian.org
Usertags: ftcbfs cross-satisfiability
Control: affects -1 + src:libldac

libldac cannot be cross built from source, because its mini-soong
dependency is not satisfiable. In general, Arch:all packages can never
satisfy cross Build-Depends unless marked Multi-Arch: foreign or
annotated :native. Most build systems tend to be annotated Multi-Arch:
foreign so I suggest doing it here as well. However, it defaults to the
build architecture compiler. While mini-soong consumes DEB_HOST_*
variables for a lot of things, it does not yet seed the compiler from
them. Doing so is relatively easy using dpkg's buildtools.mk as
buildflags.mk already is being used. I'm attaching a combined patch and
once it is applied, libldac actually cross builds. What do you think
about it?

Helmut
-------------- next part --------------
diff -Nru mini-soong-0.20201028/debian/changelog mini-soong-0.20201028+nmu1/debian/changelog
--- mini-soong-0.20201028/debian/changelog	2020-10-28 19:04:02.000000000 +0100
+++ mini-soong-0.20201028+nmu1/debian/changelog	2025-12-15 21:15:07.000000000 +0100
@@ -1,3 +1,13 @@
+mini-soong (0.20201028+nmu1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Support cross building: (Closes: #-1)
+    + Since mini-soong already relies on DEB_HOST_* for compiler flags and
+      other aspects, also seed the compiler.
+    + Mark Multi-Arch: foreign.
+
+ -- Helmut Grohne <helmut at subdivi.de>  Mon, 15 Dec 2025 21:15:07 +0100
+
 mini-soong (0.20201028) unstable; urgency=medium
 
   * Do not relativise variable substitutions.
diff -Nru mini-soong-0.20201028/debian/control mini-soong-0.20201028+nmu1/debian/control
--- mini-soong-0.20201028/debian/control	2020-10-28 19:04:02.000000000 +0100
+++ mini-soong-0.20201028+nmu1/debian/control	2025-12-15 21:15:07.000000000 +0100
@@ -20,6 +20,7 @@
 
 Package: mini-soong
 Architecture: all
+Multi-Arch: foreign
 Depends:
  python3-pkg-resources,
  ${python3:Depends},
diff -Nru mini-soong-0.20201028/mini_soong/builders/cc.py mini-soong-0.20201028+nmu1/mini_soong/builders/cc.py
--- mini-soong-0.20201028/mini_soong/builders/cc.py	2020-10-28 19:04:02.000000000 +0100
+++ mini-soong-0.20201028+nmu1/mini_soong/builders/cc.py	2025-12-15 21:15:07.000000000 +0100
@@ -298,6 +298,8 @@
             filename.endswith('.C'))
 
 def flag_defaults():
+    print("DPKG_EXPORT_BUILDTOOLS = 1")
+    print("-include /usr/share/dpkg/buildtools.mk\n")
     print("DPKG_EXPORT_BUILDFLAGS = 1")
     print("-include /usr/share/dpkg/buildflags.mk\n")
     print("CXXFLAGS += " + ' '.join([


More information about the Android-tools-devel mailing list