Re: Bug#765365: corosync: FTBFS on hurd-i386
On Wed, 2014-10-22 at 16:48 +0200, Guillem Jover wrote:
> Hi!
>
> On Tue, 2014-10-14 at 15:31:30 +0200, Svante Signell wrote:
> > Source: corosync
> > Version: 1.4.6-1.1
> > Severity: important
> > Tags: patch
> > User: debian-hurd@lists.debian.org
> > Usertags: hurd
>
> > Currently corosync FTBFS for GNU/Hurd due to missing OS support. The
> > attached patch adds support for GNU/Hurd by adding a COROSYNC_GNU entry
> > in configure.ac, add COROSYNC_GNU entries in exec/totemip.c and use
> > _POSIX_PIPE_BUF as a replacement to PIPE_BUF, since that constant is not
> > defined on Hurd.
>
> W/o having checked the actual source, with more context, it seems to
> me this is possibly problematic:
>
> > Index: corosync-1.4.6/configure.ac
> > ===================================================================
> > --- corosync-1.4.6.orig/configure.ac
> > +++ corosync-1.4.6/configure.ac
> > @@ -342,6 +342,17 @@ case "$host_os" in
> > DARWIN_OPTS=""
> > SOLARIS_OPTS=" "
> > ;;
> > + *gnu*)
gnu*) is sufficient here, since the check is on host_os!
> This catches any *gnu* system including linux-gnu, but I assume that
> was already matched upwards, as there's usage of COROSYNC_LINUX in the
> code below? Which means…
> > #if defined(COROSYNC_LINUX)
> > -#include <net/if.h>
This is a mistake: this header include should not be removed!
> … this change would break on COROSYNC_LINUX as there COROSYNC_GNU would
> not be defined? Did you try bulding this on GNU/Linux?
I've rebuilt now on both Linux and GNU. updated patch attached
Thanks!
Index: corosync-1.4.6/configure.ac
===================================================================
--- corosync-1.4.6.orig/configure.ac
+++ corosync-1.4.6/configure.ac
@@ -342,6 +342,17 @@ case "$host_os" in
DARWIN_OPTS=""
SOLARIS_OPTS=" "
;;
+ gnu*)
+ AC_DEFINE_UNQUOTED([COROSYNC_GNU], [1],
+ [Compiling for GNU/Hurd platform])
+ AC_DEFINE_UNQUOTED([PATH_MAX], [4096],
+ [Number of chars in a path name including nul])
+ OS_CFLAGS=""
+ OS_CPPFLAGS="-D_GNU_SOURCE"
+ OS_LDFLAGS=""
+ OS_DYFLAGS="-rdynamic"
+ DARWIN_OPTS=""
+ ;;
*)
AC_MSG_ERROR([Unsupported OS? hmmmm])
;;
Index: corosync-1.4.6/exec/totemip.c
===================================================================
--- corosync-1.4.6.orig/exec/totemip.c
+++ corosync-1.4.6/exec/totemip.c
@@ -70,6 +70,11 @@
#include <linux/rtnetlink.h>
#endif
+#if defined(COROSYNC_GNU)
+#include <net/if.h>
+#include <ifaddrs.h>
+#endif
+
#include <corosync/totem/totemip.h>
#include <corosync/swab.h>
@@ -425,7 +430,7 @@ int totemip_iface_check(struct totem_ip_
}
#endif
-#if defined(COROSYNC_BSD) || defined(COROSYNC_DARWIN)
+#if defined(COROSYNC_BSD) || defined(COROSYNC_DARWIN) || defined(COROSYNC_GNU)
int totemip_iface_check(struct totem_ip_address *bindnet,
struct totem_ip_address *boundto,
int *interface_up,
Index: corosync-1.4.6/services/cfg.c
===================================================================
--- corosync-1.4.6.orig/services/cfg.c
+++ corosync-1.4.6/services/cfg.c
@@ -1067,6 +1067,9 @@ exit_fn:
LEAVE();
}
+#ifndef PIPE_BUF
+#define PIPE_BUF _POSIX_PIPE_BUF
+#endif
static void message_handler_req_lib_cfg_get_node_addrs (void *conn,
const void *msg)
{
Reply to: