On Mon, Feb 01, 2016 at 08:20:38AM +0100, Tobias Frost wrote:
> Upstream patch here: 
> 
> https://github.com/dmtcp/dmtcp/commit/ed7843cd044b0b37d91beec6cbe63aacb
> 3f2d68c.patch

That is one patch, nowadays more is needed to have it compile.
I got it to compile, but the errors at compile time (?) and those scary
test failures make me quite uneasy.

You can find attached the patches I've made to make progress, but
probably the solution is to update to a new upstream, for starters.

(the git-format-patch'es are from a dgit clone)

-- 
regards,
                        Mattia Rizzolo

GPG Key: 66AE 2B4A FCCF 3F52 DA18  4D18 4B04 3FCD B944 4540      .''`.
more about me:  https://mapreri.org                             : :'  :
Launchpad user: https://launchpad.net/~mapreri                  `. `'`
Debian QA page: https://qa.debian.org/developer.php?login=mattia  `-
From 63d412f81f97e3753388ec8e4cbcad7465f75dd6 Mon Sep 17 00:00:00 2001
From: Mattia Rizzolo <mat...@debian.org>
Date: Thu, 9 Mar 2017 19:25:17 +0100
Subject: [PATCH 1/4] Add patch from upstream to fix FTBFS with newer glibc

Closes: #808644
Signed-off-by: Mattia Rizzolo <mat...@debian.org>
---
 debian/patches/fix-ftbfs-with-glibc-2.21.patch | 72 ++++++++++++++++++++++++++
 debian/patches/series                          |  1 +
 src/signalwrappers.cpp                         |  3 ++
 src/syscallsreal.c                             |  3 ++
 src/syscallwrappers.h                          |  2 +
 5 files changed, 81 insertions(+)
 create mode 100644 debian/patches/fix-ftbfs-with-glibc-2.21.patch

diff --git a/debian/patches/fix-ftbfs-with-glibc-2.21.patch b/debian/patches/fix-ftbfs-with-glibc-2.21.patch
new file mode 100644
index 0000000..ca74a05
--- /dev/null
+++ b/debian/patches/fix-ftbfs-with-glibc-2.21.patch
@@ -0,0 +1,72 @@
+Description: fix FTBFS with glibc 2.21
+Origin: upstream
+Bug-Debian: https://bugs.debian.org/808644
+
+---
+
+From ed7843cd044b0b37d91beec6cbe63aacb3f2d68c Mon Sep 17 00:00:00 2001
+From: Kapil Arya <ka...@ccs.neu.edu>
+Date: Tue, 24 Mar 2015 10:24:09 -0400
+Subject: [PATCH] Compilation fix for glibc 2.21.
+
+- sigvec has been removed from glibc 2.21.
+- Closes #39.
+---
+ src/signalwrappers.cpp | 3 +++
+ src/syscallsreal.c     | 3 +++
+ src/syscallwrappers.h  | 2 ++
+ 3 files changed, 8 insertions(+)
+
+diff --git a/src/signalwrappers.cpp b/src/signalwrappers.cpp
+index 3e9c7a5..0aff218 100644
+--- a/src/signalwrappers.cpp
++++ b/src/signalwrappers.cpp
+@@ -157,6 +157,8 @@ EXTERNC int rt_sigaction(int signum, const struct sigaction *act,
+   //}
+   //return _real_rt_sigaction( signum, act, oldact);
+ }
++
++#if !__GNUC_PREREQ(2,21)
+ EXTERNC int sigvec(int signum, const struct sigvec *vec, struct sigvec *ovec)
+ {
+   if(signum == bannedSignalNumber()) {
+@@ -164,6 +166,7 @@ EXTERNC int sigvec(int signum, const struct sigvec *vec, struct sigvec *ovec)
+   }
+   return _real_sigvec( signum, vec, ovec );
+ }
++#endif
+ 
+ //set the mask
+ EXTERNC int sigblock(int mask)
+diff --git a/src/syscallsreal.c b/src/syscallsreal.c
+index 6669321..8b88852 100644
+--- a/src/syscallsreal.c
++++ b/src/syscallsreal.c
+@@ -717,10 +717,13 @@ LIB_PRIVATE
+ int _real_sigaction(int signum, const struct sigaction *act, struct sigaction *oldact) {
+   REAL_FUNC_PASSTHROUGH (sigaction) (signum, act, oldact);
+ }
++
++#if !__GNUC_PREREQ(2,21)
+ LIB_PRIVATE
+ int _real_sigvec(int signum, const struct sigvec *vec, struct sigvec *ovec) {
+   REAL_FUNC_PASSTHROUGH (sigvec) (signum, vec, ovec);
+ }
++#endif
+ 
+ //set the mask
+ LIB_PRIVATE
+diff --git a/src/syscallwrappers.h b/src/syscallwrappers.h
+index 7573512..6f039cb 100644
+--- a/src/syscallwrappers.h
++++ b/src/syscallwrappers.h
+@@ -352,7 +352,9 @@ LIB_PRIVATE extern __thread int thread_performing_dlopen_dlsym;
+                       struct sigaction *oldact);
+   int _real_rt_sigaction(int signum, const struct sigaction *act,
+                          struct sigaction *oldact);
++#if !__GNUC_PREREQ(2,21)
+   int _real_sigvec(int sig, const struct sigvec *vec, struct sigvec *ovec);
++#endif
+ 
+   //set the mask
+   int _real_sigblock(int mask);
diff --git a/debian/patches/series b/debian/patches/series
index 55bec65..1940f16 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 arm-compilation-fix.patch
 increase-ckpt-timeout-for-autotest.patch
 added-pselect-wrapper-similar-to-poll-wrapper.patch
