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 <curses.h>
>>
>> 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

Reply via email to