Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 689982 - sys-process/xjobs-20170829 : colortty.c:(.text+<snip>): undefined reference to setupterm
Summary: sys-process/xjobs-20170829 : colortty.c:(.text+<snip>): undefined reference t...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Michael Orlitzky
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-16 15:51 UTC by Toralf Förster
Modified: 2019-08-19 12:31 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge-info.txt (emerge-info.txt,15.83 KB, text/plain)
2019-07-16 15:52 UTC, Toralf Förster
Details
environment (environment,14.77 KB, text/plain)
2019-07-16 15:52 UTC, Toralf Förster
Details
etc.portage.tbz2 (etc.portage.tbz2,12.93 KB, application/x-bzip)
2019-07-16 15:52 UTC, Toralf Förster
Details
logs.tbz2 (logs.tbz2,17.49 KB, application/x-bzip)
2019-07-16 15:52 UTC, Toralf Förster
Details
sys-process:xjobs-20170829:20190715-222734.log (sys-process:xjobs-20170829:20190715-222734.log,7.57 KB, text/plain)
2019-07-16 15:52 UTC, Toralf Förster
Details
temp.tbz2 (temp.tbz2,6.80 KB, application/x-bzip)
2019-07-16 15:52 UTC, Toralf Förster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2019-07-16 15:51:59 UTC
x86_64-pc-linux-gnu-gcc -O2 -pipe -march=native -DHAVE_CONFIG_H -Wl,-O1 -Wl,--as-needed xjobs.o settings.o colortty.o jobctrl.o log.o support.o lexextra.o tokenizer.o -lm  -o xjobs
/usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: colortty.o: in function `init_terminal':
colortty.c:(.text+0x4d5): undefined reference to `setupterm'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: colortty.c:(.text+0x50d): undefined reference to `tigetstr'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: colortty.c:(.text+0x52a): undefined reference to `tigetstr'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: colortty.c:(.text+0x547): undefined reference to `tigetstr'

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.1_no-multilib-20190711-143155

  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-9.1.0 *

Available Python interpreters, in order of preference:
  [1]   python3.7
  [2]   python3.6
  [3]   python2.7 (fallback)
Available Ruby profiles:
  [1]   ruby24 (with Rubygems) *
Available Rust versions:
  [1]   rust-1.36.0 *



emerge -qpvO sys-process/xjobs
[ebuild  N    ] sys-process/xjobs-20170829  USE="-examples"
Comment 1 Toralf Förster gentoo-dev 2019-07-16 15:52:03 UTC
Created attachment 582982 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2019-07-16 15:52:29 UTC
Created attachment 582984 [details]
environment
Comment 3 Toralf Förster gentoo-dev 2019-07-16 15:52:32 UTC
Created attachment 582986 [details]
etc.portage.tbz2
Comment 4 Toralf Förster gentoo-dev 2019-07-16 15:52:35 UTC
Created attachment 582988 [details]
logs.tbz2
Comment 5 Toralf Förster gentoo-dev 2019-07-16 15:52:37 UTC
Created attachment 582990 [details]
sys-process:xjobs-20170829:20190715-222734.log
Comment 6 Toralf Förster gentoo-dev 2019-07-16 15:52:40 UTC
Created attachment 582992 [details]
temp.tbz2
Comment 7 Michael Orlitzky gentoo-dev 2019-08-06 15:36:38 UTC
This happens because the build system finds (n)curses.h and term.h,

  checking for ncurses.h... yes
  checking for curses.h... yes
  checking for term.h... yes

leading it to define HAVE_TERMINFO in colortty.c:

  #ifdef HAVE_NCURSES_H
  #include <ncurses.h>
  #ifndef HAVE_TERMINFO
  #define HAVE_TERMINFO
  #endif
  #endif

That in turn leads to a link failure when we try to use tigetstr() from terminfo, because we never in fact knew where to find it to begin with:

  checking for library containing tigetstr... no

With newer versions of ncurses (at least in Gentoo?), that function is now located in a separate library, libtinfo. I think the following patch is all that's needed to support both library names in a backwards-compatible way:

diff --git a/configure.in b/configure.in
index a57ec35..44a85dc 100644
--- a/configure.in
+++ b/configure.in
@@ -71,7 +71,7 @@ AC_CHECK_HEADERS([curses.h term.h],
        AC_INCLUDES_DEFAULT
        )

-AC_SEARCH_LIBS(tigetstr,ncurses,)
+AC_SEARCH_LIBS(tigetstr, ncurses tinfo)

 AC_SUBST(DEBUG)
 AC_DEFINE_UNQUOTED(PACKAGE,"${PACKAGE}")
Comment 8 Larry the Git Cow gentoo-dev 2019-08-15 01:07:54 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a3769d82e127646e75a8fa32d79e971ea5063aa8

commit a3769d82e127646e75a8fa32d79e971ea5063aa8
Author:     Michael Orlitzky <mjo@gentoo.org>
AuthorDate: 2019-08-15 01:01:31 +0000
Commit:     Michael Orlitzky <mjo@gentoo.org>
CommitDate: 2019-08-15 01:01:51 +0000

    sys-process/xjobs: new version 20190725.
    
    This version comes with a few fixes/improvements:
    
      * An update to EAPI=7.
    
      * A patch to fix the build against separate libtinfo (bug #689982).
        Upstream will include a similar fix in subsequent versions.
    
      * An unconditional build/runtime dependency on ncurses/libtinfo
        which are detected and used automagically by the build system.
    
    Bug: https://bugs.gentoo.org/689982
    Package-Manager: Portage-2.3.69, Repoman-2.3.16
    Signed-off-by: Michael Orlitzky <mjo@gentoo.org>

 sys-process/xjobs/Manifest                         |  1 +
 .../search-libtinfo-for-tigetstr-and-tparm.patch   | 32 +++++++++++++++++++
 sys-process/xjobs/xjobs-20190725.ebuild            | 36 ++++++++++++++++++++++
 3 files changed, 69 insertions(+)
Comment 9 Larry the Git Cow gentoo-dev 2019-08-19 12:31:48 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=85e66acf23b5af7a19af206d931af16a3768ee2e

commit 85e66acf23b5af7a19af206d931af16a3768ee2e
Author:     Michael Orlitzky <mjo@gentoo.org>
AuthorDate: 2019-08-19 12:31:06 +0000
Commit:     Michael Orlitzky <mjo@gentoo.org>
CommitDate: 2019-08-19 12:31:06 +0000

    sys-process/xjobs: remove old xjobs-20170829.ebuild.
    
    Closes: https://bugs.gentoo.org/689982
    Package-Manager: Portage-2.3.69, Repoman-2.3.16
    Signed-off-by: Michael Orlitzky <mjo@gentoo.org>

 sys-process/xjobs/Manifest              |  1 -
 sys-process/xjobs/xjobs-20170829.ebuild | 21 ---------------------
 2 files changed, 22 deletions(-)