+fix-ftbfs-with-glibc-2.21.patch
diff --git a/src/signalwrappers.cpp b/src/signalwrappers.cpp
index 992f612..003244a 100644
--- a/src/signalwrappers.cpp
+++ b/src/signalwrappers.cpp
@@ -155,6 +155,8 @@ EXTERNC int rt_sigaction(int signum, const struct sigaction *act,
   //}
   //return _real_rt_sigaction( signum, act, oldact);
 }
+
+#if !__GNUC_PREREQ(2,21)
 EXTERNC int sigvec(int signum, const struct sigvec *vec, struct sigvec *ovec)
 {
   if(signum == bannedSignalNumber()) {
@@ -162,6 +164,7 @@ EXTERNC int sigvec(int signum, const struct sigvec *vec, struct sigvec *ovec)
   }
   return _real_sigvec( signum, vec, ovec );
 }
+#endif
 
 //set the mask
 EXTERNC int sigblock(int mask)
diff --git a/src/syscallsreal.c b/src/syscallsreal.c
index 725df64..c870533 100644
--- a/src/syscallsreal.c
+++ b/src/syscallsreal.c
@@ -687,10 +687,13 @@ LIB_PRIVATE
 int _real_sigaction(int signum, const struct sigaction *act, struct sigaction *oldact) {
   REAL_FUNC_PASSTHROUGH (sigaction) (signum, act, oldact);
 }
+
+#if !__GNUC_PREREQ(2,21)
 LIB_PRIVATE
 int _real_sigvec(int signum, const struct sigvec *vec, struct sigvec *ovec) {
   REAL_FUNC_PASSTHROUGH (sigvec) (signum, vec, ovec);
 }
+#endif
 
 //set the mask
 LIB_PRIVATE
diff --git a/src/syscallwrappers.h b/src/syscallwrappers.h
index 0fd87e0..4bc4978 100644
--- a/src/syscallwrappers.h
+++ b/src/syscallwrappers.h
@@ -365,7 +365,9 @@ LIB_PRIVATE extern __thread int thread_performing_dlopen_dlsym;
                       struct sigaction *oldact);
   int _real_rt_sigaction(int signum, const struct sigaction *act,
                          struct sigaction *oldact);
+#if !__GNUC_PREREQ(2,21)
   int _real_sigvec(int sig, const struct sigvec *vec, struct sigvec *ovec);
+#endif
 
   //set the mask
   int _real_sigblock(int mask);
-- 
2.11.0

From bf782c2cd195ce7904124b663b8b9f53be1f30ee Mon Sep 17 00:00:00 2001
From: Mattia Rizzolo <mat...@debian.org>
Date: Thu, 9 Mar 2017 19:45:36 +0100
Subject: [PATCH 2/4] Backport two patches from upstream to fix a build issue
 regarding eventfd

Signed-off-by: Mattia Rizzolo <mat...@debian.org>
---
 debian/patches/fix-build-eventfd.patch | 117 +++++++++++++++++++++++++++++++++
 debian/patches/series                  |   1 +
 include/dmtcp.h                        |   1 -
 src/plugin/ipc/event/eventwrappers.h   |  10 ++-
 src/syscallwrappers.h                  |  26 --------
 5 files changed, 127 insertions(+), 28 deletions(-)
 create mode 100644 debian/patches/fix-build-eventfd.patch

