Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 752405 - sys-devel/gdb-10.1: emerge fails with "tui/tui-win.o: undefined reference to symbol 'keypad'"
Summary: sys-devel/gdb-10.1: emerge fails with "tui/tui-win.o: undefined reference to ...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-03 03:03 UTC by OKUMURA N. Shin-ya
Modified: 2020-11-04 00:17 UTC (History)
0 users

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


Attachments
build.log (build.log,659.20 KB, text/x-log)
2020-11-03 03:04 UTC, OKUMURA N. Shin-ya
Details
emerge --info '=sys-devel/gdb-10.1::gentoo' (emerge-info.txt,7.88 KB, text/plain)
2020-11-03 03:04 UTC, OKUMURA N. Shin-ya
Details
emerge -pqv '=sys-devel/gdb-10.1::gentoo' (emerge-pqv.txt,197 bytes, text/plain)
2020-11-03 03:05 UTC, OKUMURA N. Shin-ya
Details
/var/tmp/portage/sys-devel/gdb-10.1/temp/environment (environment,113.15 KB, text/plain)
2020-11-03 03:06 UTC, OKUMURA N. Shin-ya
Details

Note You need to log in before you can comment on or make changes to this bug.
Description OKUMURA N. Shin-ya 2020-11-03 03:03:33 UTC
emerge gdb-10.1 fails as follows;
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: tui/tui-win.o: undefined reference to symbol 'keypad'
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib64/libtinfow.so.6: error adding symbols: DSO missing from command line
...

The symbol 'keypad' is contained in /lib64/libtinfo.so.6.2 and /lib64/libtinfow.so.6.2 on my environment, and the sys-libs/ncurses-6.2-r1 was built with USE=tinfo.

Workaround: following one works fine on my environment.
LIBS=-ltinfow emerge =sys-devel/gdb-10.1

Reproducible: Always

