This is an archive of the discontinued LLVM Phabricator instance.

[lldb] [cmake] Add explicit linkage from Core to curses
ClosedPublic

Authored by mgorny on Aug 5 2017, 8:32 AM.

Details

Summary

The Core library calls functions provided by the curses library. Add
an appropriate explicit LINK_LIBS to ${CURSES_LIBRARIES} to propagate
the dependency correctly within the build system.

It seems that so far the linkage was handled by some kind of implicit
magic LLDB_SYSTEM_LIBS variable. However, it stopped working for
unittests as the curses libraries are passed before the LLDBCore
library, resulting in -Wl,--as-needed stripping the yet-unused library
before it is required by LLDBCore, and effectively breaking the build.
I think it's better to focus on listing all the dependencies explicitly
and let CMake propagate them rather than trying to figure out why this
hack stopped working.

This is also more consistent with LLVM where the curses linkage
in LLVMSupport is expressed directly in the library rather than deferred
to the final programs.

Diff Detail

Repository
rL LLVM

Event Timeline

mgorny created this revision.Aug 5 2017, 8:32 AM
mgorny updated this revision to Diff 109879.Aug 5 2017, 9:15 AM

Forgive my poor eyesight, obviously this could go into existing LINK_LIBS ;-).

mgorny updated this revision to Diff 109897.Aug 5 2017, 1:49 PM
mgorny edited the summary of this revision. (Show Details)

Updated to explicitly respect LLDB_DISABLE_CURSES and the LLVM HAVE_TERMINFO logic.

zturner accepted this revision.Aug 15 2017, 11:54 AM
This revision is now accepted and ready to land.Aug 15 2017, 11:54 AM
This revision was automatically updated to reflect the committed changes.