diff --git a/debian/patches/fix-build-eventfd.patch b/debian/patches/fix-build-eventfd.patch
new file mode 100644
index 0000000..8183981
--- /dev/null
+++ b/debian/patches/fix-build-eventfd.patch
@@ -0,0 +1,117 @@
+From c957a9f43efeafb195c42ce34af71af2cc36c648 Mon Sep 17 00:00:00 2001
+From: Kapil Arya <ka...@ccs.neu.edu>
+Date: Tue, 24 Mar 2015 10:18:50 -0400
+Subject: [PATCH] Fixed compilation problems for eventfd.
+
+---
+ include/dmtcp.h                      |  1 -
+ src/plugin/ipc/event/eventwrappers.h |  4 +++-
+ src/syscallwrappers.h                | 26 --------------------------
+ 3 files changed, 3 insertions(+), 28 deletions(-)
+
+diff --git a/include/dmtcp.h b/include/dmtcp.h
+index 255d683..2a164be 100644
+--- a/include/dmtcp.h
++++ b/include/dmtcp.h
+@@ -46,7 +46,6 @@
+ 
+ #define SYSCALL_ARG_RET_TYPE long int
+ #define POLL_TIMEOUT_TYPE int
+-#define EVENTFD_VAL_TYPE int
+ 
+ #define DELETED_FILE_SUFFIX " (deleted)"
+ #define LIB_PRIVATE __attribute__ ((visibility ("hidden")))
+diff --git a/src/plugin/ipc/event/eventwrappers.h b/src/plugin/ipc/event/eventwrappers.h
+index 6faaabb..4e84ccc 100644
+--- a/src/plugin/ipc/event/eventwrappers.h
++++ b/src/plugin/ipc/event/eventwrappers.h
+@@ -23,8 +23,10 @@
+ #ifndef EVENT_WRAPPERS_H
+ #define EVENT_WRAPPERS_H
+ 
++#define EVENTFD_VAL_TYPE unsigned int
++
++#include "config.h"
+ #include "dmtcp.h"
+-#include "eventconnection.h"
+ 
+ #define _real_poll NEXT_FNC(poll)
+ #define _real_pselect NEXT_FNC(pselect)
+diff --git a/src/syscallwrappers.h b/src/syscallwrappers.h
+index c685bc2..7573512 100644
+--- a/src/syscallwrappers.h
++++ b/src/syscallwrappers.h
+@@ -233,18 +233,6 @@ LIB_PRIVATE extern __thread int thread_performing_dlopen_dlsym;
+   MACRO(select)                             \
+   MACRO(poll)                               \
+                                             \
+-  MACRO(epoll_create)                       \
+-  MACRO(epoll_create1)                      \
+-  MACRO(epoll_ctl)                          \
+-  MACRO(epoll_wait)                         \
+-  MACRO(epoll_pwait)                        \
+-  MACRO(eventfd)                            \
+-  MACRO(signalfd)                           \
+-  MACRO(inotify_init)                       \
+-  MACRO(inotify_init1)                      \
+-  MACRO(inotify_add_watch)                  \
+-  MACRO(inotify_rm_watch)                   \
+-                                            \
+   MACRO(pthread_create)                     \
+   MACRO(pthread_exit)                       \
+   MACRO(pthread_tryjoin_np)                 \
+@@ -456,20 +444,6 @@ LIB_PRIVATE extern __thread int thread_performing_dlopen_dlsym;
+ 
+   int _real_poll(struct pollfd *fds, nfds_t nfds, POLL_TIMEOUT_TYPE timeout);
+ 
+-  int _real_epoll_create(int size);
+-  int _real_epoll_create1(int flags);
+-  int _real_epoll_ctl(int epfd, int op, int fd, struct epoll_event *event);
+-  int _real_epoll_wait(int epfd, struct epoll_event *events,
+-                       int maxevents, int timeout);
+-  int _real_epoll_pwait(int epfd, struct epoll_event *events,
+-                        int maxevents, int timeout, const sigset_t *sigmask);
+-  int _real_eventfd(EVENTFD_VAL_TYPE initval, int flags);
+-  int _real_signalfd (int fd, const sigset_t *mask, int flags);
+-  int _real_inotify_init(void);
+-  int _real_inotify_init1(int flags);
+-  int _real_inotify_add_watch(int fd, const char *pathname, uint32_t mask);
+-  int _real_inotify_rm_watch(int fd, int wd);
+-
+   int   _real_waitid(idtype_t idtype, id_t id, siginfo_t *infop, int options);
+   pid_t _real_wait4(pid_t pid, __WAIT_STATUS status, int options,
+                     struct rusage *rusage);
+
+---
+From c437645383b2e95ef0b687f99bc94d74c0b68826 Mon Sep 17 00:00:00 2001
+From: Kapil Arya <ka...@mesosphere.io>
+Date: Tue, 24 Mar 2015 18:08:51 -0400
+Subject: [PATCH] Fix for c957a9f4 (compilation fix for eventfd).
+
+---
+ src/plugin/ipc/event/eventwrappers.h | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/src/plugin/ipc/event/eventwrappers.h b/src/plugin/ipc/event/eventwrappers.h
+index 4e84ccc..0fbd3ad 100644
+--- a/src/plugin/ipc/event/eventwrappers.h
++++ b/src/plugin/ipc/event/eventwrappers.h
+@@ -23,11 +23,17 @@
+ #ifndef EVENT_WRAPPERS_H
+ #define EVENT_WRAPPERS_H
+ 
+-#define EVENTFD_VAL_TYPE unsigned int
++#include <features.h>
+ 
+ #include "config.h"
+ #include "dmtcp.h"
+ 
++#if __GLIBC_PREREQ(2,21)
++# define EVENTFD_VAL_TYPE unsigned int
++#else
++# define EVENTFD_VAL_TYPE int
++#endif
++
+ #define _real_poll NEXT_FNC(poll)
+ #define _real_pselect NEXT_FNC(pselect)
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 1940f16..be3f110 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@ arm-compilation-fix.patch
 increase-ckpt-timeout-for-autotest.patch
 added-pselect-wrapper-similar-to-poll-wrapper.patch
 fix-ftbfs-with-glibc-2.21.patch
+fix-build-eventfd.patch
diff --git a/include/dmtcp.h b/include/dmtcp.h
index f50a793..f48c11e 100644
--- a/include/dmtcp.h
+++ b/include/dmtcp.h
@@ -40,7 +40,6 @@
 
 #define SYSCALL_ARG_RET_TYPE long int
 #define POLL_TIMEOUT_TYPE int
-#define EVENTFD_VAL_TYPE int
 
 #define DELETED_FILE_SUFFIX " (deleted)"
 #define LIB_PRIVATE __attribute__ ((visibility ("hidden")))
