[lldb-dev] [Bug 24693] New: liblldb.so link failure due to missing -ltinfo flag on systems with split ncurses/tinfo

via lldb-dev lldb-dev at lists.llvm.org
Thu Sep 3 07:15:33 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=24693

            Bug ID: 24693
           Summary: liblldb.so link failure due to missing -ltinfo flag on
                    systems with split ncurses/tinfo
           Product: lldb
           Version: 3.7
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at lists.llvm.org
          Reporter: jeremip at protonmail.ch
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 14832
  --> https://llvm.org/bugs/attachment.cgi?id=14832&action=edit
patch to LLDBDependencies.cmake to pull in libtinfo if necessary.

Some systems come with ncurses split into two libraries, libncurses and
libtinfo, with symbols divided between the two. This is achieved through the
`--with-termlib` configure flag passed to the ncurses configure script. This is
correctly handled in the main llvm cmake scripts (cmake/config-ix.cmake:119)
but the lldb one links to only libncurses which results in link failure on such
systems with undefined references to:

    acs_map
    stdscr
    halfdelay
    curs_set
    keypad

These symbols are found in libtinfo.so:

    $ nm -D libncurses.so.5.9 | grep -E
'acs_map|stdscr|halfdelay|curs_set|keypad'
                     U acs_map
                     U curs_set
    000000000000c780 T is_keypad
                     U _nc_keypad
                     U stdscr
    $ nm -D libtinfo.so.5.9 | grep -E
'acs_map|stdscr|halfdelay|curs_set|keypad'
    0000000000234a80 B acs_map
    0000000000011b60 T curs_set
    00000000000119b0 T halfdelay
    0000000000011ce0 T keypad
    0000000000011c50 T _nc_keypad
    0000000000234eb0 B stdscr


The _correct_ way to handle this would be to use pkg-config within cmake which
knows which libraries are needed

    $ pkg-config ncurses --libs
    -lncurses -ltinfo 

but since llvm doesn't seem to rely on pkg-config, an alternative (for which I
provide a patch) is to piggyback on what is done within llvm cmake already.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20150903/e97b6029/attachment-0001.html>


More information about the lldb-dev mailing list