Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 690232

Summary: app-shells/hstr-2.0 : /.../ld: hstr_curses.o: undefined reference to symbol keypad
Product: Gentoo Linux Reporter: Toralf Förster <toralf>
Component: Current packagesAssignee: Patrice Clement <monsieurp>
Severity: normal CC: esigra, lssndrbarbieri, main.haarp, moltonel, pia, shell-tools
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 457530    
Attachments: emerge-info.txt
Use pkg-config for ncurses

Description Toralf Förster gentoo-dev 2019-07-19 16:02:15 UTC
x86_64-pc-linux-gnu-gcc --pedantic -Wall -std=c99  -O2 -pipe -march=native  -Wl,-O1 -Wl,--as-needed -o hstr hashset.o hstr_curses.o hstr_history.o hstr_utils.o hstr_favorites.o hstr_blacklist.o hstr_regexp.o radixsort.o hstr.o main.o  -lreadline -lm -lncursesw 
/usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: hstr_curses.o: undefined reference to symbol 'keypad'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib64/ error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:386: hstr] Error 1


  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.1_systemd-libressl-20190714-193026


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

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

emerge -qpvO app-shells/hstr
[ebuild  N    ] app-shells/hstr-2.0
Comment 1 Toralf Förster gentoo-dev 2019-07-19 16:02:18 UTC
Created attachment 583642 [details]
Comment 2 Toralf Förster gentoo-dev 2019-07-19 16:02:20 UTC
Created attachment 583644 [details]
Comment 3 Toralf Förster gentoo-dev 2019-07-19 16:02:23 UTC
Created attachment 583646 [details]
Comment 4 Toralf Förster gentoo-dev 2019-07-19 16:02:26 UTC
Created attachment 583648 [details]
Comment 5 Toralf Förster gentoo-dev 2019-07-19 16:02:29 UTC
Created attachment 583650 [details]
Comment 6 Toralf Förster gentoo-dev 2019-07-19 16:02:31 UTC
Created attachment 583652 [details]
Comment 7 Toralf Förster gentoo-dev 2019-07-19 16:02:34 UTC
Created attachment 583654 [details]
Comment 8 Dan Goodliffe 2019-07-19 17:30:01 UTC
Looks like configure isn't picking up the libs from pkg-config for some reason:


$ pkg-config --libs ncursesw
-lncursesw -ltinfow

My configure skills probably aren't good enough to dig much deeper.
Comment 9 Dan Goodliffe 2019-07-19 17:57:59 UTC
OK, I dug anyway... learnt some configure foo on the way...

I *think* the problem is two parts:
a) 50-82 only uses pkg-config for ncurses if killwchar isn't in either libncursesw or libncurses (which it is)
b) src/ 40 uses NCURSES_LIBS, but sets up NCURSESW_LIBS, so even when configure does use pkg-config, the linking problems still exist (they actually get worse)
Comment 10 Dan Goodliffe 2019-07-19 18:05:51 UTC
Created attachment 583662 [details, diff]
Use pkg-config for ncurses

Attached patch produces a successful build and a working hstr.
It also causes configure to produce lots of warnings along the lines of:

checking assert.h presence... no
configure: WARNING: assert.h: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: assert.h: proceeding with the compiler's result
checking for assert.h... yes
Comment 11 Larry the Git Cow gentoo-dev 2019-11-28 22:01:07 UTC
The bug has been closed via the following commit(s):

commit 50942d513fa2c878cd975a822cc3ca70b55e8b56
Author:     Patrice Clement <>
AuthorDate: 2019-11-28 22:00:48 +0000
Commit:     Patrice Clement <>
CommitDate: 2019-11-28 22:01:02 +0000

    app-shells/hstr: fix ncurses configure.
    Patch courtesy of Dan Goodliffe <>.
    Package-Manager: Portage-2.3.79, Repoman-2.3.16
    Signed-off-by: Patrice Clement <>

 .../files/hstr-2.0-fix-ncurses-configure.patch     | 81 ++++++++++++++++++++++
 app-shells/hstr/hstr-2.0.ebuild                    |  2 +
 2 files changed, 83 insertions(+)