Source: dante
Version: 1.4.1+dfsg-2
Severity: important
Tags: patch

Hello,

dante currently FTBFS on !linux i386, i.e. hurd-i386 and kfreebsd-i386
because of sa_len detection:

configure:16138: checking for sa_len in sockaddr
configure:16156: gcc -c  -O2 -fdebug-prefix-map=/tmp/dante-1.4.1+dfsg=. 
-specs=/usr/share/dpkg/pie-compile.specs -fstack-protector-strong -Wformat 
-Werror=format-security -ggdb -pipe -Wdate-time -D_FORTIFY_SOURCE=2 
-D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_DEFAULT_SOURCE 
-DDEBUG=0 -D_FORTIFY_SOURCE=2 conftest.c >&5
configure:16156: $? = 0
configure:16161: result: yes
configure:16170: checking for sa_len type
configure:16194: gcc -c  -O2 -fdebug-prefix-map=/tmp/dante-1.4.1+dfsg=. 
-specs=/usr/share/dpkg/pie-compile.specs -fstack-protector-strong -Wformat 
-Werror=format-security -ggdb -pipe -Wall -Werror -Wdate-time 
-D_FORTIFY_SOURCE=2 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE 
-D_DEFAULT_SOURCE -DDEBUG=0 -D_FORTIFY_SOURCE=2 conftest.c >&5
conftest.c: In function 'main':
conftest.c:104:1: error: unknown type name 'uint8_t'
 uint8_t *sa_len_ptr;
 ^~~~~~~

I guess this tries to see whether sa_len uses uint8_t, thus assuming
that stdint gets pulled in. Ok, why not. Now, the test which should have
succeeded:



configure:16194: gcc -c  -O2 -fdebug-prefix-map=/tmp/dante-1.4.1+dfsg=. 
-specs=/usr/share/dpkg/pie-compile.specs -fstack-protector-strong -Wformat 
-Werror=format-security -ggdb -pipe -Wall -Werror -Wdate-time 
-D_FORTIFY_SOURCE=2 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE 
-D_DEFAULT_SOURCE -DDEBUG=0 -D_FORTIFY_SOURCE=2 conftest.c >&5
conftest.c: In function 'main':
conftest.c:106:6: error: cast from pointer to integer of different size 
[-Werror=pointer-to-int-cast]
 if (((unsigned long long)sa_len_ptr) % 2 != 0)
      ^
cc1: all warnings being treated as errors


The combination of -Werror and casting a pointer to unsigned long long
produces an error on a 32bit machine. The attached patch fixes this.

Samuel

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable-debug'), (500, 
'testing-debug'), (500, 'buildd-unstable'), (500, 'unstable'), (500, 'stable'), 
(500, 'oldstable'), (1, 'experimental-debug'), (1, 'buildd-experimental'), (1, 
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.8.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

-- 
Samuel
Hi ! I'm a .signature virus ! Copy me into your ~/.signature, please !
--- osdep.m4.original   2016-11-23 02:07:12.000000000 +0000
+++ osdep.m4    2016-11-23 02:08:19.000000000 +0000
@@ -398,11 +398,14 @@
    for type in uint8_t "unsigned char"; do
        AC_TRY_COMPILE([
 #include <sys/types.h>
-#include <sys/socket.h>], [
+#include <sys/socket.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif], [
 struct sockaddr sa;
 $type *sa_len_ptr;
 sa_len_ptr = &sa.sa_len;
-if (((unsigned long long)sa_len_ptr) % 2 != 0)
+if (((uintptr_t)sa_len_ptr) % 2 != 0)
   return 0;],
        [AC_DEFINE_UNQUOTED(sa_len_type, [$type], [sa_len type])
         sa_len_type_found=t

Reply via email to