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 <csmall@debian.org>; Source for libncurses5-dev is src:ncurses.

Reported by: Sven Joachim <svenjoac@gmx.de>

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

Severity: normal

Found in version ncurses/5.9-2

Reply or subscribe to this bug.

Toggle useless messages

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


Report forwarded to debian-bugs-dist@lists.debian.org, svenjoac@gmx.de, Craig Small <csmall@debian.org>:
Bug#644728; Package libncurses5-dev. (Sat, 08 Oct 2011 14:18:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sven Joachim <svenjoac@gmx.de>:
New Bug report received and forwarded. Copy sent to svenjoac@gmx.de, Craig Small <csmall@debian.org>. (Sat, 08 Oct 2011 14:18:05 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Sven Joachim <svenjoac@gmx.de>
To: Debian Bug Tracking System <submit@bugs.debian.org>
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 <doko@debian.org>

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 debian-bugs-dist@lists.debian.org, Craig Small <csmall@debian.org>:
Bug#644728; Package libncurses5-dev. (Sat, 08 Oct 2011 17:15:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sven Joachim <svenjoac@gmx.de>:
Extra info received and forwarded to list. Copy sent to Craig Small <csmall@debian.org>. (Sat, 08 Oct 2011 17:15:07 GMT) Full text and rfc822 format available.

Message #10 received at 644728@bugs.debian.org (full text, mbox):

From: Sven Joachim <svenjoac@gmx.de>
To: 644728@bugs.debian.org
Cc: Matthias Klose <doko@debian.org>
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 <doko@debian.org>
>
> 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 debian-bugs-dist@lists.debian.org, Craig Small <csmall@debian.org>:
Bug#644728; Package libncurses5-dev. (Sat, 08 Oct 2011 18:03:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Thomas Dickey <dickey@his.com>:
Extra info received and forwarded to list. Copy sent to Craig Small <csmall@debian.org>. (Sat, 08 Oct 2011 18:03:03 GMT) Full text and rfc822 format available.

Message #15 received at 644728@bugs.debian.org (full text, mbox):

From: Thomas Dickey <dickey@his.com>
To: Sven Joachim <svenjoac@gmx.de>, 644728@bugs.debian.org
Cc: Matthias Klose <doko@debian.org>, Craig Small <csmall@debian.org>
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 <doko@debian.org>
>>
>> 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 debian-bugs-dist@lists.debian.org, Craig Small <csmall@debian.org>:
Bug#644728; Package libncurses5-dev. (Sun, 09 Oct 2011 08:27:11 GMT) Full text and rfc822 format available.

Acknowledgement sent to Matthias Klose <doko@debian.org>:
Extra info received and forwarded to list. Copy sent to Craig Small <csmall@debian.org>. (Sun, 09 Oct 2011 08:27:11 GMT) Full text and rfc822 format available.

Message #20 received at 644728@bugs.debian.org (full text, mbox):

From: Matthias Klose <doko@debian.org>
To: Thomas Dickey <dickey@his.com>
Cc: Sven Joachim <svenjoac@gmx.de>, 644728@bugs.debian.org, Craig Small <csmall@debian.org>
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 <doko@debian.org>
>>>
>>> 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 debian-bugs-dist@lists.debian.org, Craig Small <csmall@debian.org>:
Bug#644728; Package libncurses5-dev. (Sun, 09 Oct 2011 10:39:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Thomas Dickey <dickey@his.com>:
Extra info received and forwarded to list. Copy sent to Craig Small <csmall@debian.org>. (Sun, 09 Oct 2011 10:39:06 GMT) Full text and rfc822 format available.

Message #25 received at 644728@bugs.debian.org (full text, mbox):

From: Thomas Dickey <dickey@his.com>
To: Matthias Klose <doko@debian.org>
Cc: Sven Joachim <svenjoac@gmx.de>, 644728@bugs.debian.org, Craig Small <csmall@debian.org>
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 debian-bugs-dist@lists.debian.org, Craig Small <csmall@debian.org>:
Bug#644728; Package libncurses5-dev. (Sun, 09 Oct 2011 16:03:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sven Joachim <svenjoac@gmx.de>:
Extra info received and forwarded to list. Copy sent to Craig Small <csmall@debian.org>. (Sun, 09 Oct 2011 16:03:04 GMT) Full text and rfc822 format available.

Message #30 received at 644728@bugs.debian.org (full text, mbox):

From: Sven Joachim <svenjoac@gmx.de>
To: Matthias Klose <doko@debian.org>
Cc: 644728@bugs.debian.org, Thomas Dickey <dickey@his.com>
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 debian-bugs-dist@lists.debian.org, Craig Small <csmall@debian.org>:
Bug#644728; Package libncurses5-dev. (Mon, 10 Oct 2011 19:42:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Julien Cristau <jcristau@debian.org>:
Extra info received and forwarded to list. Copy sent to Craig Small <csmall@debian.org>. (Mon, 10 Oct 2011 19:42:03 GMT) Full text and rfc822 format available.

Message #35 received at 644728@bugs.debian.org (full text, mbox):

From: Julien Cristau <jcristau@debian.org>
To: Sven Joachim <svenjoac@gmx.de>, 644728@bugs.debian.org
Cc: Matthias Klose <doko@debian.org>, Thomas Dickey <dickey@his.com>
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 debian-bugs-dist@lists.debian.org, Craig Small <csmall@debian.org>:
Bug#644728; Package libncurses5-dev. (Mon, 10 Oct 2011 20:36:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sven Joachim <svenjoac@gmx.de>:
Extra info received and forwarded to list. Copy sent to Craig Small <csmall@debian.org>. (Mon, 10 Oct 2011 20:36:03 GMT) Full text and rfc822 format available.

Message #40 received at 644728@bugs.debian.org (full text, mbox):

From: Sven Joachim <svenjoac@gmx.de>
To: Julien Cristau <jcristau@debian.org>
Cc: 644728@bugs.debian.org, Matthias Klose <doko@debian.org>, Thomas Dickey <dickey@his.com>
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 debian-bugs-dist@lists.debian.org, Craig Small <csmall@debian.org>:
Bug#644728; Package libncurses5-dev. (Mon, 10 Oct 2011 23:18:18 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jim Hill <gjthill@gmail.com>:
Extra info received and forwarded to list. Copy sent to Craig Small <csmall@debian.org>. (Mon, 10 Oct 2011 23:18:18 GMT) Full text and rfc822 format available.

Message #45 received at 644728@bugs.debian.org (full text, mbox):

From: Jim Hill <gjthill@gmail.com>
To: 644728@bugs.debian.org
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 debian-bugs-dist@lists.debian.org, Craig Small <csmall@debian.org>:
Bug#644728; Package libncurses5-dev. (Mon, 10 Oct 2011 23:24:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jim Hill <gjthill@gmail.com>:
Extra info received and forwarded to list. Copy sent to Craig Small <csmall@debian.org>. (Mon, 10 Oct 2011 23:24:06 GMT) Full text and rfc822 format available.

Message #50 received at 644728@bugs.debian.org (full text, mbox):

From: Jim Hill <gjthill@gmail.com>
To: 644728@bugs.debian.org
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 debian-bugs-dist@lists.debian.org, Craig Small <csmall@debian.org>:
Bug#644728; Package libncurses5-dev. (Wed, 12 Oct 2011 16:45:10 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sven Joachim <svenjoac@gmx.de>:
Extra info received and forwarded to list. Copy sent to Craig Small <csmall@debian.org>. (Wed, 12 Oct 2011 16:45:10 GMT) Full text and rfc822 format available.

Message #55 received at 644728@bugs.debian.org (full text, mbox):

From: Sven Joachim <svenjoac@gmx.de>
To: 644728@bugs.debian.org
Cc: zsh@packages.debian.org, bash@packages.debian.org
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 <doko@debian.org>
>
> 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 <svenjoac@gmx.de> to control@bugs.debian.org. (Wed, 12 Oct 2011 16:45:10 GMT) Full text and rfc822 format available.

Bug 644728 cloned as bug 645113. Request was from Sven Joachim <svenjoac@gmx.de> to control@bugs.debian.org. (Wed, 12 Oct 2011 16:45:16 GMT) Full text and rfc822 format available.

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 <svenjoac@gmx.de> to control@bugs.debian.org. (Wed, 12 Oct 2011 16:45:21 GMT) Full text and rfc822 format available.

Severity set to 'normal' from 'serious' Request was from Sven Joachim <svenjoac@gmx.de> to control@bugs.debian.org. (Wed, 12 Oct 2011 16:45:22 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Apr 20 19:41:32 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.