Steps to Reproduce:
1. USE=tinfo emerge =sys-libs/ncurses-6.2-r1
2. emerge =sys-devel/gdb-10.1
Actual Results:  
...
x86_64-pc-linux-gnu-g++  -march=native -O2 -pipe   -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0  -pthread  \
        -o gdb gdb.o ada-exp.o ada-lang.o ada-tasks.o ada-typeprint.o ada-valprint.o ada-varobj.o addrmap.o agent.o alloc.o amd64-linux-nat.o amd64-linux-tdep.o amd64-nat.o amd64-tdep.o annotate.o arch-utils.o arch/amd64.o arch/i386.o async-event.o auto-load.o auxv.o ax-gdb.o ax-general.o bcache.o bfd-target.o block.o blockframe.o break-catch-sig.o break-catch-syscall.o break-catch-throw.o breakpoint.o btrace.o build-id.o buildsym-legacy.o buildsym.o c-exp.o c-lang.o c-typeprint.o c-valprint.o c-varobj.o charset.o cli-out.o cli/cli-cmds.o cli/cli-decode.o cli/cli-dump.o cli/cli-interp.o cli/cli-logging.o cli/cli-option.o cli/cli-script.o cli/cli-setshow.o cli/cli-style.o cli/cli-utils.o coff-pe-read.o coffread.o compile/compile-c-support.o compile/compile-c-symbols.o compile/compile-c-types.o compile/compile-cplus-symbols.o compile/compile-cplus-types.o compile/compile-loc2c.o compile/compile-object-load.o compile/compile-object-run.o compile/compile.o complaints.o completer.o continuations.o copying.o corefile.o corelow.o cp-abi.o cp-name-parser.o cp-namespace.o cp-support.o cp-valprint.o ctfread.o d-exp.o d-lang.o d-namespace.o d-valprint.o dbxread.o dcache.o debug.o debuginfod-support.o dictionary.o disasm.o dtrace-probe.o dummy-frame.o dwarf2/abbrev.o dwarf2/attribute.o dwarf2/comp-unit.o dwarf2/dwz.o dwarf2/expr.o dwarf2/frame-tailcall.o dwarf2/frame.o dwarf2/index-cache.o dwarf2/index-common.o dwarf2/index-write.o dwarf2/leb.o dwarf2/line-header.o dwarf2/loc.o dwarf2/macro.o dwarf2/read.o dwarf2/section.o dwarf2/stringify.o elfread.o eval.o event-top.o exceptions.o exec.o expprint.o extension.o f-exp.o f-lang.o f-typeprint.o f-valprint.o filename-seen-cache.o filesystem.o findcmd.o findvar.o fork-child.o frame-base.o frame-unwind.o frame.o gcore.o gdb-demangle.o gdb_bfd.o gdb_obstack.o gdb_regex.o gdbarch.o gdbtypes.o glibc-tdep.o gnu-v2-abi.o gnu-v3-abi.o go-exp.o go-lang.o go-typeprint.o go-valprint.o guile/guile.o i386-linux-tdep.o i386-tdep.o i387-tdep.o inf-child.o inf-loop.o inf-ptrace.o infcall.o infcmd.o inferior.o inflow.o infrun.o inline-frame.o interps.o jit.o language.o linespec.o linux-fork.o linux-nat.o linux-record.o linux-tdep.o linux-thread-db.o location.o m2-exp.o m2-lang.o m2-typeprint.o m2-valprint.o macrocmd.o macroexp.o macroscope.o macrotab.o main.o maint-test-options.o maint-test-settings.o maint.o mdebugread.o mem-break.o memattr.o memory-map.o memrange.o mi/mi-cmd-break.o mi/mi-cmd-catch.o mi/mi-cmd-disas.o mi/mi-cmd-env.o mi/mi-cmd-file.o mi/mi-cmd-info.o mi/mi-cmd-stack.o mi/mi-cmd-target.o mi/mi-cmd-var.o mi/mi-cmds.o mi/mi-common.o mi/mi-console.o mi/mi-getopt.o mi/mi-interp.o mi/mi-main.o mi/mi-out.o mi/mi-parse.o mi/mi-symbol-cmds.o minidebug.o minsyms.o mipsread.o namespace.o nat/amd64-linux-siginfo.o nat/fork-inferior.o nat/linux-btrace.o nat/linux-namespaces.o nat/linux-osdata.o nat/linux-personality.o nat/linux-procfs.o nat/linux-ptrace.o nat/linux-waitpid.o nat/x86-dregs.o nat/x86-linux-dregs.o nat/x86-linux.o objc-lang.o objfiles.o observable.o opencl-lang.o osabi.o osdata.o p-exp.o p-lang.o p-typeprint.o p-valprint.o parse.o posix-hdep.o printcmd.o probe.o proc-service.o process-stratum-target.o producer.o progspace-and-thread.o progspace.o prologue-value.o psymtab.o python/py-arch.o python/py-auto-load.o python/py-block.o python/py-bpevent.o python/py-breakpoint.o python/py-cmd.o python/py-continueevent.o python/py-event.o python/py-evtregistry.o python/py-evts.o python/py-exitedevent.o python/py-finishbreakpoint.o python/py-frame.o python/py-framefilter.o python/py-function.o python/py-gdb-readline.o python/py-inferior.o python/py-infevents.o python/py-infthread.o python/py-instruction.o python/py-lazy-string.o python/py-linetable.o python/py-newobjfileevent.o python/py-objfile.o python/py-param.o python/py-prettyprint.o python/py-progspace.o python/py-record-btrace.o python/py-record-full.o python/py-record.o python/py-registers.o python/py-signalevent.o python/py-stopevent.o python/py-symbol.o python/py-symtab.o python/py-threadevent.o python/py-tui.o python/py-type.o python/py-unwind.o python/py-utils.o python/py-value.o python/py-varobj.o python/py-xmethods.o python/python.o record-btrace.o record-full.o record.o regcache-dump.o regcache.o reggroups.o registry.o remote-fileio.o remote-notif.o remote.o reverse.o run-on-main-thread.o rust-exp.o rust-lang.o sentinel-frame.o ser-base.o ser-event.o ser-pipe.o ser-tcp.o ser-uds.o ser-unix.o serial.o skip.o solib-svr4.o solib-target.o solib.o source-cache.o source.o stabsread.o stack.o stap-probe.o std-regs.o symfile-debug.o symfile-mem.o symfile.o symmisc.o symtab.o target-connection.o target-dcache.o target-descriptions.o target-float.o target-memory.o target.o target/waitstatus.o test-target.o thread-iter.o thread.o tid-parse.o top.o tracectf.o tracefile-tfile.o tracefile.o tracepoint.o trad-frame.o tramp-frame.o tui/tui-command.o tui/tui-data.o tui/tui-disasm.o tui/tui-file.o tui/tui-hooks.o tui/tui-interp.o tui/tui-io.o tui/tui-layout.o tui/tui-out.o tui/tui-regs.o tui/tui-source.o tui/tui-stack.o tui/tui-win.o tui/tui-wingeneral.o tui/tui-winsource.o tui/tui.o type-stack.o typeprint.o ui-file.o ui-out.o ui-style.o user-regs.o utils.o valarith.o valops.o valprint.o value.o varobj.o version.o x86-linux-nat.o x86-nat.o x86-tdep.o xml-builtin.o xml-support.o xml-syscall.o xml-tdesc.o init.o \
           -lreadline ../opcodes/libopcodes.a ../libctf/.libs/libctf.a ../bfd/libbfd.a -lz ../gdbsupport/libgdbsupport.a  ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a   -ltermcap -lncursesw -lm -ldl   -lpython3.8 -lcrypt -lpthread -ldl -lutil -lm -lm /usr/lib64/libexpat.so -Wl,-rpath -Wl,/usr/lib64 /usr/lib64/liblzma.so -Wl,-rpath -Wl,/usr/lib64    ../gnulib/import/libgnu.a  /usr/lib64/libmpfr.so /usr/lib64/libgmp.so -Wl,-rpath -Wl,/usr/lib64     -ldl -Wl,--dynamic-list=./proc-service.list
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: tui/tui-win.o: undefined reference to symbol 'keypad'
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib64/libtinfow.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:1870: gdb] Error 1
make[2]: Leaving directory '/var/tmp/portage/sys-devel/gdb-10.1/work/gdb-10.1/gdb'
make[1]: *** [Makefile:9430: all-gdb] Error 2
make[1]: Leaving directory '/var/tmp/portage/sys-devel/gdb-10.1/work/gdb-10.1'
make: *** [Makefile:854: all] Error 2
 * ERROR: sys-devel/gdb-10.1::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=sys-devel/gdb-10.1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-devel/gdb-10.1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/sys-devel/gdb-10.1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-devel/gdb-10.1/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-devel/gdb-10.1/work/gdb-10.1'
 * S: '/var/tmp/portage/sys-devel/gdb-10.1/work/gdb-10.1'


