Debian Bug report logs - #644728
libncurses5-dev: static linking with -lncurses requires -ltinfo as well

version graph

Package: libncurses5-dev; Maintainer for libncurses5-dev is Craig Small <[email protected]>; Source for libncurses5-dev is src:ncurses (PTS, buildd, popcon).

Reported by: Sven Joachim <[email protected]>

Date: Sat, 8 Oct 2011 14:18:02 UTC

Severity: normal

Found in version ncurses/5.9-2

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], [email protected], Craig Small <[email protected]>:
Bug#644728; Package libncurses5-dev. (Sat, 08 Oct 2011 14:18:05 GMT) (full text, mbox, link).


Acknowledgement sent to Sven Joachim <[email protected]>:
New Bug report received and forwarded. Copy sent to [email protected], Craig Small <[email protected]>. (Sat, 08 Oct 2011 14:18:05 GMT) (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: Sven Joachim <[email protected]>
To: Debian Bug Tracking System <[email protected]>
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




Information forwarded to [email protected], Craig Small <[email protected]>:
Bug#644728; Package libncurses5-dev. (Sat, 08 Oct 2011 17:15:07 GMT) (full text, mbox, link).


Acknowledgement sent to Sven Joachim <[email protected]>:
Extra info received and forwarded to list. Copy sent to Craig Small <[email protected]>. (Sat, 08 Oct 2011 17:15:07 GMT) (full text, mbox, link).


Message #10 received at [email protected] (full text, mbox, reply):

From: Sven Joachim <[email protected]>
To: [email protected]
Cc: Matthias Klose <[email protected]>
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




Information forwarded to [email protected], Craig Small <[email protected]>:
Bug#644728; Package libncurses5-dev. (Sat, 08 Oct 2011 18:03:03 GMT) (full text, mbox, link).


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


Message #15 received at [email protected] (full text, mbox, reply):

From: Thomas Dickey <[email protected]>
To: Sven Joachim <[email protected]>, [email protected]
Cc: Matthias Klose <[email protected]>, Craig Small <[email protected]>
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.net
ftp://invisible-island.net




Information forwarded to [email protected], Craig Small <[email protected]>:
Bug#644728; Package libncurses5-dev. (Sun, 09 Oct 2011 08:27:11 GMT) (full text, mbox, link).


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


Message #20 received at [email protected] (full text, mbox, reply):

From: Matthias Klose <[email protected]>
To: Thomas Dickey <[email protected]>
Cc: Sven Joachim <[email protected]>, [email protected], Craig Small <[email protected]>
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?





Information forwarded to [email protected], Craig Small <[email protected]>:
Bug#644728; Package libncurses5-dev. (Sun, 09 Oct 2011 10:39:06 GMT) (full text, mbox, link).


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


Message #25 received at [email protected] (full text, mbox, reply):

From: Thomas Dickey <[email protected]>
To: Matthias Klose <[email protected]>
Cc: Sven Joachim <[email protected]>, [email protected], Craig Small <[email protected]>
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.net
ftp://invisible-island.net




Information forwarded to [email protected], Craig Small <[email protected]>:
Bug#644728; Package libncurses5-dev. (Sun, 09 Oct 2011 16:03:03 GMT) (full text, mbox, link).


Acknowledgement sent to Sven Joachim <[email protected]>:
Extra info received and forwarded to list. Copy sent to Craig Small <[email protected]>. (Sun, 09 Oct 2011 16:03:04 GMT) (full text, mbox, link).


Message #30 received at [email protected] (full text, mbox, reply):

From: Sven Joachim <[email protected]>
To: Matthias Klose <[email protected]>
Cc: [email protected], Thomas Dickey <[email protected]>
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




Information forwarded to [email protected], Craig Small <[email protected]>:
Bug#644728; Package libncurses5-dev. (Mon, 10 Oct 2011 19:42:03 GMT) (full text, mbox, link).


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


Message #35 received at [email protected] (full text, mbox, reply):

From: Julien Cristau <[email protected]>
To: Sven Joachim <[email protected]>, [email protected]
Cc: Matthias Klose <[email protected]>, Thomas Dickey <[email protected]>
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




Information forwarded to [email protected], Craig Small <[email protected]>:
Bug#644728; Package libncurses5-dev. (Mon, 10 Oct 2011 20:36:03 GMT) (full text, mbox, link).


Acknowledgement sent to Sven Joachim <[email protected]>:
Extra info received and forwarded to list. Copy sent to Craig Small <[email protected]>. (Mon, 10 Oct 2011 20:36:03 GMT) (full text, mbox, link).


Message #40 received at [email protected] (full text, mbox, reply):

From: Sven Joachim <[email protected]>
To: Julien Cristau <[email protected]>
Cc: [email protected], Matthias Klose <[email protected]>, Thomas Dickey <[email protected]>
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




Information forwarded to [email protected], Craig Small <[email protected]>:
Bug#644728; Package libncurses5-dev. (Mon, 10 Oct 2011 23:18:18 GMT) (full text, mbox, link).


Acknowledgement sent to Jim Hill <[email protected]>:
Extra info received and forwarded to list. Copy sent to Craig Small <[email protected]>. (Mon, 10 Oct 2011 23:18:18 GMT) (full text, mbox, link).


Message #45 received at [email protected] (full text, mbox, reply):

From: Jim Hill <[email protected]>
To: [email protected]
Subject: fix for amd64 at least
Date: Mon, 10 Oct 2011 16:17:34 -0700
/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.




Information forwarded to [email protected], Craig Small <[email protected]>:
Bug#644728; Package libncurses5-dev. (Mon, 10 Oct 2011 23:24:06 GMT) (full text, mbox, link).


Acknowledgement sent to Jim Hill <[email protected]>:
Extra info received and forwarded to list. Copy sent to Craig Small <[email protected]>. (Mon, 10 Oct 2011 23:24:06 GMT) (full text, mbox, link).


Message #50 received at [email protected] (full text, mbox, reply):

From: Jim Hill <[email protected]>
To: [email protected]
Subject: that's dynamic linking, not static, sorry.
Date: Mon, 10 Oct 2011 16:21:59 -0700
Sorry for missing that "static" bit.  I'll file a separate bug




Information forwarded to [email protected], Craig Small <[email protected]>:
Bug#644728; Package libncurses5-dev. (Wed, 12 Oct 2011 16:45:10 GMT) (full text, mbox, link).


Acknowledgement sent to Sven Joachim <[email protected]>:
Extra info received and forwarded to list. Copy sent to Craig Small <[email protected]>. (Wed, 12 Oct 2011 16:45:10 GMT) (full text, mbox, link).


Message #55 received at [email protected] (full text, mbox, reply):

From: Sven Joachim <[email protected]>
To: [email protected]
Cc: [email protected], [email protected]
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




Bug 644728 cloned as bug 645112. Request was from Sven Joachim <[email protected]> to [email protected]. (Wed, 12 Oct 2011 16:45:10 GMT) (full text, mbox, link).


Bug 644728 cloned as bug 645113. Request was from Sven Joachim <[email protected]> to [email protected]. (Wed, 12 Oct 2011 16:45:16 GMT) (full text, mbox, link).


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


Severity set to 'normal' from 'serious' Request was from Sven Joachim <[email protected]> to [email protected]. (Wed, 12 Oct 2011 16:45:22 GMT) (full text, mbox, link).


Information forwarded to [email protected], Craig Small <[email protected]>:
Bug#644728; Package libncurses5-dev. (Sun, 26 Apr 2020 04:09:03 GMT) (full text, mbox, link).


Acknowledgement sent to [email protected]:
Extra info received and forwarded to list. Copy sent to Craig Small <[email protected]>. (Sun, 26 Apr 2020 04:09:45 GMT) (full text, mbox, link).


Message #68 received at [email protected] (full text, mbox, reply):

From: Smith and Associates <[email protected]>
To: [email protected]
Subject: CONFIM RECEIPT
Date: Sat, 25 Apr 2020 20:33:25 -0700
Dear Sir,

Did you get my previous email about you deceased relatives estate?

Paul Smith
Smith and Associates
Tampa Florida U.S.A



Information forwarded to [email protected], Craig Small <[email protected]>:
Bug#644728; Package libncurses5-dev. (Sat, 02 May 2020 00:27:07 GMT) (full text, mbox, link).


Acknowledgement sent to [email protected]:
Extra info received and forwarded to list. Copy sent to Craig Small <[email protected]>. (Sat, 02 May 2020 00:27:07 GMT) (full text, mbox, link).


Message #73 received at [email protected] (full text, mbox, reply):

From: Smith and Associates <[email protected]>
To: [email protected]
Subject: DID YOU GET IT?
Date: Fri, 01 May 2020 17:23:17 -0700
Dear Sir,

Did you get my previous email about you deceased relatives estate?

Paul Smith
Smith and Associates
Tampa Florida U.S.A



Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Fri May 16 02:21:29 2025; Machine Name: bembo

Debian Bug tracking system

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

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.