Source: traverso
Version: 0.49.5-3
Tags: patch
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

traverso fails to cross build from source from amd64 to non-amd64,
because it tries to detect compiler flags from the current cpu. That
makes it pass e.g. -msse to an arm compiler. The attached patch disables
the detection and adds back some flags for amd64 explicitly. Doing so
also fixes #916286. It also improves reproducibility of the package.
Further flags can be added to debian/rules by checking DEB_HOST_*
variables without compromising base lines or reproducibility as needed.
Please consider using or extending the attached patch.

Helmut
diff --minimal -Nru traverso-0.49.5/debian/changelog 
traverso-0.49.5/debian/changelog
--- traverso-0.49.5/debian/changelog    2018-05-18 17:49:06.000000000 +0200
+++ traverso-0.49.5/debian/changelog    2019-09-07 19:45:59.000000000 +0200
@@ -1,3 +1,11 @@
+traverso (0.49.5-3.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Don't let the build system detect optimization flags based on the current
+    cpu. (Closes: #-1)
+
+ -- Helmut Grohne <hel...@subdivi.de>  Sat, 07 Sep 2019 19:45:59 +0200
+
 traverso (0.49.5-3) unstable; urgency=medium
 
   * Team upload.
diff --minimal -Nru traverso-0.49.5/debian/rules traverso-0.49.5/debian/rules
--- traverso-0.49.5/debian/rules        2017-10-11 09:03:09.000000000 +0200
+++ traverso-0.49.5/debian/rules        2019-09-07 19:45:59.000000000 +0200
@@ -1,9 +1,13 @@
 #!/usr/bin/make -f
 
-DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
+include /usr/share/dpkg/architecture.mk
 ifneq ($(DEB_HOST_ARCH_OS),linux)
 cmake_extra_args += -DWANT_ALSA=OFF
 endif
+ifeq ($(DEB_HOST_ARCH_CPU),amd64)
+export DEB_CPPFLAGS_MAINT_APPEND=-DSSE_OPTIMIZATIONS -DUSE_X86_64_ASM
+export DEB_CXXFLAGS_MAINT_APPEND=-msse -mfpmath=sse
+endif
 
 export DEB_LDFLAGS_MAINT_APPEND=-Wl,--no-undefined -Wl,--as-needed
 export DEB_BUILD_MAINT_OPTIONS=hardening=+all
@@ -18,6 +22,7 @@
        dh_auto_configure -- \
        -DUSE_SYSTEM_SLV2_LIBRARY=ON \
        -DWANT_MP3_ENCODE=ON \
+       -DDETECT_HOST_CPU_FEATURES=OFF \
        $(cmake_extra_args)
 
 override_dh_install:

Reply via email to