Bug#945943: exim4: FTBFS on hurd-i386: "operating system GNU is not supported"

2019-12-04 Thread Andreas Metzler
On 2019-12-04 Samuel Thibault  wrote:
> Control: tags -1 + patch fixed-upstream

> Hello,

> Here are the patches which were applied upstream.

Thank you!



Bug#945943: exim4: FTBFS on hurd-i386: "operating system GNU is not supported"

2019-12-04 Thread Samuel Thibault
Control: tags -1 + patch fixed-upstream

Hello,

Here are the patches which were applied upstream.

Samuel
commit b30930a554edd087932dbff2d4d32f340de28ed1
Author: Heiko Schlittermann (HS12-RIPE) 
Date:   Tue Dec 3 07:23:25 2019 +0100

Build: Enable *GNU (Hurd) Bug 2476

diff --git a/src/OS/Makefile-Base b/src/OS/Makefile-Base
index f8c6ebb53..9ecde1d3e 100644
--- a/src/OS/Makefile-Base
+++ b/src/OS/Makefile-Base
@@ -97,6 +97,7 @@ Makefile: ../OS/Makefile-Base ../OS/Makefile-Default \
 
 os.h:  $(SCRIPTS)/Configure-os.h \
$(O)/os.h-FreeBSD   \
+   $(O)/os.h-GNU   \
$(O)/os.h-Linux \
$(O)/os.h-OpenBSD   \
$(O)/os.h-SunOS5
@@ -113,6 +114,7 @@ os.h:   $(SCRIPTS)/Configure-os.h \
 
 os.c:   ../src/os.c \
$(SCRIPTS)/Configure-os.c \
+   $(O)/os.c-GNU   \
$(O)/os.c-Linux
$(SHELL) $(SCRIPTS)/Configure-os.c
 
