Source: mono
Version: 6.14.1+ds-6
Tags: patch
User: [email protected]
Usertags: ftcbfs

mono fails to cross build from source. The immediate failure is around 
finding atomic_ops.h during compilation of the vendored boehm gc. During 
cross compilation it assumes that gcc intrinsics are not working and 
requires libatomic-ops-dev. I suggest being explicit about not using 
that.

Nextup, the binfmt detector is built with a native toolchain. Wrapping 
its build in dh_auto_build fixes that.

>From there, it becomes difficult. It seems like it compiles mono 
libraries using the built compiler. Of course that compiler cannot be 
run during cross compilation and things don't to too well. I guess that 
we'd need an actual mono cross compiler to move forward here and that 
may not actually be worth the effort.

Would you mind fixing the first two aspects as their solution is 
relatively obvious? Please close this bug when doing so.

Helmut
diff -Nru mono-6.14.1+ds/debian/changelog mono-6.14.1+ds/debian/changelog
--- mono-6.14.1+ds/debian/changelog     2025-08-26 13:29:11.000000000 +0200
+++ mono-6.14.1+ds/debian/changelog     2025-08-28 17:54:34.000000000 +0200
@@ -1,3 +1,12 @@
+mono (6.14.1+ds-6.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Improve cross building: (Closes: #-1)
+    + Tell boehm gc to use gcc atomic intrinsics.
+    + Let dh_auto_build pass cross tools to the binfmt detector.
+
+ -- Helmut Grohne <[email protected]>  Thu, 28 Aug 2025 17:54:34 +0200
+
 mono (6.14.1+ds-6) unstable; urgency=medium
 
   * Stop trying to kill all mono processes during tests.
diff -Nru mono-6.14.1+ds/debian/rules mono-6.14.1+ds/debian/rules
--- mono-6.14.1+ds/debian/rules 2025-08-25 02:12:48.000000000 +0200
+++ mono-6.14.1+ds/debian/rules 2025-08-28 17:54:34.000000000 +0200
@@ -64,6 +64,7 @@
 CONFIGURE = --libdir=/usr/lib/ --libexecdir=/usr/lib/ \
        --with-ikvm-native=no --disable-quiet-build --with-csc=mcs \
        --disable-system-aot --enable-llvm=no --enable-loadedllvm=no \
+       --with-libatomic-ops=none \
        $(CONF_FLAGS)
 
 
@@ -83,7 +84,7 @@
        cd mono && $(MAKE) $(MONO_MAKE_FLAGS)
        LC_ALL=C $(MAKE) $(MAKE_FLAGS) EXTERNAL_MCS=false EXTERNAL_MONO=false
 
-       cd debian/detector && $(MAKE)
+       dh_auto_build --sourcedirectory=debian/detector
        chmod +x debian/dh_makeclilibs \
                 debian/dh_clistrip
        cp -a ./external/binary-reference-assemblies/v4.7.1 
./external/binary-reference-assemblies/v4.7.1.debbak

Reply via email to