diff --git a/src/plugin/ipc/event/eventwrappers.h b/src/plugin/ipc/event/eventwrappers.h
index 6faaabb..0fbd3ad 100644
--- a/src/plugin/ipc/event/eventwrappers.h
+++ b/src/plugin/ipc/event/eventwrappers.h
@@ -23,8 +23,16 @@
 #ifndef EVENT_WRAPPERS_H
 #define EVENT_WRAPPERS_H
 
+#include <features.h>
+
+#include "config.h"
 #include "dmtcp.h"
-#include "eventconnection.h"
+
+#if __GLIBC_PREREQ(2,21)
+# define EVENTFD_VAL_TYPE unsigned int
+#else
+# define EVENTFD_VAL_TYPE int
+#endif
 
 #define _real_poll NEXT_FNC(poll)
 #define _real_pselect NEXT_FNC(pselect)
diff --git a/src/syscallwrappers.h b/src/syscallwrappers.h
index 4bc4978..426c7da 100644
--- a/src/syscallwrappers.h
+++ b/src/syscallwrappers.h
@@ -234,18 +234,6 @@ LIB_PRIVATE extern __thread int thread_performing_dlopen_dlsym;
   MACRO(select)                             \
   MACRO(poll)                               \
                                             \
-  MACRO(epoll_create)                       \
-  MACRO(epoll_create1)                      \
-  MACRO(epoll_ctl)                          \
-  MACRO(epoll_wait)                         \
-  MACRO(epoll_pwait)                        \
-  MACRO(eventfd)                            \
-  MACRO(signalfd)                           \
-  MACRO(inotify_init)                       \
-  MACRO(inotify_init1)                      \
-  MACRO(inotify_add_watch)                  \
-  MACRO(inotify_rm_watch)                   \
-                                            \
   MACRO(pthread_create)                     \
   MACRO(pthread_exit)                       \
   MACRO(pthread_tryjoin_np)                 \
@@ -459,20 +447,6 @@ LIB_PRIVATE extern __thread int thread_performing_dlopen_dlsym;
 
   int _real_poll(struct pollfd *fds, nfds_t nfds, POLL_TIMEOUT_TYPE timeout);
 
-  int _real_epoll_create(int size);
-  int _real_epoll_create1(int flags);
-  int _real_epoll_ctl(int epfd, int op, int fd, struct epoll_event *event);
-  int _real_epoll_wait(int epfd, struct epoll_event *events,
-                       int maxevents, int timeout);
-  int _real_epoll_pwait(int epfd, struct epoll_event *events,
-                        int maxevents, int timeout, const sigset_t *sigmask);
-  int _real_eventfd(EVENTFD_VAL_TYPE initval, int flags);
-  int _real_signalfd (int fd, const sigset_t *mask, int flags);
-  int _real_inotify_init(void);
-  int _real_inotify_init1(int flags);
-  int _real_inotify_add_watch(int fd, const char *pathname, uint32_t mask);
-  int _real_inotify_rm_watch(int fd, int wd);
-
   int   _real_waitid(idtype_t idtype, id_t id, siginfo_t *infop, int options);
   pid_t _real_wait4(pid_t pid, __WAIT_STATUS status, int options,
                     struct rusage *rusage);
-- 
2.11.0

From d4da2d0fa0f46cce1049ee6590bbe63dd2ed33a3 Mon Sep 17 00:00:00 2001
From: Mattia Rizzolo <mat...@debian.org>
Date: Thu, 9 Mar 2017 19:35:13 +0100
Subject: [PATCH 3/4] Changelog for 2.3.1-6.1

Signed-off-by: Mattia Rizzolo <mat...@debian.org>
---
 debian/changelog | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 50b0841..7e552bf 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+dmtcp (2.3.1-6.1) unstable; urgency=medium
+
+  * Add patch from upstream to fix FTBFS with newer glibc.  Closes: #808644
+
+ -- Mattia Rizzolo <mat...@debian.org>  Thu, 09 Mar 2017 19:34:30 +0100
+
 dmtcp (2.3.1-6) unstable; urgency=medium
 
   * Provided a pselect wrapper to correctly resume after a checkpoint, which
-- 
2.11.0

From f59e86eb849b9da325ef6586d115ab412af6c3dd Mon Sep 17 00:00:00 2001
From: Mattia Rizzolo <mat...@debian.org>
Date: Thu, 9 Mar 2017 20:03:33 +0100
Subject: [PATCH 4/4] =?UTF-8?q?Add=20patch=20to=20fix=20another=20build=20?=
 =?UTF-8?q?failure=E2=80=A6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

manually massage the patch to apply to this older codebase

Signed-off-by: Mattia Rizzolo <mat...@debian.org>
---
 configure                                  | 31 ++++++++++
 configure.ac                               | 20 +++++++
 debian/patches/fix-build-WAIT_STATUS.patch | 96 ++++++++++++++++++++++++++++++
 debian/patches/series                      |  1 +
 include/config.h.in                        |  3 +
 5 files changed, 151 insertions(+)
 create mode 100644 debian/patches/fix-build-WAIT_STATUS.patch

