Source: dialign-t
Version: 1.0.2-9
Tags: patch
User: helm...@debian.org
Usertags: rebootstrap

dialign-t fails to cross build from source, because it determines
compiler flags from the build architecture rather than the host
architecture. Thus cross building for e.g. mips can include -mmmx.

The attached patch goes a little further than s/BUILD/HOST/. It removes
the need to invoke the shell for each make invocation by relying on
dpkg's architecture.mk. It also enables -mmmx for more architectures
that may be relevant by matching on the cpu. It will enable these flags
on e.g.:
 * x32
 * kfreebsd-amd64
 * hurd-i386
 * musl-linux-i386

Please consider applying it.

Helmut
diff --minimal -Nru dialign-t-1.0.2/debian/changelog 
dialign-t-1.0.2/debian/changelog
--- dialign-t-1.0.2/debian/changelog    2016-12-17 12:49:37.000000000 +0100
+++ dialign-t-1.0.2/debian/changelog    2018-02-14 07:52:36.000000000 +0100
@@ -1,3 +1,10 @@
+dialign-t (1.0.2-9.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: fix build/host confusion. (Closes: #-1)
+
+ -- Helmut Grohne <hel...@subdivi.de>  Wed, 14 Feb 2018 07:52:36 +0100
+
 dialign-t (1.0.2-9) unstable; urgency=medium
 
   * Team upload.
diff --minimal -Nru dialign-t-1.0.2/debian/rules dialign-t-1.0.2/debian/rules
--- dialign-t-1.0.2/debian/rules        2016-12-17 11:36:41.000000000 +0100
+++ dialign-t-1.0.2/debian/rules        2018-02-14 07:52:36.000000000 +0100
@@ -2,7 +2,10 @@
 
 SRCDIR=$(CURDIR)/source
 
-export SSEFLAGS := $(shell if [ `dpkg-architecture -qDEB_BUILD_ARCH` = amd64 
-o `dpkg-architecture -qDEB_BUILD_ARCH` = i386 ] ; then echo "-mfpmath=sse 
-msse -mmmx" ; fi)
+include /usr/share/dpkg/architecture.mk
+ifneq ($(filter $(DEB_HOST_ARCH_CPU),amd64 i386),)
+export SSEFLAGS = -mfpmath=sse -msse -mmmx
+endif
 export DEB_BUILD_MAINT_OPTIONS += hardening=+all
 
 %:

Reply via email to