[cmake] Explicitly link dependency libraries in the Host library

Add explicit linkage to the necessary system libraries in the Host
library. Otherwise, the library fails to build with -Wl,--as-needed.
The system libraries ended up being listed on the linker command-line
before the static libraries needing them, resulting in --as-needed
stripping them.

Listing the dependent libraries explicitly is the canonical way of
declaring libraries in CMake. It guarantees that the system library
dependencies will be correctly propagated to reverse dependencies.

The code used to link libraries reuses existing EXTRA_LIBS variable,
copying code from other parts of LLDB. We might eventually remove
the direct use of system libraries in the programs; however, I would
prefer if we focused on fixing the build regressions in 5.0 branch
first, and went further after the release.

Differential Revision: https://reviews.llvm.org/D36885

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@311354 91177308-0d34-0410-b5e6-96231b3b80d8
1 file changed