Expected Results:  
emerge should success. :-)

Perhaps ncurses (not gdb) should be fixed.
I will attach "emerge --info" and so on, later.
Comment 1 OKUMURA N. Shin-ya 2020-11-03 03:04:25 UTC
Created attachment 669812 [details]
build.log
Comment 2 OKUMURA N. Shin-ya 2020-11-03 03:04:55 UTC
Created attachment 669815 [details]
emerge --info '=sys-devel/gdb-10.1::gentoo'
Comment 3 OKUMURA N. Shin-ya 2020-11-03 03:05:33 UTC
Created attachment 669818 [details]
emerge -pqv '=sys-devel/gdb-10.1::gentoo'
Comment 4 OKUMURA N. Shin-ya 2020-11-03 03:06:13 UTC
Created attachment 669821 [details]
/var/tmp/portage/sys-devel/gdb-10.1/temp/environment
Comment 5 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2020-11-03 06:29:16 UTC
IIRC the keypad symbol comes from sys-libs/ncurses.

Please post the output of

  emerge -Opqv ncurses

to this bug.
Comment 6 Sergei Trofimovich (RETIRED) gentoo-dev 2020-11-03 08:53:26 UTC
I think it's another instance of https://bugs.gentoo.org/729988#c5 where your system somehow has 'libtermcap.so' installed.

Can you find where libtermcap.so comes from on your system?

For example 'sys-libs/libtermcap-compat' should install only versioned 'libtermcap.so.<number>'
Comment 7 OKUMURA N. Shin-ya 2020-11-04 00:06:18 UTC
Sergei, your sight was right, thank you.

My box had /usr/lib64/libtermcap.so, that might be added by hand to compile some local software (but I don't remember what's that now...).

$ locate libtermcap.so
/usr/lib64/libtermcap.so
/usr/lib64/libtermcap.so.2
/usr/lib64/libtermcap.so.2.0.8
$ equery b libtermcap.so
 * Searching for libtermcap.so ... 
$

emerge =sys-devel/gdb-10.1 works after removing /usr/lib64/libtremcap.so.
Comment 8 Sergei Trofimovich (RETIRED) gentoo-dev 2020-11-04 00:17:04 UTC
Yeah, adding symlinks manually would do it.

Let's close it as INVALID. Ideally software should be tweaked to use ncurses instead of termcap.