telmich / gpm

general purpose mouse
http://www.nico.schottelius.org/software/gpm/
GNU General Public License v2.0
85 stars 28 forks source link

Fail to compile on GCC 7.2, glibc2.26 #21

Open ghost opened 7 years ago

ghost commented 7 years ago

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'

xtaran commented 7 years ago

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.

ghost commented 7 years ago

Working proposal: http://downloads.nutyx.org/x86_64/development/base/gpm/gpm-1.20.7-glibc-2.26-1.patch

renodr commented 7 years ago

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

ghost commented 7 years ago

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

Thanks for info, yes I did that, it works fine for me.

xtaran commented 7 years ago

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.)

ghost commented 7 years ago

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