Subject: libncurses5-dev: static linking with -lncurses is broken
Date: Sat, 08 Oct 2011 16:14:43 +0200
Package: libncurses5-dev
Version: 5.9-2
Severity: serious
X-Debbugs-CC: Matthias Klose <[email protected]>
Static linking with -lncurses fails if you need symbols from libtinfo:
,----
| $ cat foo.c
| #include <term.h>
| #include <stdlib.h>
|
| int main(void)
| {
| return tgetent(NULL, "");
| }
| $ LANG=C gcc foo.c -lncurses -static
| /tmp/ccRe0RW2.o: In function `main':
| foo.c:(.text+0x19): undefined reference to `tgetent'
| collect2: ld returned 1 exit status
`----
This makes zsh and possibly a few other packages FTBFS.
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable'), (101, 'experimental')
Architecture: i386 (x86_64)
Kernel: Linux 3.1.0-rc9-nouveau (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages libncurses5-dev depends on:
ii libc6-dev [libc-dev] 2.13-21
ii libncurses5 5.9-2
ii libtinfo-dev 5.9-2
ii ncurses-bin 5.9-2
libncurses5-dev recommends no packages.
Versions of packages libncurses5-dev suggests:
ii ncurses-doc 5.9-2
-- no debconf information
Subject: Re: Bug#644728: libncurses5-dev: static linking with -lncurses is broken
Date: Sat, 08 Oct 2011 19:12:00 +0200
On 2011-10-08 16:14 +0200, Sven Joachim wrote:
> Package: libncurses5-dev
> Version: 5.9-2
> Severity: serious
> X-Debbugs-CC: Matthias Klose <[email protected]>
>
> Static linking with -lncurses fails if you need symbols from libtinfo:
>
> ,----
> | $ cat foo.c
> | #include <term.h>
> | #include <stdlib.h>
> |
> | int main(void)
> | {
> | return tgetent(NULL, "");
> | }
> | $ LANG=C gcc foo.c -lncurses -static
> | /tmp/ccRe0RW2.o: In function `main':
> | foo.c:(.text+0x19): undefined reference to `tgetent'
> | collect2: ld returned 1 exit status
> `----
>
> This makes zsh and possibly a few other packages FTBFS.
So maybe we need to "append" each libtinfo.a to libncurses{,w}.a, like
this:
ar xo libtinfo.a && ar sr libncurses.a *.o && rm -f *.o
Any less ugly ideas?
Cheers,
Sven
Acknowledgement sent
to Thomas Dickey <[email protected]>:
Extra info received and forwarded to list. Copy sent to Craig Small <[email protected]>.
(Sat, 08 Oct 2011 18:03:03 GMT) (full text, mbox, link).
Subject: Re: Bug#644728: libncurses5-dev: static linking with -lncurses is
broken
Date: Sat, 8 Oct 2011 13:56:29 -0400 (EDT)
On Sat, 8 Oct 2011, Sven Joachim wrote:
> On 2011-10-08 16:14 +0200, Sven Joachim wrote:
>
>> Package: libncurses5-dev
>> Version: 5.9-2
>> Severity: serious
>> X-Debbugs-CC: Matthias Klose <[email protected]>
>>
>> Static linking with -lncurses fails if you need symbols from libtinfo:
>>
>> ,----
>> | $ cat foo.c
>> | #include <term.h>
>> | #include <stdlib.h>
>> |
>> | int main(void)
>> | {
>> | return tgetent(NULL, "");
>> | }
>> | $ LANG=C gcc foo.c -lncurses -static
>> | /tmp/ccRe0RW2.o: In function `main':
>> | foo.c:(.text+0x19): undefined reference to `tgetent'
>> | collect2: ld returned 1 exit status
>> `----
>>
>> This makes zsh and possibly a few other packages FTBFS.
>
> So maybe we need to "append" each libtinfo.a to libncurses{,w}.a, like
> this:
>
> ar xo libtinfo.a && ar sr libncurses.a *.o && rm -f *.o
>
> Any less ugly ideas?
If zsh used pkg-config, it could use today's update (ncurses patch)
pkg-config --static --libs ncurses
That's one path forward...
But most of your FTBFS's will be only looking for "-lncurses", not
supposing that tgetent would be in another library.
--
Thomas E. Dickey
http://invisible-island.netftp://invisible-island.net
Acknowledgement sent
to Matthias Klose <[email protected]>:
Extra info received and forwarded to list. Copy sent to Craig Small <[email protected]>.
(Sun, 09 Oct 2011 08:27:11 GMT) (full text, mbox, link).
Subject: Re: Bug#644728: libncurses5-dev: static linking with -lncurses is
broken
Date: Sun, 09 Oct 2011 10:23:36 +0200
On 10/08/2011 07:56 PM, Thomas Dickey wrote:
> On Sat, 8 Oct 2011, Sven Joachim wrote:
>
>> On 2011-10-08 16:14 +0200, Sven Joachim wrote:
>>
>>> Package: libncurses5-dev
>>> Version: 5.9-2
>>> Severity: serious
>>> X-Debbugs-CC: Matthias Klose <[email protected]>
>>>
>>> Static linking with -lncurses fails if you need symbols from libtinfo:
>>>
>>> ,----
>>> | $ cat foo.c
>>> | #include <term.h>
>>> | #include <stdlib.h>
>>> |
>>> | int main(void)
>>> | {
>>> | return tgetent(NULL, "");
>>> | }
>>> | $ LANG=C gcc foo.c -lncurses -static
>>> | /tmp/ccRe0RW2.o: In function `main':
>>> | foo.c:(.text+0x19): undefined reference to `tgetent'
>>> | collect2: ld returned 1 exit status
>>> `----
>>>
>>> This makes zsh and possibly a few other packages FTBFS.
>>
>> So maybe we need to "append" each libtinfo.a to libncurses{,w}.a, like
>> this:
>>
>> ar xo libtinfo.a && ar sr libncurses.a *.o && rm -f *.o
>>
>> Any less ugly ideas?
>
> If zsh used pkg-config, it could use today's update (ncurses patch)
>
> pkg-config --static --libs ncurses
>
> That's one path forward...
>
> But most of your FTBFS's will be only looking for "-lncurses", not
> supposing that tgetent would be in another library.
I like the idea of fixing pkg-config, and making the "few" packages to use it.
Do you have an idea how many packages are affected?
Acknowledgement sent
to Thomas Dickey <[email protected]>:
Extra info received and forwarded to list. Copy sent to Craig Small <[email protected]>.
(Sun, 09 Oct 2011 10:39:06 GMT) (full text, mbox, link).
Subject: Re: Bug#644728: libncurses5-dev: static linking with -lncurses is
broken
Date: Sun, 9 Oct 2011 06:35:19 -0400 (EDT)
On Sun, 9 Oct 2011, Matthias Klose wrote:
> On 10/08/2011 07:56 PM, Thomas Dickey wrote:
...
>> If zsh used pkg-config, it could use today's update (ncurses patch)
>>
>> pkg-config --static --libs ncurses
>>
>> That's one path forward...
>>
>> But most of your FTBFS's will be only looking for "-lncurses", not
>> supposing that tgetent would be in another library.
>
> I like the idea of fixing pkg-config, and making the "few" packages to use it.
> Do you have an idea how many packages are affected?
not I (remember I'm the upstream, and can only guess)
--
Thomas E. Dickey
http://invisible-island.netftp://invisible-island.net
Subject: Re: Bug#644728: libncurses5-dev: static linking with -lncurses is broken
Date: Sun, 09 Oct 2011 18:00:46 +0200
On 2011-10-09 10:23 +0200, Matthias Klose wrote:
> On 10/08/2011 07:56 PM, Thomas Dickey wrote:
>>
>> If zsh used pkg-config, it could use today's update (ncurses patch)
>>
>> pkg-config --static --libs ncurses
>>
>> That's one path forward...
>>
>> But most of your FTBFS's will be only looking for "-lncurses", not
>> supposing that tgetent would be in another library.
>
> I like the idea of fixing pkg-config, and making the "few" packages to use it.
> Do you have an idea how many packages are affected?
Of the -static packages in Debian, only bash it seems. Version 4.1-3
will FTBFS when I make the intended changes to fix bug #644426, but
4.2-1~exp1 does not link to ncurses so should not be affected (didn't
test it because of #641350).
But maybe we should also think about our users who will have a hard time
linking anything statically with ncurses.
Cheers,
Sven
Acknowledgement sent
to Julien Cristau <[email protected]>:
Extra info received and forwarded to list. Copy sent to Craig Small <[email protected]>.
(Mon, 10 Oct 2011 19:42:03 GMT) (full text, mbox, link).
Subject: Re: Bug#644728: libncurses5-dev: static linking with -lncurses is
broken
Date: Mon, 10 Oct 2011 21:39:09 +0200
On Sun, Oct 9, 2011 at 18:00:46 +0200, Sven Joachim wrote:
> But maybe we should also think about our users who will have a hard time
> linking anything statically with ncurses.
>
Are there really that many people doing that? And who can't replace
"-lncurses" with "pkg-config --static --libs ncurses"?
Cheers,
Julien
Subject: Re: Bug#644728: libncurses5-dev: static linking with -lncurses is broken
Date: Mon, 10 Oct 2011 22:33:16 +0200
On 2011-10-10 21:39 +0200, Julien Cristau wrote:
> On Sun, Oct 9, 2011 at 18:00:46 +0200, Sven Joachim wrote:
>
>> But maybe we should also think about our users who will have a hard time
>> linking anything statically with ncurses.
>>
> Are there really that many people doing that?
Apparently not, since I could not find many complaints about Fedora's
ncurses-static package which have the same problem as we do.
> And who can't replace
> "-lncurses" with "pkg-config --static --libs ncurses"?
People who are running other people's `configure' scripts may have some
trouble doing that (not everybody knows autoconf/automake). And
pkg-config support in ncurses is relatively new, it was added shortly
after the 5.7 release.
But probably we can live with that, it seems.
Cheers,
Sven
/usr/x86_64-linux-gnu/libncurses.so contains
INPUT(libncurses.so.5 -ltinfo)
Replacing it with
INPUT(/lib/x86_64-linux-gnu/libncurses.so.5 -ltinfo)
made `make menuconfig` work for me.
Subject: Re: Bug#644728: libncurses5-dev: static linking with -lncurses is broken
Date: Wed, 12 Oct 2011 18:42:33 +0200
clone 644728 -1
reassign -1 zsh 4.3.12-1
retitle -1 zsh: FTBFS: configure: error: "No terminal handling library was found on your system."
clone 644728 -2
reassign -2 bash 4.1-3
retitle -2 bash: FTBFS with libncurses5-dev 5.9-3
severity -2 important
tags -2 wheezy sid
retitle 644728 libncurses5-dev: static linking with -lncurses requires -ltinfo as well
severity 644728 normal
thanks
On 2011-10-08 16:14 +0200, Sven Joachim wrote:
> Package: libncurses5-dev
> Version: 5.9-2
> Severity: serious
> X-Debbugs-CC: Matthias Klose <[email protected]>
>
> Static linking with -lncurses fails if you need symbols from libtinfo:
>
> ,----
> | $ cat foo.c
> | #include <term.h>
> | #include <stdlib.h>
> |
> | int main(void)
> | {
> | return tgetent(NULL, "");
> | }
> | $ LANG=C gcc foo.c -lncurses -static
> | /tmp/ccRe0RW2.o: In function `main':
> | foo.c:(.text+0x19): undefined reference to `tgetent'
> | collect2: ld returned 1 exit status
> `----
The general opinion seems to be that this is acceptable, and that people
wishing statically linking with ncurses need to specify -ltinfo
themselves, e.g. by using "pkg-config --static --libs ncurses" (only
possible in wheezy and later, though).
> This makes zsh and possibly a few other packages FTBFS.
The only other affected package I know of is bash which does not FTBFS
right now, but will with libncurses5-dev 5.9-3 due to the changes for
#644426. I will followup on the cloned bugs individually once I have
their numbers.
Cheers,
Sven
Changed Bug title to 'libncurses5-dev: static linking with -lncurses requires -ltinfo as well' from 'libncurses5-dev: static linking with -lncurses is broken'
Request was from Sven Joachim <[email protected]>
to [email protected].
(Wed, 12 Oct 2011 16:45:21 GMT) (full text, mbox, link).
Debbugs is free software and licensed under the terms of the GNU General
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.