diff --git a/src/OS/Makefile-GNU b/src/OS/Makefile-GNU
new file mode 100644
index 0..e46434187
--- /dev/null
+++ b/src/OS/Makefile-GNU
@@ -0,0 +1,29 @@
+# Exim: OS-specific make file for GNU and variants.
+
+HAVE_ICONV=yes
+
+BASENAME_COMMAND=look_for_it
+CHOWN_COMMAND=look_for_it
+CHGRP_COMMAND=look_for_it
+CHMOD_COMMAND=look_for_it
+
+CFLAGS ?= -O -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
+
+DBMLIB = -ldb
+USE_DB = yes
+
+LIBS = -lnsl -lcrypt -lm
+LIBRESOLV = -lresolv
+
+X11=/usr/X11R6
+XINCLUDE=-I$(X11)/include
+XLFLAGS=-L$(X11)/lib
+X11_LD_LIB=$(X11)/lib
+
+EXIWHAT_PS_ARG=ax
+EXIWHAT_EGREP_ARG='/exim( |$$)'
+EXIWHAT_MULTIKILL_CMD=killall
+EXIWHAT_MULTIKILL_ARG=exim
+EXIWHAT_KILL_SIGNAL=-USR1
+
+# End
diff --git a/src/OS/os.c-GNU b/src/OS/os.c-GNU
new file mode 100644
index 0..e5d6ff66c
--- /dev/null
+++ b/src/OS/os.c-GNU
@@ -0,0 +1,55 @@
+/*
+* Exim - an Internet mail transport agent*
+*/
+
+/* See the file NOTICE for conditions of use and distribution. */
+
+/* GNU-specific code. This is concatenated onto the generic src/os.c file.
+GNU/Hurd has approximately the same way to determine the load average as NeXT,
+so a variant of this could also be in the generic os.c file. See the GNU EMacs
+getloadavg.c file, from which this snippet was derived. getloadavg.c from Emacs
+is copyrighted by the FSF under the terms of the GPLv2 or any later version.
+Changes are hereby placed under the same license, as requested by the GPL. */
+
+#ifndef OS_LOAD_AVERAGE
+#define OS_LOAD_AVERAGE
+
+#include 
+
+static processor_set_t default_set;
+static int getloadavg_initialized;
+
+int
+os_getloadavg (void)
+{
+host_t host;
+struct processor_set_basic_info info;
+unsigned info_count;
+
+if (!getloadavg_initialized)
+  {
+  if (processor_set_default (mach_host_self(), &default_set) == KERN_SUCCESS)
+getloadavg_initialized = 1;
+  }
+
+if (getloadavg_initialized)
+  {
+  info_count = PROCESSOR_SET_BASIC_INFO_COUNT;
+  if (processor_set_info(default_set, PROCESSOR_SET_BASIC_INFO, &host,
+   (processor_set_info_t)&info, &info_count) != KERN_SUCCESS)
+getloadavg_initialized = 0;
+  else
+{
+#if LOAD_SCALE == 1000
+return info.load_average;
+#else
+return (int) (((double) info.load_average * 1000) / LOAD_SCALE));
+#endif
+}
+  }
+
+return -1;
+}
+#endif  /* OS_LOAD_AVERAGE */
+
+/* End of os.c-GNU */
diff --git a/src/OS/os.h-GNU b/src/OS/os.h-GNU
new file mode 100644
index 0..44993163d
--- /dev/null
+++ b/src/OS/os.h-GNU
@@ -0,0 +1,23 @@
+/* Exim: OS-specific C header file for GNU/Hurd */
+
+#define CRYPT_H
+#define GLIBC_IP_OPTIONS
+#define HAVE_BSD_GETLOADAVG
+#define HAVE_MMAP
+#define HAVE_SYS_VFS_H
+#define NO_IP_VAR_H
+#define SIG_IGN_WORKS
+#define SIOCGIFCONF_GIVES_ADDR
+
+#define F_FREESP O_TRUNC
+typedef struct flock flock_t;
+
+#define os_strsignal strsignal
+#define OS_STRSIGNAL
+
+/* Hurd-specific bits below */
+
+/* default is non-const */
+#define ICONV_ARG2_TYPE const char **
+
+/* End */
diff --git a/src/OS/unsupported/Makefile-GNU b/src/OS/unsupported/Makefile-GNU
deleted file mode 100644
index e46434187..0
--- a/src/OS/unsupported/Makefile-GNU
+++ /dev/null
@@ -1,29 +0,0 @@
-# Exim: OS-specific make file for GNU and variants.
-
-HAVE_ICONV=yes
-
-BASENAME_COMMAND=look_for_it
-CHOWN_COMMAND=look_for_it
-CHGRP_COMMAND=look_for_it
-CHMOD_COMMAND=look_for_it
-
-CFLAGS ?= -O -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-
-DBMLIB = -ldb
-USE_DB = yes
-
-LIBS = -lnsl -lcrypt -lm
-LIBRESOLV = -lresolv
-
-X11=/usr/X11R6
-XINCLUDE=-I$(X11)/include
-XLFLAGS=-L$(X11)/lib
-X11_LD_LIB=$(X11)/lib
-
-EXIWHAT_PS_ARG=ax
-EXIWHAT_EGREP_ARG='/exim( |$$)'
-EXIWHAT_MULTIKILL_CMD=killall
-EXIWHAT_MULTIKILL_ARG=exim
-EXIWHAT_KILL_SIGNAL=-USR1
-
-# End
diff --git a/src/OS/unsupported/os.c-GNU b/src/OS/unsupported/os.c-GNU
deleted file mode 100644
index e5d6ff66c..0
--- a/src/OS/unsupported/os.c-GNU
+++ /dev/null
@@ -1,55 +0,0 @@
-/

Bug#945943: exim4: FTBFS on hurd-i386: "operating system GNU is not supported"

2019-12-01 Thread Samuel Thibault
Control: forwarded -1 https://bugs.exim.org/show_bug.cgi?id=2476

I have forwarded the request to upstream.

Samuel



Bug#945943: exim4: FTBFS on hurd-i386: "operating system GNU is not supported"

2019-12-01 Thread Samuel Thibault
Samuel Thibault, le lun. 02 déc. 2019 01:36:32 +0100, a ecrit:
> The attached patch is also required, otherwise exim4 will consider using
> fastopen, but not actually do it, thus completely failing to connect.
> I'll submit upstream once I get my account there confirmed.

