telmich/gpm

Fail to compile on GCC 7.2, glibc2.26

Opened this issue · 6 comments

gcc -I. -I/tmp/work/src/gpm/src -DHAVE_CONFIG_H -include headers/config.h -Wall -DSYSCONFDIR=""/etc"" -DSBINDIR=""/usr/sbin"" -D_GNU_SOURCE -O2 -pipe -O2 -pipe -c -o prog/gpm-root.o prog/gpm-root.c
/tmp/work/src/gpm/src/prog/gpm-root.y: In function 'postmenu':
/tmp/work/src/gpm/src/prog/gpm-root.y:1030:32: warning: pointer targets in assignment differ in signedness [-Wpointer-sign]
#define PUTS(s,f,b) for(curr2=s;curr2;PUTC((curr2++),f,b))
^
/tmp/work/src/gpm/src/prog/gpm-root.y:1045:10: note: in expansion of macro 'PUTS'
PUTS(draw->title,draw->head,draw->back);
^~~~
/tmp/work/src/gpm/src/prog/gpm-root.y:1030:32: warning: pointer targets in assignment differ in signedness [-Wpointer-sign]
#define PUTS(s,f,b) for(curr2=s;curr2;PUTC((curr2++),f,b))
^
/tmp/work/src/gpm/src/prog/gpm-root.y:1053:10: note: in expansion of macro 'PUTS'
PUTS(item->name,draw->fore,draw->back); i+=strlen(item->name);
^~~~
/tmp/work/src/gpm/src/prog/gpm-root.y: In function 'main':
/tmp/work/src/gpm/src/prog/gpm-root.y:1200:4: warning: implicit declaration of function '__sigemptyset'; did you mean 'sigemptyset'? [-Wimplicit-function-declaration]
__sigemptyset(&childaction.sa_mask);
^~~~~~~~~~~~~
sigemptyset
gcc -L/tmp/work/src/gpm/src -lm -o prog/gpm-root prog/gpm-root.o lib/libgpm.so.2
prog/gpm-root.o: In function main': gpm-root.c:(.text.startup+0x1fe): undefined reference to __sigemptyset'

Doesn't fail to build with gcc 7.1.0 in Debian Unstable at least. But then again, Debian applies a bunch of patches and is not uptodate (has 1.20.4 packaged) as the package is currently orphaned.

I can confirm this issue under GCC-7.2.0 and glibc-2.26. Both of them have changes that cause the patch by @tnut to be needed. I can confirm this on LFS SVN-20170815-systemd, as this is our release candidate. Whether it was gcc-7.2.0 or glibc-2.26 that caused it to be required, I'm not sure, but what I do know is that modification is required.

@tnut http://wiki.linuxfromscratch.org/blfs/ticket/9616#ticket

Today, GCC 7.2.0 reached Debian Unstable and gpm still compiles fine on Debian Unstable, i.e. with all the patches shipped in Debian as mentioned before. But then again, Debian still has glibc 2.24. So I assume that either glibc 2.26 is the culprit or one of the patches in Debian fixed this issue preemptively.

(And JFTR as this also changed since my last comment on this ticket: I've adopted the Debian package of gpm together with Samuel Thibault and packaged 1.20.7.)

glibc is the issue, not gcc, look at my patch.