<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - liblldb.so link failure due to missing -ltinfo flag on systems with split ncurses/tinfo"
   href="https://llvm.org/bugs/show_bug.cgi?id=24693">24693</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>liblldb.so link failure due to missing -ltinfo flag on systems with split ncurses/tinfo
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lldb
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.7
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>lldb-dev@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>jeremip@protonmail.ch
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=14832" name="attach_14832" title="patch to LLDBDependencies.cmake to pull in libtinfo if necessary.">attachment 14832</a> <a href="attachment.cgi?id=14832&action=edit" title="patch to LLDBDependencies.cmake to pull in libtinfo if necessary.">[details]</a></span>
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.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>