This is now on 

https://bugs.exim.org/show_bug.cgi?id=2475

Samuel



Bug#945943: exim4: FTBFS on hurd-i386: "operating system GNU is not supported"

2019-12-01 Thread Samuel Thibault
Hello,

Paul Sonnenschein, le dim. 01 déc. 2019 13:56:26 +0100, a ecrit:
> > *** Sorry - operating system GNU is not supported
> > *** See OS/Makefile-* for supported systems
> 
> See [1] for the complete build log.
> 
> It however builds successfully if the files OS/unsupported/*-GNU are
> moved into the directory OS/.
> 
> Could you take a look?

The attached patch is also required, otherwise exim4 will consider using
fastopen, but not actually do it, thus completely failing to connect.
I'll submit upstream once I get my account there confirmed.

Samuel
Index: exim4-4.93~RC5/src/ip.c
===
--- exim4-4.93~RC5.orig/src/ip.c
+++ exim4-4.93~RC5/src/ip.c
@@ -292,8 +292,7 @@ if (fastopen_blob && f.tcp_fastopen_ok)
   debug_printf("Tried TCP Fast Open but apparently not enabled by 
sysctl\n");
 goto legacy_connect;
 }
-# endif
-# ifdef EXIM_TFO_CONNECTX
+# elif defined(EXIM_TFO_CONNECTX)
   /* MacOS */
   sa_endpoints_t ends = {
 .sae_srcif = 0, .sae_srcaddr = NULL, .sae_srcaddrlen = 0,
@@ -326,12 +325,14 @@ if (fastopen_blob && f.tcp_fastopen_ok)
 else   /* assume that no data was queued; block in send */
   rc = send(sock, fastopen_blob->data, fastopen_blob->len, 0);
 }
+# else
+goto legacy_connect;
 # endif
   }
 else
 #endif /*TCP_FASTOPEN*/
   {
-#if defined(TCP_FASTOPEN) && defined(MSG_FASTOPEN)
+#if defined(TCP_FASTOPEN) && (defined(MSG_FASTOPEN) || 
!defined(EXIM_TFO_CONNECTX))
 legacy_connect:
 #endif
 


Bug#945943: exim4: FTBFS on hurd-i386: "operating system GNU is not supported"

2019-12-01 Thread Andreas Metzler
On 2019-12-01 Paul Sonnenschein  wrote:
> Source: exim4
> Severity: important
> Version: 4.93~RC5-1
> User: debian-h...@lists.debian.org
> Usertags: hurd
> X-Debbugs-CC: debian-h...@lists.debian.org

> Hello,

> exim4 fails to build from source on hurd-i386 with the message:

> > *** Sorry - operating system GNU is not supported
> > *** See OS/Makefile-* for supported systems

> See [1] for the complete build log.

> It however builds successfully if the files OS/unsupported/*-GNU are
> moved into the directory OS/.

> Could you take a look?

Hello,

Exim upstream has dropped these intentionally in 4.90:
JH/22 Retire historical build files to an "unsupported" subdir.  These are
  defined as "ones for which we have no current evidence of testing".

If you want to revive exim4 on Hurd please test and open a upstream report
about this with your findings.

TIA, cu Andreas
-- 
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'



Bug#945943: exim4: FTBFS on hurd-i386: "operating system GNU is not supported"

2019-12-01 Thread Paul Sonnenschein
Source: exim4
Severity: important
Version: 4.93~RC5-1
User: debian-h...@lists.debian.org
Usertags: hurd
X-Debbugs-CC: debian-h...@lists.debian.org

Hello,

exim4 fails to build from source on hurd-i386 with the message:

> *** Sorry - operating system GNU is not supported
> *** See OS/Makefile-* for supported systems

See [1] for the complete build log.

It however builds successfully if the files OS/unsupported/*-GNU are
moved into the directory OS/.

Could you take a look?

Thanks.

[1]: 
https://buildd.debian.org/status/fetch.php?pkg=exim4&arch=hurd-i386&ver=4.93%7ERC5-1&stamp=1574915162&raw=0