summaryrefslogtreecommitdiffstats
path: root/recipes-devtools/clang/clang/0014-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch
blob: 980af364109da3cf0f3326140a446bb23cd57cf2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From 392b59a684640eb000dbc4f89dcec44f8e3b4600 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 22 May 2017 17:36:16 -0700
Subject: [PATCH 14/18] lldb: Add -lxml2 to linker cmdline of xml is found

When cross compiling for systems where static libs
for libxml are not available cmake's detection mechanism
resort to linking with libxml.so but doesnt use -lxml2
liblldbHost.a however requires libxml on linker
cmdline _after_ itself so its use of symbols from libxml2
can be resolved. Here check for libxml2 being detected and
add it if its found.

Fixes

| ../../../../lib/liblldbHost.a(XML.cpp.o): In function `lldb_private::XMLDocument::Clear()':
| /usr/src/debug/lldb/5.0.0+gitAUTOINC+69edad7913_08d6b47db9_cf6c5b3386-r0/git/tools/lldb/source/Host/common/XML.cpp:29: undefined reference to `xmlFreeDoc'
| /usr/src/debug/lldb/5.0.0+gitAUTOINC+69edad7913_08d6b47db9_cf6c5b3386-r0/git/tools/lldb/source/Host/common/XML.cpp:29: undefined reference to `xmlFreeDoc'

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 lldb/source/Host/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lldb/source/Host/CMakeLists.txt b/lldb/source/Host/CMakeLists.txt
index 333f109a9a2..a5237c4b779 100644
--- a/lldb/source/Host/CMakeLists.txt
+++ b/lldb/source/Host/CMakeLists.txt
@@ -148,7 +148,7 @@ if (APPLE)
   list(APPEND EXTRA_LIBS xml2)
 else ()
   if (LIBXML2_FOUND)
-    list(APPEND EXTRA_LIBS ${LIBXML2_LIBRARIES})
+    list(APPEND EXTRA_LIBS xml2)
   endif()
 endif ()
 if (HAVE_LIBDL)
-- 
2.20.1