Bug#900839: libncurses-dev: static linking requires -lgpm
On Mon, Jun 18, 2018 at 08:04:36PM +0200, Sven Joachim wrote: > On 2018-06-06 18:09 -0400, Thomas Dickey wrote: > > > On Wed, Jun 06, 2018 at 11:08:18PM +0200, Sven Joachim wrote: > >> On 2018-06-06 16:09 -0400, Thomas Dickey wrote: > >> > >> > On Wed, Jun 06, 2018 at 07:39:42PM +0200, Sven Joachim wrote: > >> >> On 2018-06-05 21:43 +0200, Sven Joachim wrote: > >> > ... > >> >> >> | > >> >> >> /usr/lib/gcc/i686-linux-gnu/7/../../../i386-linux-gnu/libncurses.a(lib_mouse.o): > >> >> >> In function `mouse_activate': > >> >> >> | (.text+0x1032): undefined reference to `gpm_fd' > >> >> >> | collect2: error: ld returned 1 exit status > > > > hmm - my recollection of this was that I'd gotten it to fail silently > > when dlsym is used. > > > >> > Given the report, I'd expect something amiss in the configure script > >> > to handle the case where I'd like libdl to load gpm (but don't know > >> > why that would be related to wattr macros...) > >> > >> Actually the static libraries in the Debian package are configured > >> --without-dlsym because of #556378[1]. > > > > Perhaps we could revisit that -- I'll investigate anyway. I'd forgotten about the warning at that moment... > The change in the 20180609 patchlevel > > , > | + modify generatesd ncurses*config and ncurses.pc, ncursesw.pc, etc., > | to list helper libraries such as gpm for static linking > ` > > looks correct to me (apart from the small typo: s/generatesd/generated). :-( > Nevertheless, if I stop building the static libraries separately, > there is this infamous complaint about dlopen() when I link a program > statically: yes - even if I could make effective use of dlvsym, I wouldn't do that because of this warning nuisance... > , > | …/libncurses.a(lib_mouse.o): In function `load_gpm_library': > | …/lib_mouse.c:488: warning: Using 'dlopen' in statically linked > applications requires at runtime the shared libraries from the glibc version > used for linking > ` > > I don't see a completely satisfactory way out of that, maybe the least of > the evils is to configure the static libraries --without-gpm. odds are that people who really want to link statically will be attempting to use it on the Linux console, and will complain :-) -- Thomas E. Dickey https://invisible-island.net ftp://ftp.invisible-island.net signature.asc Description: Digital signature
Bug#900839: libncurses-dev: static linking requires -lgpm
On 2018-06-06 18:09 -0400, Thomas Dickey wrote: > On Wed, Jun 06, 2018 at 11:08:18PM +0200, Sven Joachim wrote: >> On 2018-06-06 16:09 -0400, Thomas Dickey wrote: >> >> > On Wed, Jun 06, 2018 at 07:39:42PM +0200, Sven Joachim wrote: >> >> On 2018-06-05 21:43 +0200, Sven Joachim wrote: >> > ... >> >> >> | >> >> >> /usr/lib/gcc/i686-linux-gnu/7/../../../i386-linux-gnu/libncurses.a(lib_mouse.o): >> >> >> In function `mouse_activate': >> >> >> | (.text+0x1032): undefined reference to `gpm_fd' >> >> >> | collect2: error: ld returned 1 exit status > > hmm - my recollection of this was that I'd gotten it to fail silently > when dlsym is used. > >> > Given the report, I'd expect something amiss in the configure script >> > to handle the case where I'd like libdl to load gpm (but don't know >> > why that would be related to wattr macros...) >> >> Actually the static libraries in the Debian package are configured >> --without-dlsym because of #556378[1]. > > Perhaps we could revisit that -- I'll investigate anyway. The change in the 20180609 patchlevel , | + modify generatesd ncurses*config and ncurses.pc, ncursesw.pc, etc., | to list helper libraries such as gpm for static linking ` looks correct to me (apart from the small typo: s/generatesd/generated). Nevertheless, if I stop building the static libraries separately, there is this infamous complaint about dlopen() when I link a program statically: , | …/libncurses.a(lib_mouse.o): In function `load_gpm_library': | …/lib_mouse.c:488: warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking ` I don't see a completely satisfactory way out of that, maybe the least of the evils is to configure the static libraries --without-gpm. Cheers, Sven
Bug#900839: libncurses-dev: static linking requires -lgpm
On Wed, Jun 06, 2018 at 11:08:18PM +0200, Sven Joachim wrote: > On 2018-06-06 16:09 -0400, Thomas Dickey wrote: > > > On Wed, Jun 06, 2018 at 07:39:42PM +0200, Sven Joachim wrote: > >> On 2018-06-05 21:43 +0200, Sven Joachim wrote: > > ... > >> >> | > >> >> /usr/lib/gcc/i686-linux-gnu/7/../../../i386-linux-gnu/libncurses.a(lib_mouse.o): > >> >> In function `mouse_activate': > >> >> | (.text+0x1032): undefined reference to `gpm_fd' > >> >> | collect2: error: ld returned 1 exit status hmm - my recollection of this was that I'd gotten it to fail silently when dlsym is used. > > Given the report, I'd expect something amiss in the configure script > > to handle the case where I'd like libdl to load gpm (but don't know > > why that would be related to wattr macros...) > > Actually the static libraries in the Debian package are configured > --without-dlsym because of #556378[1]. Perhaps we could revisit that -- I'll investigate anyway. -- Thomas E. Dickey https://invisible-island.net ftp://ftp.invisible-island.net signature.asc Description: Digital signature
Bug#900839: libncurses-dev: static linking requires -lgpm
On 2018-06-06 16:09 -0400, Thomas Dickey wrote: > On Wed, Jun 06, 2018 at 07:39:42PM +0200, Sven Joachim wrote: >> On 2018-06-05 21:43 +0200, Sven Joachim wrote: > ... >> >> | >> >> /usr/lib/gcc/i686-linux-gnu/7/../../../i386-linux-gnu/libncurses.a(lib_mouse.o): >> >> In function `mouse_activate': >> >> | (.text+0x1032): undefined reference to `gpm_fd' >> >> | collect2: error: ld returned 1 exit status >> >> ` >> >> >> >> Adding -lgpm works around that, but neither the pkgconfig files nor >> >> ncurses6-config make any mention of -lgpm in the configuration we use >> >> for the static libraries, so I guess it is not intended to be necessary. >> >> >> >> In stretch linking the above program without -lgpm works, not sure when >> >> exactly that broke. >> > >> > Further investigation revealed that it worked in libncurses5-dev >> > versions up to 6.1-1, but broke with the switch to ABI 6 in >> > 6.1+20180210-1. >> >> More precisely, it happens since we configure the libraries with >> --disable-wattr-macros[1]. If I remove that option or configure the >> static libraries with --enable-wattr-macros, the problem disappears. >> Still have not figured out why that is the case, though. > > nor I, offhand (I'll have to set up a configuration to see the issue). > > Given the report, I'd expect something amiss in the configure script > to handle the case where I'd like libdl to load gpm (but don't know > why that would be related to wattr macros...) Actually the static libraries in the Debian package are configured --without-dlsym because of #556378[1]. Cheers, Sven 1. https://bugs.debian.org/556378
Bug#900839: libncurses-dev: static linking requires -lgpm
On Wed, Jun 06, 2018 at 07:39:42PM +0200, Sven Joachim wrote: > On 2018-06-05 21:43 +0200, Sven Joachim wrote: ... > >> | > >> /usr/lib/gcc/i686-linux-gnu/7/../../../i386-linux-gnu/libncurses.a(lib_mouse.o): > >> In function `mouse_activate': > >> | (.text+0x1032): undefined reference to `gpm_fd' > >> | collect2: error: ld returned 1 exit status > >> ` > >> > >> Adding -lgpm works around that, but neither the pkgconfig files nor > >> ncurses6-config make any mention of -lgpm in the configuration we use > >> for the static libraries, so I guess it is not intended to be necessary. > >> > >> In stretch linking the above program without -lgpm works, not sure when > >> exactly that broke. > > > > Further investigation revealed that it worked in libncurses5-dev > > versions up to 6.1-1, but broke with the switch to ABI 6 in > > 6.1+20180210-1. > > More precisely, it happens since we configure the libraries with > --disable-wattr-macros[1]. If I remove that option or configure the > static libraries with --enable-wattr-macros, the problem disappears. > Still have not figured out why that is the case, though. nor I, offhand (I'll have to set up a configuration to see the issue). Given the report, I'd expect something amiss in the configure script to handle the case where I'd like libdl to load gpm (but don't know why that would be related to wattr macros...) -- Thomas E. Dickey https://invisible-island.net ftp://ftp.invisible-island.net signature.asc Description: Digital signature
Bug#900839: libncurses-dev: static linking requires -lgpm
On 2018-06-05 21:43 +0200, Sven Joachim wrote: > On 2018-06-05 21:01 +0200, Sven Joachim wrote: > >> Package: libncurses-dev >> Version: 6.1+20180210-4 >> Severity: normal >> >> Linking a program as trivial as the following statically fails: >> >> #include >> >> int main(void) >> { >> initscr(); >> endwin(); >> return 0; >> } >> >> >> , >> | $ LANG=C gcc curses_min.c -static $(pkg-config --static --libs ncurses) >> | >> /usr/lib/gcc/i686-linux-gnu/7/../../../i386-linux-gnu/libncurses.a(lib_mouse.o): >> In function `_nc_mouse_event': >> | (.text+0x5be): undefined reference to `Gpm_GetEvent' >> | >> /usr/lib/gcc/i686-linux-gnu/7/../../../i386-linux-gnu/libncurses.a(lib_mouse.o): >> In function `enable_gpm_mouse': >> | (.text+0xc51): undefined reference to `Gpm_Close' >> | (.text+0xc89): undefined reference to `Gpm_Open' >> | (.text+0xc9d): undefined reference to `Gpm_Close' >> | >> /usr/lib/gcc/i686-linux-gnu/7/../../../i386-linux-gnu/libncurses.a(lib_mouse.o): >> In function `_nc_mouse_init': >> | (.text+0xe13): undefined reference to `gpm_fd' >> | >> /usr/lib/gcc/i686-linux-gnu/7/../../../i386-linux-gnu/libncurses.a(lib_mouse.o): >> In function `mouse_activate': >> | (.text+0x1032): undefined reference to `gpm_fd' >> | collect2: error: ld returned 1 exit status >> ` >> >> Adding -lgpm works around that, but neither the pkgconfig files nor >> ncurses6-config make any mention of -lgpm in the configuration we use >> for the static libraries, so I guess it is not intended to be necessary. >> >> In stretch linking the above program without -lgpm works, not sure when >> exactly that broke. > > Further investigation revealed that it worked in libncurses5-dev > versions up to 6.1-1, but broke with the switch to ABI 6 in > 6.1+20180210-1. More precisely, it happens since we configure the libraries with --disable-wattr-macros[1]. If I remove that option or configure the static libraries with --enable-wattr-macros, the problem disappears. Still have not figured out why that is the case, though. Cheers, Sven 1. https://salsa.debian.org/debian/ncurses/commit/76462eb5146c1143d5c19f3cfff0f8cfe2391bdc
Bug#900839: libncurses-dev: static linking requires -lgpm
On 2018-06-05 21:01 +0200, Sven Joachim wrote: > Package: libncurses-dev > Version: 6.1+20180210-4 > Severity: normal > > Linking a program as trivial as the following statically fails: > > #include > > int main(void) > { > initscr(); > endwin(); > return 0; > } > > > , > | $ LANG=C gcc curses_min.c -static $(pkg-config --static --libs ncurses) > | > /usr/lib/gcc/i686-linux-gnu/7/../../../i386-linux-gnu/libncurses.a(lib_mouse.o): > In function `_nc_mouse_event': > | (.text+0x5be): undefined reference to `Gpm_GetEvent' > | > /usr/lib/gcc/i686-linux-gnu/7/../../../i386-linux-gnu/libncurses.a(lib_mouse.o): > In function `enable_gpm_mouse': > | (.text+0xc51): undefined reference to `Gpm_Close' > | (.text+0xc89): undefined reference to `Gpm_Open' > | (.text+0xc9d): undefined reference to `Gpm_Close' > | > /usr/lib/gcc/i686-linux-gnu/7/../../../i386-linux-gnu/libncurses.a(lib_mouse.o): > In function `_nc_mouse_init': > | (.text+0xe13): undefined reference to `gpm_fd' > | > /usr/lib/gcc/i686-linux-gnu/7/../../../i386-linux-gnu/libncurses.a(lib_mouse.o): > In function `mouse_activate': > | (.text+0x1032): undefined reference to `gpm_fd' > | collect2: error: ld returned 1 exit status > ` > > Adding -lgpm works around that, but neither the pkgconfig files nor > ncurses6-config make any mention of -lgpm in the configuration we use > for the static libraries, so I guess it is not intended to be necessary. > > In stretch linking the above program without -lgpm works, not sure when > exactly that broke. Further investigation revealed that it worked in libncurses5-dev versions up to 6.1-1, but broke with the switch to ABI 6 in 6.1+20180210-1. Cheers, Sven
Bug#900839: libncurses-dev: static linking requires -lgpm
Package: libncurses-dev Version: 6.1+20180210-4 Severity: normal Linking a program as trivial as the following statically fails: #include int main(void) { initscr(); endwin(); return 0; } , | $ LANG=C gcc curses_min.c -static $(pkg-config --static --libs ncurses) | /usr/lib/gcc/i686-linux-gnu/7/../../../i386-linux-gnu/libncurses.a(lib_mouse.o): In function `_nc_mouse_event': | (.text+0x5be): undefined reference to `Gpm_GetEvent' | /usr/lib/gcc/i686-linux-gnu/7/../../../i386-linux-gnu/libncurses.a(lib_mouse.o): In function `enable_gpm_mouse': | (.text+0xc51): undefined reference to `Gpm_Close' | (.text+0xc89): undefined reference to `Gpm_Open' | (.text+0xc9d): undefined reference to `Gpm_Close' | /usr/lib/gcc/i686-linux-gnu/7/../../../i386-linux-gnu/libncurses.a(lib_mouse.o): In function `_nc_mouse_init': | (.text+0xe13): undefined reference to `gpm_fd' | /usr/lib/gcc/i686-linux-gnu/7/../../../i386-linux-gnu/libncurses.a(lib_mouse.o): In function `mouse_activate': | (.text+0x1032): undefined reference to `gpm_fd' | collect2: error: ld returned 1 exit status ` Adding -lgpm works around that, but neither the pkgconfig files nor ncurses6-config make any mention of -lgpm in the configuration we use for the static libraries, so I guess it is not intended to be necessary. In stretch linking the above program without -lgpm works, not sure when exactly that broke. -- System Information: Debian Release: buster/sid APT prefers unstable APT policy: (500, 'unstable'), (101, 'experimental') Architecture: i386 (x86_64) Foreign Architectures: amd64 Kernel: Linux 4.17.0-nouveau (SMP w/2 CPU cores) Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE=de_DE.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) Versions of packages libncurses-dev depends on: ii libc6-dev [libc-dev] 2.27-3 ii libncurses6 6.1+20180210-4 ii libncursesw6 6.1+20180210-4 ii libtinfo6 6.1+20180210-4 ii ncurses-bin 6.1+20180210-4 libncurses-dev recommends no packages. Versions of packages libncurses-dev suggests: ii ncurses-doc 6.1+20180210-4 -- no debconf information