diff --git a/configure b/configure
index 7f15fe2..82824bc 100755
--- a/configure
+++ b/configure
@@ -6985,6 +6985,37 @@ $as_echo "#define DMTCP 1" >>confdefs.h
 
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __WAIT_STATUS type" >&5
+$as_echo_n "checking for __WAIT_STATUS type... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+
+    #include <sys/wait.h>
+    #include <stdlib.h>
+    int main() {
+      __WAIT_STATUS status __attribute__((unused));
+      return 0;
+    }
+
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  wait_status='yes'
+else
+  wait_status='no'
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wait_status" >&5
+$as_echo "$wait_status" >&6; }
+
+if test "$wait_status" = "no"; then
+
+$as_echo "#define __WAIT_STATUS int *" >>confdefs.h
+
+fi
+
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
diff --git a/configure.ac b/configure.ac
index dc25e06..c57903f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -464,4 +464,24 @@ AC_CHECK_HEADERS_ONCE([sys/epoll.h sys/eventfd.h sys/signalfd.h sys/inotify.h])
 AC_DEFINE([DMTCP],[1],[Always enable this.])
 
 
+dnl Check whether __WAIT_STATUS is available.
+AC_MSG_CHECKING(for __WAIT_STATUS type)
+AC_LINK_IFELSE(
+[
+  AC_LANG_SOURCE([[
+    #include <sys/wait.h>
+    #include <stdlib.h>
+    int main() {
+      __WAIT_STATUS status __attribute__((unused));
+      return 0;
+    }
+  ]])
+], [wait_status='yes'], [wait_status='no'])
+AC_MSG_RESULT([$wait_status])
+
+if test "$wait_status" = "no"; then
+  AC_DEFINE([__WAIT_STATUS],[int *],
+            [can use __WAIT_STATUS as wait status type])
+fi
+
 AC_OUTPUT
diff --git a/debian/patches/fix-build-WAIT_STATUS.patch b/debian/patches/fix-build-WAIT_STATUS.patch
new file mode 100644
index 0000000..acfd9ec
--- /dev/null
+++ b/debian/patches/fix-build-WAIT_STATUS.patch
@@ -0,0 +1,96 @@
+From bdcac407226055d5d760f2f8d4469b2497e54069 Mon Sep 17 00:00:00 2001
+From: Kapil Arya <ka...@mesosphere.io>
+Date: Thu, 29 Sep 2016 16:48:13 -0400
+Subject: [PATCH] Fixed __WAIT_STATUS undeclared error.
+
+---
+ configure              | 35 +++++++++++++++++++++++++++++++++--
+ configure.ac           | 20 ++++++++++++++++++++
+ include/config.h.in    |  3 +++
+ plugin/Makefile.in     |  3 ++-
+ src/Makefile.in        |  3 ++-
+ src/plugin/Makefile.in |  3 ++-
+ 6 files changed, 62 insertions(+), 5 deletions(-)
+
+diff --git a/configure b/configure
+index fe220bf..5914d11 100755
+--- a/configure
++++ b/configure
+@@ -6985,6 +6985,37 @@
+ 
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __WAIT_STATUS type" >&5
++$as_echo_n "checking for __WAIT_STATUS type... " >&6; }
++cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h.  */
++
++
++    #include <sys/wait.h>
++    #include <stdlib.h>
++    int main() {
++      __WAIT_STATUS status __attribute__((unused));
++      return 0;
++    }
++
++
++_ACEOF
++if ac_fn_c_try_link "$LINENO"; then :
++  wait_status='yes'
++else
++  wait_status='no'
++fi
++rm -f core conftest.err conftest.$ac_objext \
++    conftest$ac_exeext conftest.$ac_ext
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wait_status" >&5
++$as_echo "$wait_status" >&6; }
++
++if test "$wait_status" = "no"; then
++
++$as_echo "#define __WAIT_STATUS int *" >>confdefs.h
++
++fi
++
+ cat >confcache <<\_ACEOF
+ # This file is a shell script that caches the results of configure
+ # tests run on this system so they can be shared between configure
+diff --git a/configure.ac b/configure.ac
+index 39f1a8d..56d78f2 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -464,4 +464,24 @@
+ AC_DEFINE([DMTCP],[1],[Always enable this.])
+ 
+ 
++dnl Check whether __WAIT_STATUS is available.
++AC_MSG_CHECKING(for __WAIT_STATUS type)
++AC_LINK_IFELSE(
++[
++  AC_LANG_SOURCE([[
++    #include <sys/wait.h>
++    #include <stdlib.h>
++    int main() {
++      __WAIT_STATUS status __attribute__((unused));
++      return 0;
++    }
++  ]])
++], [wait_status='yes'], [wait_status='no'])
++AC_MSG_RESULT([$wait_status])
++
++if test "$wait_status" = "no"; then
++  AC_DEFINE([__WAIT_STATUS],[int *],
++            [can use __WAIT_STATUS as wait status type])
++fi
++
+ AC_OUTPUT
+diff --git a/include/config.h.in b/include/config.h.in
+index ab3bc08..4163470 100644
+--- a/include/config.h.in
++++ b/include/config.h.in
+@@ -116,3 +116,6 @@
+ 
+ /* Version number of package */
+ #undef VERSION
++
++/* can use __WAIT_STATUS as wait status type */
++#undef __WAIT_STATUS
diff --git a/debian/patches/series b/debian/patches/series
index be3f110..8cc6ed1 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ increase-ckpt-timeout-for-autotest.patch
 added-pselect-wrapper-similar-to-poll-wrapper.patch
 fix-ftbfs-with-glibc-2.21.patch
 fix-build-eventfd.patch
+fix-build-WAIT_STATUS.patch
diff --git a/include/config.h.in b/include/config.h.in
index 2eadecd..cf3408e 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -107,3 +107,6 @@
 
 /* Version number of package */
 #undef VERSION
