Source: ck
Version: 0.7.1-2
Severity: serious
Tags: patch

- armv7 is the armhf baseline, using that in armel packages
  is therefore pointless
- building with "-msse -msse2" violates the i386 baseline

Changes in the attached patch:
- armel: use platform=unknown, not platform=armv7l
- patch to fix building with platform=unknown (applied upstream)
- patch to not pass "-msse -msse2" with --disable-sse (submitted upstream)
- x32: try to fix FTBFS with platform=unknown (untested)
- --disable-sse only on i386, not on amd64
diff -Nru ck-0.7.1/debian/patches/0001-configure-Fix-USE_CC_BUILTINS.patch 
ck-0.7.1/debian/patches/0001-configure-Fix-USE_CC_BUILTINS.patch
--- ck-0.7.1/debian/patches/0001-configure-Fix-USE_CC_BUILTINS.patch    
1970-01-01 02:00:00.000000000 +0200
+++ ck-0.7.1/debian/patches/0001-configure-Fix-USE_CC_BUILTINS.patch    
2021-08-15 19:54:47.000000000 +0300
@@ -0,0 +1,28 @@
+From ee103295110cc98b0eba76bbd2ed9ca453c6dd1c Mon Sep 17 00:00:00 2001
+From: Adrian Bunk <b...@debian.org>
+Date: Sun, 25 Jul 2021 17:01:19 +0300
+Subject: configure: Fix USE_CC_BUILTINS
+
+include/ck_pr.h uses CK_USE_CC_BUILTINS, not USE_CC_BUILTINS.
+---
+ configure | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure b/configure
+index 6210ad0..6a22dca 100755
+--- a/configure
++++ b/configure
+@@ -551,8 +551,8 @@ else
+ fi
+ 
+ if test "$USE_CC_BUILTINS"; then
+-      CFLAGS="$CFLAGS -DCK_CC_BUILTINS"
+-      PC_CFLAGS="-DCK_CC_BULITINS"
++      CFLAGS="$CFLAGS -DCK_USE_CC_BUILTINS=1"
++      PC_CFLAGS="-DCK_USE_CC_BUILTINS=1"
+ fi
+ 
+ # `which` on Solaris sucks
+-- 
+2.20.1
+
diff -Nru 
ck-0.7.1/debian/patches/0001-x86-Don-t-pass-msse-msse2-with-disable-sse.patch 
ck-0.7.1/debian/patches/0001-x86-Don-t-pass-msse-msse2-with-disable-sse.patch
--- 
ck-0.7.1/debian/patches/0001-x86-Don-t-pass-msse-msse2-with-disable-sse.patch   
    1970-01-01 02:00:00.000000000 +0200
+++ 
ck-0.7.1/debian/patches/0001-x86-Don-t-pass-msse-msse2-with-disable-sse.patch   
    2021-08-15 19:57:09.000000000 +0300
@@ -0,0 +1,35 @@
+From 64078b75986369ac9d448e9981bedec12815aab0 Mon Sep 17 00:00:00 2001
+From: Adrian Bunk <b...@debian.org>
+Date: Wed, 25 Aug 2021 17:24:07 +0300
+Subject: x86: Don't pass -msse -msse2 with --disable-sse
+
+---
+ build/ck.build.x86 | 2 +-
+ configure          | 3 +++
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/build/ck.build.x86 b/build/ck.build.x86
+index 6e12783..4d07fa4 100644
+--- a/build/ck.build.x86
++++ b/build/ck.build.x86
+@@ -1,2 +1,2 @@
+-CFLAGS+=-m32 -D__x86__ -msse -msse2
++CFLAGS+=-m32 -D__x86__
+ LDFLAGS+=-m32
+diff --git a/configure b/configure
+index 6a22dca..742adfe 100755
+--- a/configure
++++ b/configure
+@@ -424,6 +424,9 @@ case $PLATFORM in
+               LDFLAGS="-m64 $LDFLAGS"
+               ;;
+       i386|i486|i586|i686|i586_i686|pentium*|athlon*|k5|k6|k6_2|k6_3)
++              if test "${SSE_DISABLE}" = "CK_MD_SSE_ENABLE"; then
++                      CFLAGS="$CFLAGS -msse -msse2"
++              fi
+               LSE_ENABLE="CK_MD_LSE_DISABLE"
+               MM="${MM:-"CK_MD_TSO"}"
+               case $SYSTEM in
+-- 
+2.20.1
+
diff -Nru ck-0.7.1/debian/patches/series ck-0.7.1/debian/patches/series
--- ck-0.7.1/debian/patches/series      1970-01-01 02:00:00.000000000 +0200
+++ ck-0.7.1/debian/patches/series      2021-08-15 19:57:09.000000000 +0300
@@ -0,0 +1,2 @@
+0001-configure-Fix-USE_CC_BUILTINS.patch
+0001-x86-Don-t-pass-msse-msse2-with-disable-sse.patch
diff -Nru ck-0.7.1/debian/rules ck-0.7.1/debian/rules
--- ck-0.7.1/debian/rules       2021-07-24 07:12:49.000000000 +0300
+++ ck-0.7.1/debian/rules       2021-08-15 19:57:09.000000000 +0300
@@ -2,8 +2,12 @@
 
 include /usr/share/dpkg/architecture.mk
 
-ifeq ($(DEB_BUILD_ARCH),armel)
-       PLATFORM = --platform=armv7l
+ifneq (,$(filter $(DEB_HOST_ARCH), armel x32))
+       PLATFORM = --platform=unknown
+endif
+
+ifeq ($(DEB_HOST_ARCH), i386)
+       PLATFORM = --disable-sse
 endif
 
 %:
@@ -16,7 +20,7 @@
                --includedir=/usr/include \
                --mandir=/usr/share/man \
                --cores=2 \
-               --disable-sse $(PLATFORM)
+               $(PLATFORM)
 
 override_dh_auto_test:
        $(MAKE) -j1 check

Reply via email to