Source: heimdal
Version: 7.1.0+dfsg-3
Severity: important
Tags: patch
Justification: fails to build from source (but built successfully in the past)

Hi,

heimdal FTBFS due to testsuite failures which I traced back,
due to helpful error messages in the build log…

./libtommath/tommath.h:131:41: warning: left shift count >= width of type 
[-Wshift-count-overflow]
 #define MP_MASK          ((((mp_digit)1)<<((mp_digit)DIGIT_BIT))-((mp_digit)1))
                                         ^

… to libtommath (whose maintainers I Cc’d). I’ve prepared a
patch and uploaded the package to the debian-ports “unreleased”
repository in order to be able to dissolve the heimdal⇐⇒openldap
circular BD-Uninstallability, but would extremely appreciate if
you could merge the patch and do a regular maintainer upload soon.

As for libtommath… its build logs do not show this warning, but
that may be due to a difference in CFLAGS, and it does not have
such an extensive testsuite as heimdal, so it might also need to
have this patch applied (and forwarded upstream).

A better fix *might* be to fix MP_MASK to read something along
the lines of shifting 1ULL left, but the cast should already do
that, so I’m unsure why this doesn’t help. Do note that x32 is
an ILP32 architecture with 64-bit wide CPU registers (but 32-bit
pointers and longs), so 64-bit mode “should” work (and fast, at
that) but can be a bit tricky, and that the patch I attached is
positively known to fix several issues the heimdal testsuite shows.

Thanks!

-- System Information:
Debian Release: stretch/sid
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'buildd-unstable'), (500, 'unstable')
Architecture: x32 (x86_64)
Foreign Architectures: i386, amd64

Kernel: Linux 4.8.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/lksh
Init: sysvinit (via /sbin/init)
diff -Nru heimdal-7.1.0+dfsg/debian/changelog 
heimdal-7.1.0+dfsg/debian/changelog
--- heimdal-7.1.0+dfsg/debian/changelog 2016-12-29 16:37:37.000000000 +0100
+++ heimdal-7.1.0+dfsg/debian/changelog 2017-01-09 17:14:57.000000000 +0100
@@ -1,3 +1,10 @@
+heimdal (7.1.0+dfsg-3+x32.1) unreleased; urgency=medium
+
+  * Non-maintainer upload.
+  * fix_tommath_x32: Fix building on x32.
+
+ -- Thorsten Glaser <t...@mirbsd.de>  Mon, 09 Jan 2017 17:14:57 +0100
+
 heimdal (7.1.0+dfsg-3) unstable; urgency=medium
 
   * Fix building arch-only. Closes: #806045
diff -Nru heimdal-7.1.0+dfsg/debian/patches/fix_tommath_x32 
heimdal-7.1.0+dfsg/debian/patches/fix_tommath_x32
--- heimdal-7.1.0+dfsg/debian/patches/fix_tommath_x32   1970-01-01 
01:00:00.000000000 +0100
+++ heimdal-7.1.0+dfsg/debian/patches/fix_tommath_x32   2017-01-09 
17:14:43.000000000 +0100
@@ -0,0 +1,14 @@
+# DP: do not detect x32 as 64-bit platform
+# DP: fixes test failures due to ISO C Undefined Behaviour in MP_MASK macro
+
+--- a/lib/hcrypto/libtommath/tommath.h
++++ b/lib/hcrypto/libtommath/tommath.h
+@@ -46,7 +46,7 @@ extern "C" {
+ 
+ 
+ /* detect 64-bit mode if possible */
+-#if defined(__x86_64__)
++#if defined(__x86_64__) && !defined(__ILP32__)
+    #if !(defined(MP_64BIT) && defined(MP_16BIT) && defined(MP_8BIT))
+       #define MP_64BIT
+    #endif
diff -Nru heimdal-7.1.0+dfsg/debian/patches/series 
heimdal-7.1.0+dfsg/debian/patches/series
--- heimdal-7.1.0+dfsg/debian/patches/series    2016-12-27 18:10:01.000000000 
+0100
+++ heimdal-7.1.0+dfsg/debian/patches/series    2017-01-09 17:12:45.000000000 
+0100
@@ -13,3 +13,4 @@
 parallel-build
 check_iprop_races
 disable_iprop
+fix_tommath_x32

Reply via email to