+
+/* can use __WAIT_STATUS as wait status type */
+#undef __WAIT_STATUS
-- 
2.11.0

diffstat for dmtcp-2.3.1 dmtcp-2.3.1

 changelog                               |    6 +
 patches/fix-build-WAIT_STATUS.patch     |   96 ++++++++++++++++++++++++++
 patches/fix-build-eventfd.patch         |  117 ++++++++++++++++++++++++++++++++
 patches/fix-ftbfs-with-glibc-2.21.patch |   72 +++++++++++++++++++
 patches/series                          |    3 
 5 files changed, 294 insertions(+)

diff -Nru dmtcp-2.3.1/debian/changelog dmtcp-2.3.1/debian/changelog
--- dmtcp-2.3.1/debian/changelog        2014-11-25 21:07:36.000000000 +0100
+++ dmtcp-2.3.1/debian/changelog        2017-03-09 19:34:30.000000000 +0100
@@ -1,3 +1,9 @@
+dmtcp (2.3.1-6.1) unstable; urgency=medium
+
+  * Add patch from upstream to fix FTBFS with newer glibc.  Closes: #808644
+
+ -- Mattia Rizzolo <mat...@debian.org>  Thu, 09 Mar 2017 19:34:30 +0100
+
 dmtcp (2.3.1-6) unstable; urgency=medium
 
   * Provided a pselect wrapper to correctly resume after a checkpoint, which
