GNU bug report logs - #29975
[core-updates] gnu: gpm: Fix building with glibc 2.26.

Previous Next

Package: guix-patches;

Reported by: Leo Famulari <leo <at> famulari.name>

Date: Thu, 4 Jan 2018 04:39:02 UTC

Severity: normal

Done: Leo Famulari <leo <at> famulari.name>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 29975 in the body.
You can then email your comments to 29975 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#29975; Package guix-patches. (Thu, 04 Jan 2018 04:39:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Leo Famulari <leo <at> famulari.name>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 04 Jan 2018 04:39:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: guix-patches <at> gnu.org
Subject: [core-updates] gnu: gpm: Fix building with glibc 2.26.
Date: Wed,  3 Jan 2018 23:38:08 -0500
* gnu/packages/patches/gpm-glibc-2.26.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/linux.scm (gpm)[source]: Use it.
---
 gnu/local.mk                              |  1 +
 gnu/packages/linux.scm                    |  1 +
 gnu/packages/patches/gpm-glibc-2.26.patch | 79 +++++++++++++++++++++++++++++++
 3 files changed, 81 insertions(+)
 create mode 100644 gnu/packages/patches/gpm-glibc-2.26.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 963c24d21..a10fa044f 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -707,6 +707,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/gobject-introspection-absolute-shlib-path.patch \
   %D%/packages/patches/gobject-introspection-cc.patch		\
   %D%/packages/patches/gobject-introspection-girepository.patch	\
+  %D%/packages/patches/gpm-glibc-2.26.patch			\
   %D%/packages/patches/graphite2-ffloat-store.patch		\
   %D%/packages/patches/grep-timing-sensitive-test.patch		\
   %D%/packages/patches/groff-source-date-epoch.patch		\
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index a268d951e..2eb5e1815 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -3045,6 +3045,7 @@ write access to exFAT devices.")
               (uri (string-append
                     "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
                     version ".tar.bz2"))
