fix lldb-gdbserver and lldb-platform linking on RHEL 6

This if fix for bug 23774.

Trunk CMake files were changed and fix should be applied to
tools/lldb-server/CMakeLists.txt.

Patch by: Eugene Zelenko


git-svn-id: https://llvm.org/svn/llvm-project/lldb/branches/release_36@240421 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/lldb-gdbserver/CMakeLists.txt b/tools/lldb-gdbserver/CMakeLists.txt
index 1dc2e1c..af31400 100644
--- a/tools/lldb-gdbserver/CMakeLists.txt
+++ b/tools/lldb-gdbserver/CMakeLists.txt
@@ -28,10 +28,12 @@
 if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
   target_link_libraries(lldb-gdbserver
                         -Wl,--start-group ${LLDB_USED_LIBS} -Wl,--end-group)
+  target_link_libraries(lldb-gdbserver
+                        -Wl,--start-group ${CLANG_USED_LIBS} -Wl,--end-group)
 else()
   target_link_libraries(lldb-gdbserver ${LLDB_USED_LIBS})
+  target_link_libraries(lldb-gdbserver ${CLANG_USED_LIBS})
 endif()
-target_link_libraries(lldb-gdbserver ${CLANG_USED_LIBS})
 llvm_config(lldb-gdbserver ${LLVM_LINK_COMPONENTS})
 
 target_link_libraries(lldb-gdbserver ${LLDB_SYSTEM_LIBS})
diff --git a/tools/lldb-platform/CMakeLists.txt b/tools/lldb-platform/CMakeLists.txt
index d4a1e0a..f184a5f 100644
--- a/tools/lldb-platform/CMakeLists.txt
+++ b/tools/lldb-platform/CMakeLists.txt
@@ -34,10 +34,12 @@
 if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
   target_link_libraries(lldb-platform
                         -Wl,--start-group ${LLDB_USED_LIBS} -Wl,--end-group)
+  target_link_libraries(lldb-platform
+                        -Wl,--start-group ${CLANG_USED_LIBS} -Wl,--end-group)
 else()
   target_link_libraries(lldb-platform ${LLDB_USED_LIBS})
+  target_link_libraries(lldb-platform ${CLANG_USED_LIBS})
 endif()
-target_link_libraries(lldb-platform ${CLANG_USED_LIBS})
 llvm_config(lldb-platform ${LLVM_LINK_COMPONENTS})
 
 target_link_libraries(lldb-platform ${LLDB_SYSTEM_LIBS})