Source: xsnow
Version: 1:3.7.6-1
Tags: patch upstream
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

xsnow fails to cross build from source, because it fails running toascii
with an Exec format error. Actually the failure is swept under the rug
and it only fails later on a negative array size as consequence. Such
continuing is a policy 4.6 violation and I encourage you to fix it.

That said, what really is the problem here is that toascii needs to be
built with the build architecture compiler. This is done with _FOR_BUILD
variants of the compiler. I'm attaching a patch, but you'll need a
dependency on autoconf-archive or update aclocal.m4 to use it.

Even with the patch applied, xsnow will not succeed in cross building as
it runs the build xsnow to generate its manual page. I don't have a good
solution to this. All options are annoying in some way:
 * Move the manual page to an Arch:all package.
 * Generate the manual page when creating a source package.
 * Make the cross build unreproducible and skip installing a manual page
   there.
 * Build-Depend on xsnow:native <cross> and run that.
 * Actually write a manual page rather than generating it from help
   output.

Do you have a preference? In the mean time, please close this bug when
addressing just the toascii matter.

Helmut
--- xsnow-3.7.6.orig/configure.ac
+++ xsnow-3.7.6/configure.ac
@@ -114,6 +114,7 @@
 AC_PROG_CXX([c++ g++])
 AC_PROG_INSTALL
 AC_PROG_RANLIB
+AC_PROG_CC_FOR_BUILD
 
 LIBS="-lm"
 # Checks for header files.
--- xsnow-3.7.6.orig/src/Makefile.am
+++ xsnow-3.7.6/src/Makefile.am
@@ -88,10 +88,10 @@
 tarfile.inc: $(tarfile) $(TOASCII)
 	@echo "Converting tarfile:"
 	ls -l $(tarfile)
-	export CC="$(CC)"; export CFLAGS="$(CFLAGS)"; $(TOASCII) < $(tarfile) > $@ 
+	env CC="$(CC_FOR_BUILD)" CFLAGS="$(CFLAGS_FOR_BUILD)" $(TOASCII) < $(tarfile) > $@ 
 else
 	tarfile.inc: 
-	echo "No selfrep compiled in" | $(TOASCII) > $@
+	echo "No selfrep compiled in" | env "CC=$(CC_FOR_BUILD)" CFLAGS="$(CFLAGS_FOR_BUILD)" $(TOASCII) > $@
 endif
 
 

Reply via email to