+              (patches (search-patches "gpm-glibc-2.26.patch"))
               (sha256
                (base32
                 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
diff --git a/gnu/packages/patches/gpm-glibc-2.26.patch b/gnu/packages/patches/gpm-glibc-2.26.patch
new file mode 100644
index 000000000..cc2766ce8
--- /dev/null
+++ b/gnu/packages/patches/gpm-glibc-2.26.patch
@@ -0,0 +1,79 @@
+Fix building of GPM with glibc 2.26:
+
+------
+daemon/open_console.o: In function `open_console':
+/tmp/guix-build-gpm-1.20.7.drv-0/gpm-1.20.7/src/daemon/open_console.c:45: undefined reference to `major'
+collect2: error: ld returned 1 exit status
+------
+
+https://github.com/telmich/gpm/issues/21
+
+Patch copied from Linux From Scratch:
+
+http://www.linuxfromscratch.org/patches/blfs/svn/gpm-1.20.7-glibc_2.26-1.patch
+
+Submitted by: Pierre Labastie <pierre dot labastie at neuf dot fr>
+Date: 2017-08-17
+Initial Package Version: 1.20.7
+Origin: Nutyx
+Upstream Status: There are PRs, but nothing committed yet
+Description: Fix build failures introduced by glibc-2.26
+
+diff -Naur gpm-1.20.7-orig/src/daemon/open_console.c gpm-1.20.7/src/daemon/open_console.c
+--- gpm-1.20.7-orig/src/daemon/open_console.c	2012-10-26 21:21:38.000000000 +0000
++++ gpm-1.20.7/src/daemon/open_console.c	2017-08-08 17:58:15.176232558 +0000
+@@ -23,6 +23,10 @@
+ #include <sys/stat.h>               /* stat()            */
+ #include <sys/ioctl.h>              /* ioctl             */
+ 
++#ifdef HAVE_SYS_SYSMACROS_H
++#include <sys/sysmacros.h>          /* major() w/newer glibc */
++#endif
++
+ /* Linux specific (to be outsourced in gpm2 */
+ #include <linux/serial.h>           /* for serial console check */
+ #include <asm/ioctls.h>            /* for serial console check */
+diff -Naur gpm-1.20.7-orig/src/prog/gpm-root.y gpm-1.20.7/src/prog/gpm-root.y
+--- gpm-1.20.7-orig/src/prog/gpm-root.y	2012-10-26 21:21:38.000000000 +0000
++++ gpm-1.20.7/src/prog/gpm-root.y	2017-08-08 18:00:36.442898559 +0000
+@@ -443,6 +443,7 @@
+ }
+ 
+ /*---------------------------------------------------------------------*/
++#if 0
+ static int f_debug_one(FILE *f, Draw *draw)
+ {
+    DrawItem *ip;
+@@ -465,6 +466,7 @@
+ #undef LINE
+    return 0;
+ }
++#endif
+ 
+ int f_debug(int mode, DrawItem *self, int uid)
+ {
+@@ -960,10 +962,8 @@
+ /*------------*/
+ static inline void scr_restore(int fd, FILE *f, unsigned char *buffer, int vc)
+ {
+-   int x,y, dumpfd;
++   int dumpfd;
+    char dumpname[20];
+-
+-   x=buffer[2]; y=buffer[3];
+    
+    /* WILL NOT WORK WITH DEVFS! FIXME! */
+    sprintf(dumpname,"/dev/vcsa%i",vc);
+@@ -1196,11 +1196,7 @@
+                                                         LOG_DAEMON : LOG_USER);
+    /* reap your zombies */
+    childaction.sa_handler=reap_children;
+-#if defined(__GLIBC__)
+-   __sigemptyset(&childaction.sa_mask);
+-#else /* __GLIBC__ */
+-   childaction.sa_mask=0;
+-#endif /* __GLIBC__ */
++   sigemptyset(&childaction.sa_mask);
+    childaction.sa_flags=SA_INTERRUPT; /* need to break the select() call */
+    sigaction(SIGCHLD,&childaction,NULL);
+ 
-- 
2.15.1





Information forwarded to guix-patches <at> gnu.org:
bug#29975; Package guix-patches. (Sat, 06 Jan 2018 22:02:01 GMT) Full text and rfc822 format available.

Message #8 received at 29975 <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <mbakke <at> fastmail.com>
To: Leo Famulari <leo <at> famulari.name>, 29975 <at> debbugs.gnu.org
Subject: Re: [bug#29975] [core-updates] gnu: gpm: Fix building with glibc 2.26.
Date: Sat, 06 Jan 2018 23:01:01 +0100
[Message part 1 (text/plain, inline)]
Leo Famulari <leo <at> famulari.name> writes:

> * gnu/packages/patches/gpm-glibc-2.26.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Add it.
> * gnu/packages/linux.scm (gpm)[source]: Use it.

[...]

> diff --git a/gnu/packages/patches/gpm-glibc-2.26.patch b/gnu/packages/patches/gpm-glibc-2.26.patch
> new file mode 100644
> index 000000000..cc2766ce8
> --- /dev/null
> +++ b/gnu/packages/patches/gpm-glibc-2.26.patch
> @@ -0,0 +1,79 @@
> +Fix building of GPM with glibc 2.26:
> +
> +------
> +daemon/open_console.o: In function `open_console':
> +/tmp/guix-build-gpm-1.20.7.drv-0/gpm-1.20.7/src/daemon/open_console.c:45: undefined reference to `major'
> +collect2: error: ld returned 1 exit status
> +------
> +
> +https://github.com/telmich/gpm/issues/21
> +
> +Patch copied from Linux From Scratch:
> +
> +http://www.linuxfromscratch.org/patches/blfs/svn/gpm-1.20.7-glibc_2.26-1.patch

No response from upstream in 6 months, yikes!

Gentoo only carries the sysmacros.h hunk, plus a one-liner:

https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-libs/gpm/files

...which seems less "brutal" than the LFS patch.  Can you try it?

I also noticed Arch does not have any patches on gpm, I wonder what they
do differently.

https://git.archlinux.org/svntogit/packages.git/tree/trunk?h=packages/gpm

> +
> +Submitted by: Pierre Labastie <pierre dot labastie at neuf dot fr>
> +Date: 2017-08-17
> +Initial Package Version: 1.20.7
> +Origin: Nutyx
> +Upstream Status: There are PRs, but nothing committed yet
> +Description: Fix build failures introduced by glibc-2.26
> +
> +diff -Naur gpm-1.20.7-orig/src/daemon/open_console.c gpm-1.20.7/src/daemon/open_console.c
> +--- gpm-1.20.7-orig/src/daemon/open_console.c	2012-10-26 21:21:38.000000000 +0000
> ++++ gpm-1.20.7/src/daemon/open_console.c	2017-08-08 17:58:15.176232558 +0000
> +@@ -23,6 +23,10 @@
> + #include <sys/stat.h>               /* stat()            */
> + #include <sys/ioctl.h>              /* ioctl             */
> + 
> ++#ifdef HAVE_SYS_SYSMACROS_H
> ++#include <sys/sysmacros.h>          /* major() w/newer glibc */
> ++#endif
> ++
> + /* Linux specific (to be outsourced in gpm2 */
> + #include <linux/serial.h>           /* for serial console check */
> + #include <asm/ioctls.h>            /* for serial console check */
> +diff -Naur gpm-1.20.7-orig/src/prog/gpm-root.y gpm-1.20.7/src/prog/gpm-root.y
> +--- gpm-1.20.7-orig/src/prog/gpm-root.y	2012-10-26 21:21:38.000000000 +0000
> ++++ gpm-1.20.7/src/prog/gpm-root.y	2017-08-08 18:00:36.442898559 +0000
> +@@ -443,6 +443,7 @@
> + }
> + 
> + /*---------------------------------------------------------------------*/
> ++#if 0
> + static int f_debug_one(FILE *f, Draw *draw)
> + {
> +    DrawItem *ip;
> +@@ -465,6 +466,7 @@
> + #undef LINE
> +    return 0;
> + }
> ++#endif
> + 
> + int f_debug(int mode, DrawItem *self, int uid)
> + {
> +@@ -960,10 +962,8 @@
> + /*------------*/
> + static inline void scr_restore(int fd, FILE *f, unsigned char *buffer, int vc)
> + {
> +-   int x,y, dumpfd;
> ++   int dumpfd;
> +    char dumpname[20];
> +-
> +-   x=buffer[2]; y=buffer[3];
> +    
> +    /* WILL NOT WORK WITH DEVFS! FIXME! */
> +    sprintf(dumpname,"/dev/vcsa%i",vc);
> +@@ -1196,11 +1196,7 @@
> +                                                         LOG_DAEMON : LOG_USER);
> +    /* reap your zombies */
> +    childaction.sa_handler=reap_children;
> +-#if defined(__GLIBC__)
> +-   __sigemptyset(&childaction.sa_mask);
> +-#else /* __GLIBC__ */
> +-   childaction.sa_mask=0;
> +-#endif /* __GLIBC__ */
> ++   sigemptyset(&childaction.sa_mask);
> +    childaction.sa_flags=SA_INTERRUPT; /* need to break the select() call */
> +    sigaction(SIGCHLD,&childaction,NULL);
> + 
> -- 
> 2.15.1
[signature.asc (application/pgp-signature, inline)]

Reply sent to Leo Famulari <leo <at> famulari.name>:
You have taken responsibility. (Wed, 10 Jan 2018 08:23:01 GMT) Full text and rfc822 format available.

Notification sent to Leo Famulari <leo <at> famulari.name>:
bug acknowledged by developer. (Wed, 10 Jan 2018 08:23:02 GMT) Full text and rfc822 format available.

Message #13 received at 29975-done <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: Marius Bakke <mbakke <at> fastmail.com>
Cc: 29975-done <at> debbugs.gnu.org
Subject: Re: [bug#29975] [core-updates] gnu: gpm: Fix building with glibc 2.26.
Date: Wed, 10 Jan 2018 00:21:32 -0800
[Message part 1 (text/plain, inline)]
On Sat, Jan 06, 2018 at 11:01:01PM +0100, Marius Bakke wrote:
> Gentoo only carries the sysmacros.h hunk, plus a one-liner:
> 
> https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-libs/gpm/files
> 
> ...which seems less "brutal" than the LFS patch.  Can you try it?

Thanks, I pushed as fddb22ac1954a49985b3c0dd5ef253b2c0d35b7c with these
patches instead.

> I also noticed Arch does not have any patches on gpm, I wonder what they
> do differently.
> 
> https://git.archlinux.org/svntogit/packages.git/tree/trunk?h=packages/gpm

Hm, good question!
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 07 Feb 2018 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 79 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.