diff -Nru dmtcp-2.3.1/debian/patches/fix-build-eventfd.patch 
dmtcp-2.3.1/debian/patches/fix-build-eventfd.patch
--- dmtcp-2.3.1/debian/patches/fix-build-eventfd.patch  1970-01-01 
01:00:00.000000000 +0100
+++ dmtcp-2.3.1/debian/patches/fix-build-eventfd.patch  2017-03-09 
19:34:30.000000000 +0100
@@ -0,0 +1,117 @@
+From c957a9f43efeafb195c42ce34af71af2cc36c648 Mon Sep 17 00:00:00 2001
+From: Kapil Arya <ka...@ccs.neu.edu>
+Date: Tue, 24 Mar 2015 10:18:50 -0400
+Subject: [PATCH] Fixed compilation problems for eventfd.
+
+---
+ include/dmtcp.h                      |  1 -
+ src/plugin/ipc/event/eventwrappers.h |  4 +++-
+ src/syscallwrappers.h                | 26 --------------------------
+ 3 files changed, 3 insertions(+), 28 deletions(-)
+
+diff --git a/include/dmtcp.h b/include/dmtcp.h
+index 255d683..2a164be 100644
+--- a/include/dmtcp.h
++++ b/include/dmtcp.h
+@@ -46,7 +46,6 @@
+ 
+ #define SYSCALL_ARG_RET_TYPE long int
+ #define POLL_TIMEOUT_TYPE int
+-#define EVENTFD_VAL_TYPE int
+ 
+ #define DELETED_FILE_SUFFIX " (deleted)"
+ #define LIB_PRIVATE __attribute__ ((visibility ("hidden")))
+diff --git a/src/plugin/ipc/event/eventwrappers.h 
b/src/plugin/ipc/event/eventwrappers.h
+index 6faaabb..4e84ccc 100644
+--- a/src/plugin/ipc/event/eventwrappers.h
++++ b/src/plugin/ipc/event/eventwrappers.h
+@@ -23,8 +23,10 @@
+ #ifndef EVENT_WRAPPERS_H
+ #define EVENT_WRAPPERS_H
+ 
++#define EVENTFD_VAL_TYPE unsigned int
++
++#include "config.h"
+ #include "dmtcp.h"
+-#include "eventconnection.h"
+ 
+ #define _real_poll NEXT_FNC(poll)
+ #define _real_pselect NEXT_FNC(pselect)
+diff --git a/src/syscallwrappers.h b/src/syscallwrappers.h
+index c685bc2..7573512 100644
+--- a/src/syscallwrappers.h
++++ b/src/syscallwrappers.h
+@@ -233,18 +233,6 @@ LIB_PRIVATE extern __thread int 
thread_performing_dlopen_dlsym;
+   MACRO(select)                             \
+   MACRO(poll)                               \
+                                             \
+-  MACRO(epoll_create)                       \
+-  MACRO(epoll_create1)                      \
+-  MACRO(epoll_ctl)                          \
+-  MACRO(epoll_wait)                         \
+-  MACRO(epoll_pwait)                        \
+-  MACRO(eventfd)                            \
+-  MACRO(signalfd)                           \
+-  MACRO(inotify_init)                       \
+-  MACRO(inotify_init1)                      \
+-  MACRO(inotify_add_watch)                  \
+-  MACRO(inotify_rm_watch)                   \
+-                                            \
+   MACRO(pthread_create)                     \
+   MACRO(pthread_exit)                       \
+   MACRO(pthread_tryjoin_np)                 \
+@@ -456,20 +444,6 @@ LIB_PRIVATE extern __thread int 
thread_performing_dlopen_dlsym;
+ 
+   int _real_poll(struct pollfd *fds, nfds_t nfds, POLL_TIMEOUT_TYPE timeout);
+ 
+-  int _real_epoll_create(int size);
+-  int _real_epoll_create1(int flags);
+-  int _real_epoll_ctl(int epfd, int op, int fd, struct epoll_event *event);
+-  int _real_epoll_wait(int epfd, struct epoll_event *events,
+-                       int maxevents, int timeout);
+-  int _real_epoll_pwait(int epfd, struct epoll_event *events,
+-                        int maxevents, int timeout, const sigset_t *sigmask);
+-  int _real_eventfd(EVENTFD_VAL_TYPE initval, int flags);
+-  int _real_signalfd (int fd, const sigset_t *mask, int flags);
+-  int _real_inotify_init(void);
+-  int _real_inotify_init1(int flags);
+-  int _real_inotify_add_watch(int fd, const char *pathname, uint32_t mask);
+-  int _real_inotify_rm_watch(int fd, int wd);
+-
+   int   _real_waitid(idtype_t idtype, id_t id, siginfo_t *infop, int options);
+   pid_t _real_wait4(pid_t pid, __WAIT_STATUS status, int options,
+                     struct rusage *rusage);
+
+---
+From c437645383b2e95ef0b687f99bc94d74c0b68826 Mon Sep 17 00:00:00 2001
+From: Kapil Arya <ka...@mesosphere.io>
+Date: Tue, 24 Mar 2015 18:08:51 -0400
+Subject: [PATCH] Fix for c957a9f4 (compilation fix for eventfd).
+
+---
+ src/plugin/ipc/event/eventwrappers.h | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/src/plugin/ipc/event/eventwrappers.h 
b/src/plugin/ipc/event/eventwrappers.h
+index 4e84ccc..0fbd3ad 100644
+--- a/src/plugin/ipc/event/eventwrappers.h
++++ b/src/plugin/ipc/event/eventwrappers.h
+@@ -23,11 +23,17 @@
+ #ifndef EVENT_WRAPPERS_H
+ #define EVENT_WRAPPERS_H
+ 
+-#define EVENTFD_VAL_TYPE unsigned int
++#include <features.h>
+ 
+ #include "config.h"
+ #include "dmtcp.h"
+ 
++#if __GLIBC_PREREQ(2,21)
++# define EVENTFD_VAL_TYPE unsigned int
++#else
++# define EVENTFD_VAL_TYPE int
++#endif
++
+ #define _real_poll NEXT_FNC(poll)
+ #define _real_pselect NEXT_FNC(pselect)
+ 
diff -Nru dmtcp-2.3.1/debian/patches/fix-build-WAIT_STATUS.patch 
dmtcp-2.3.1/debian/patches/fix-build-WAIT_STATUS.patch
--- dmtcp-2.3.1/debian/patches/fix-build-WAIT_STATUS.patch      1970-01-01 
01:00:00.000000000 +0100
+++ dmtcp-2.3.1/debian/patches/fix-build-WAIT_STATUS.patch      2017-03-09 
19:34:30.000000000 +0100
@@ -0,0 +1,96 @@
+From bdcac407226055d5d760f2f8d4469b2497e54069 Mon Sep 17 00:00:00 2001
+From: Kapil Arya <ka...@mesosphere.io>
+Date: Thu, 29 Sep 2016 16:48:13 -0400
+Subject: [PATCH] Fixed __WAIT_STATUS undeclared error.
+
+---
+ configure              | 35 +++++++++++++++++++++++++++++++++--
+ configure.ac           | 20 ++++++++++++++++++++
+ include/config.h.in    |  3 +++
+ plugin/Makefile.in     |  3 ++-
+ src/Makefile.in        |  3 ++-
+ src/plugin/Makefile.in |  3 ++-
+ 6 files changed, 62 insertions(+), 5 deletions(-)
+
+diff --git a/configure b/configure
+index fe220bf..5914d11 100755
+--- a/configure
++++ b/configure
+@@ -6985,6 +6985,37 @@
+ 
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __WAIT_STATUS type" >&5
++$as_echo_n "checking for __WAIT_STATUS type... " >&6; }
++cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h.  */
++
++
++    #include <sys/wait.h>
++    #include <stdlib.h>
++    int main() {
++      __WAIT_STATUS status __attribute__((unused));
++      return 0;
++    }
++
++
++_ACEOF
++if ac_fn_c_try_link "$LINENO"; then :
++  wait_status='yes'
++else
++  wait_status='no'
++fi
++rm -f core conftest.err conftest.$ac_objext \
++    conftest$ac_exeext conftest.$ac_ext
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wait_status" >&5
++$as_echo "$wait_status" >&6; }
++
++if test "$wait_status" = "no"; then
++
++$as_echo "#define __WAIT_STATUS int *" >>confdefs.h
++
++fi
++
+ cat >confcache <<\_ACEOF
+ # This file is a shell script that caches the results of configure
+ # tests run on this system so they can be shared between configure
+diff --git a/configure.ac b/configure.ac
+index 39f1a8d..56d78f2 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -464,4 +464,24 @@
+ AC_DEFINE([DMTCP],[1],[Always enable this.])
+ 
+ 
++dnl Check whether __WAIT_STATUS is available.
++AC_MSG_CHECKING(for __WAIT_STATUS type)
++AC_LINK_IFELSE(
++[
++  AC_LANG_SOURCE([[
++    #include <sys/wait.h>
++    #include <stdlib.h>
++    int main() {
++      __WAIT_STATUS status __attribute__((unused));
++      return 0;
++    }
++  ]])
++], [wait_status='yes'], [wait_status='no'])
++AC_MSG_RESULT([$wait_status])
++
++if test "$wait_status" = "no"; then
++  AC_DEFINE([__WAIT_STATUS],[int *],
++            [can use __WAIT_STATUS as wait status type])
++fi
++
+ AC_OUTPUT
+diff --git a/include/config.h.in b/include/config.h.in
+index ab3bc08..4163470 100644
+--- a/include/config.h.in
++++ b/include/config.h.in
+@@ -116,3 +116,6 @@
+ 
+ /* Version number of package */
+ #undef VERSION
++
++/* can use __WAIT_STATUS as wait status type */
++#undef __WAIT_STATUS
diff -Nru dmtcp-2.3.1/debian/patches/fix-ftbfs-with-glibc-2.21.patch 
dmtcp-2.3.1/debian/patches/fix-ftbfs-with-glibc-2.21.patch
--- dmtcp-2.3.1/debian/patches/fix-ftbfs-with-glibc-2.21.patch  1970-01-01 
01:00:00.000000000 +0100
+++ dmtcp-2.3.1/debian/patches/fix-ftbfs-with-glibc-2.21.patch  2017-03-09 
19:24:13.000000000 +0100
@@ -0,0 +1,72 @@
+Description: fix FTBFS with glibc 2.21
+Origin: upstream
+Bug-Debian: https://bugs.debian.org/808644
+
+---
+
+From ed7843cd044b0b37d91beec6cbe63aacb3f2d68c Mon Sep 17 00:00:00 2001
+From: Kapil Arya <ka...@ccs.neu.edu>
+Date: Tue, 24 Mar 2015 10:24:09 -0400
+Subject: [PATCH] Compilation fix for glibc 2.21.
+
+- sigvec has been removed from glibc 2.21.
+- Closes #39.
+---
+ src/signalwrappers.cpp | 3 +++
+ src/syscallsreal.c     | 3 +++
+ src/syscallwrappers.h  | 2 ++
+ 3 files changed, 8 insertions(+)
+
+diff --git a/src/signalwrappers.cpp b/src/signalwrappers.cpp
+index 3e9c7a5..0aff218 100644
+--- a/src/signalwrappers.cpp
++++ b/src/signalwrappers.cpp
+@@ -157,6 +157,8 @@ EXTERNC int rt_sigaction(int signum, const struct 
sigaction *act,
+   //}
+   //return _real_rt_sigaction( signum, act, oldact);
+ }
++
++#if !__GNUC_PREREQ(2,21)
+ EXTERNC int sigvec(int signum, const struct sigvec *vec, struct sigvec *ovec)
+ {
+   if(signum == bannedSignalNumber()) {
+@@ -164,6 +166,7 @@ EXTERNC int sigvec(int signum, const struct sigvec *vec, 
struct sigvec *ovec)
+   }
+   return _real_sigvec( signum, vec, ovec );
+ }
++#endif
+ 
+ //set the mask
+ EXTERNC int sigblock(int mask)
+diff --git a/src/syscallsreal.c b/src/syscallsreal.c
+index 6669321..8b88852 100644
+--- a/src/syscallsreal.c
++++ b/src/syscallsreal.c
+@@ -717,10 +717,13 @@ LIB_PRIVATE
+ int _real_sigaction(int signum, const struct sigaction *act, struct sigaction 
*oldact) {
+   REAL_FUNC_PASSTHROUGH (sigaction) (signum, act, oldact);
+ }
++
++#if !__GNUC_PREREQ(2,21)
+ LIB_PRIVATE
+ int _real_sigvec(int signum, const struct sigvec *vec, struct sigvec *ovec) {
+   REAL_FUNC_PASSTHROUGH (sigvec) (signum, vec, ovec);
+ }
++#endif
+ 
+ //set the mask
+ LIB_PRIVATE
+diff --git a/src/syscallwrappers.h b/src/syscallwrappers.h
+index 7573512..6f039cb 100644
+--- a/src/syscallwrappers.h
++++ b/src/syscallwrappers.h
+@@ -352,7 +352,9 @@ LIB_PRIVATE extern __thread int 
thread_performing_dlopen_dlsym;
+                       struct sigaction *oldact);
+   int _real_rt_sigaction(int signum, const struct sigaction *act,
+                          struct sigaction *oldact);
++#if !__GNUC_PREREQ(2,21)
+   int _real_sigvec(int sig, const struct sigvec *vec, struct sigvec *ovec);
++#endif
+ 
+   //set the mask
+   int _real_sigblock(int mask);
diff -Nru dmtcp-2.3.1/debian/patches/series dmtcp-2.3.1/debian/patches/series
--- dmtcp-2.3.1/debian/patches/series   2014-11-25 01:36:17.000000000 +0100
+++ dmtcp-2.3.1/debian/patches/series   2017-03-09 19:34:30.000000000 +0100
@@ -1,3 +1,6 @@
 arm-compilation-fix.patch
 increase-ckpt-timeout-for-autotest.patch
 added-pselect-wrapper-similar-to-poll-wrapper.patch
+fix-ftbfs-with-glibc-2.21.patch
+fix-build-eventfd.patch
+fix-build-WAIT_STATUS.patch

Attachment: signature.asc
Description: PGP signature

Reply via email to