Package: tsdecrypt
Severity: serious
Tags: patch
Version: 8.0-1

tsdecrypt's build system appears to assume that the package is being built with the intention of running it on the same machine it is being built on. As such it uses -march=native and depending on detection code sets several other flags.

This is not appropriate for debian. Packages built on debian should run on the minimum hardware chosen by the port maintainers regardless of the hardware in the machine used to build them. In general the porters descisions will be reflected in the defaults that are hardcoded into the compiler, Therefore compiler flags that affect the CPU requirements should generally only be used to build secondary versions of code for use in conjunction with runtime CPU detection. -march=native should never be used as it leads to build results that depend on what hardware happens to be in the build system.

It appears that this impacts all versions from 8.0-1 to 10.0-1

The attatched debdiff should fix this. I also included a fix for incomplete cleanup in the clean target which I noticed while working on the fix.

No intent to NMU.
diff -Nru tsdecrypt-10.0/debian/changelog tsdecrypt-10.0/debian/changelog
--- tsdecrypt-10.0/debian/changelog     2013-10-03 14:55:24.000000000 +0000
+++ tsdecrypt-10.0/debian/changelog     2013-11-24 19:46:41.000000000 +0000
@@ -1,3 +1,10 @@
+tsdecrypt (10.0-1+rpi1) jessie-staging; urgency=low
+
+  * Remove inappropriate compiler flags.
+  * fix clean target
+
+ -- Peter Michael Green <plugw...@raspbian.org>  Sun, 24 Nov 2013 19:39:56 
+0000
+
 tsdecrypt (10.0-1) unstable; urgency=low
 
   * New upstream release:
diff -Nru tsdecrypt-10.0/debian/patches/avoid-inappropriate-compiler-flags 
tsdecrypt-10.0/debian/patches/avoid-inappropriate-compiler-flags
--- tsdecrypt-10.0/debian/patches/avoid-inappropriate-compiler-flags    
1970-01-01 00:00:00.000000000 +0000
+++ tsdecrypt-10.0/debian/patches/avoid-inappropriate-compiler-flags    
2013-11-24 19:39:19.000000000 +0000
@@ -0,0 +1,52 @@
+Description: Avoid inappropriate compiler flags
+  The tsdecrypt build system tries to be too clever and assumes that the system
+  it is built on will be the system it is going to run on. This is 
inappropriate
+  for Debian so we need to disable some of this logic.
+Author: Peter Michael Green <plugw...@debian.org>
+
+--- tsdecrypt-10.0.orig/FFdecsa_init
++++ tsdecrypt-10.0/FFdecsa_init
+@@ -106,26 +106,26 @@ test_ffdecsa_mode() {
+ }
+ 
+ # Check CPU and compiler flags
+-if cc_check -march=native
+-then
+-      FFDECSA_CFLAGS="$FFDECSA_CFLAGS -march=native"
+-elif cc_check -march=pentium; then
+-      FFDECSA_CFLAGS="$FFDECSA_CFLAGS -march=pentium"
+-fi
++#if cc_check -march=native
++#then
++#     FFDECSA_CFLAGS="$FFDECSA_CFLAGS -march=native"
++#elif cc_check -march=pentium; then
++#     FFDECSA_CFLAGS="$FFDECSA_CFLAGS -march=pentium"
++#fi
+ 
+ OPTS=""
+ FLAGS=""
+-for flag in mmx sse sse2
+-do
+-      if cpu_have $flag
+-      then
+-              OPTS="$OPTS $flag"
+-              if cc_check -m$flag
+-              then
+-                      FFDECSA_CFLAGS="$FFDECSA_CFLAGS -m$flag"
+-              fi
+-      fi
+-done
++#for flag in mmx sse sse2
++#do
++#     if cpu_have $flag
++#     then
++#             OPTS="$OPTS $flag"
++#             if cc_check -m$flag
++#             then
++#                     FFDECSA_CFLAGS="$FFDECSA_CFLAGS -m$flag"
++#             fi
++#     fi
++#done
+ 
+ log "Host CPU" "$(uname -m) $OPTS"
+ log "FFdecsa CFLAGS" "$FFDECSA_CFLAGS"
diff -Nru tsdecrypt-10.0/debian/patches/series 
tsdecrypt-10.0/debian/patches/series
--- tsdecrypt-10.0/debian/patches/series        1970-01-01 00:00:00.000000000 
+0000
+++ tsdecrypt-10.0/debian/patches/series        2013-11-24 19:37:03.000000000 
+0000
@@ -0,0 +1 @@
+avoid-inappropriate-compiler-flags
diff -Nru tsdecrypt-10.0/debian/rules tsdecrypt-10.0/debian/rules
--- tsdecrypt-10.0/debian/rules 2013-10-03 14:55:12.000000000 +0000
+++ tsdecrypt-10.0/debian/rules 2013-11-24 19:46:24.000000000 +0000
@@ -20,3 +20,7 @@
        mkdir -p $(DESTDIR)$(PREFIX)/bin
        install tsdecrypt_ffdecsa tsdecrypt_dvbcsa \
                $(DESTDIR)$(PREFIX)/bin
+
+override_dh_auto_clean:
+       dh_auto_clean
+       rm -f FFdecsa_build_PARALLEL_*.log
\ No newline at end of file
_______________________________________________
pkg-multimedia-maintainers mailing list
pkg-multimedia-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-multimedia-maintainers

Reply via email to