RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1025744 - pkg-config doesn't show tinfo link flag for ncurses
Summary: pkg-config doesn't show tinfo link flag for ncurses
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: ncurses
Version: 6.4
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Miroslav Lichvar
QA Contact: Martin Frodl
URL:
Whiteboard:
Depends On:
Blocks: 947782 1075802 1159825
TreeView+ depends on / blocked
 
Reported: 2013-11-01 12:27 UTC by Deepu K S
Modified: 2019-04-16 14:05 UTC (History)
9 users (show)

Fixed In Version: ncurses-5.7-4.20090207.el6
Doc Type: Bug Fix
Doc Text:
Cause: The ncurses pc (pkg-config) files didn't include -ltinfo for static linking with ncurses. Consequence: Compilation of applications that use pkg-config and static linking could fail. Fix: Include -ltinfo in the pkg-config files Result: Applications compile successfully.
Clone Of:
Environment:
Last Closed: 2015-03-16 08:40:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
ncurses.pc file with tinfo added (262 bytes, patch)
2013-11-01 12:33 UTC, Deepu K S
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0687 0 normal SHIPPED_LIVE ncurses bug fix update 2015-03-16 12:40:06 UTC

Description Deepu K S 2013-11-01 12:27:56 UTC
Description of problem:
pkg-config returns incorrect results for ncurses (missing tinfo dependency)

'pkg-config --libs --static ncurses' doesn't return the tinfo link flag values. Doing an objdump or ldd to the libncurses.so library returns the libtinfo library.

# objdump -x /usr/lib64/libncurses.so | grep NEEDED
  NEEDED               libc.so.6
  NEEDED               libdl.so.2
  NEEDED               libtinfo.so.5

At present, below is the output for pkg-config.
Actual results:
$ /usr/bin/pkg-config --libs --static ncurses
-lncurses  
$ /usr/bin/pkg-config --libs --static ncursesw
-lncursesw

Expected results:
The pkg-config entry should be changed to require tinfo. We need to add tinfo to Requires: field in ncurses.pc and ncursesw.pc

$ /usr/bin/pkg-config --libs --static ncurses
-lncurses -ltinfo
$ /usr/bin/pkg-config --libs --static ncursesw
-lncursesw -ltinfo

Version-Release number of selected component (if applicable):
Red Hat Enterprise Linux 6
ncurses-5.7-3.20090208.el6.x86_64
ncurses-devel-5.7-3.20090208.el6.x86_64

Comment 1 Deepu K S 2013-11-01 12:33:58 UTC
Created attachment 818281 [details]
ncurses.pc file with tinfo added

Comment 3 RHEL Program Management 2013-11-01 12:50:17 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.

Comment 5 Miroslav Lichvar 2014-01-02 10:53:45 UTC
Yes, with static linking -ltinfo should be included in the list. But it needs to be in requires.private so it's not listed when using dynamic linking. I.e.

Requires.private: tinfo

Comment 11 errata-xmlrpc 2015-03-16 08:40:11 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0687.html

Comment 12 Xavier 2015-10-15 13:39:19 UTC
If "pkg-config --libs ncurses" returns only "-lncurses", and the linker flags --no-add-needed is used, don't we have a problem ?
If I understood correctly, the --no-add-needed flag even became the default in redhat 7.

And when using clang, which invokes directly the linker, the --no-add-needed flag is always added as soon as we are on a redhat system (c.f. https://llvm.org/bugs/show_bug.cgi?id=19745)

And on debian "pkg-config --libs ncurses" returns "-lncurses -ltinfo".

That said, I guess I can use "pkg-config --libs ncurses tinfo" instead, centos 5 did not have a pkgconfig file anyway, and this will work on redhat >= 6 and on debian.

Comment 13 Miroslav Lichvar 2015-10-15 15:28:20 UTC
I think that depends on the application. If it uses the libtinfo symbols, it should use pkg-config to get the tinfo libs and don't expect it will be included in the ncurses libs.


Note You need to log in before you can comment on or make changes to this bug.