0001-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. From 5dacb904357c6474808aa0ee44615168d4f2da39 Mon Sep 17 00:00:00 2001
  2. From: Jun Yuan Tan <junyuan.tan@starfivetech.com>
  3. Date: Tue, 9 Nov 2021 09:56:36 +0800
  4. Subject: [PATCH 01/34] lldb: Add -lxml2 to linker cmdline of xml is found
  5. When cross compiling for systems where static libs
  6. for libxml are not available cmake's detection mechanism
  7. resort to linking with libxml.so but doesnt use -lxml2
  8. liblldbHost.a however requires libxml on linker
  9. cmdline _after_ itself so its use of symbols from libxml2
  10. can be resolved. Here check for libxml2 being detected and
  11. add it if its found.
  12. Fixes
  13. | ../../../../lib/liblldbHost.a(XML.cpp.o): In function `lldb_private::XMLDocument::Clear()':
  14. | /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'
  15. | /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'
  16. Rebased to 14.0.0 by Jun Yuan Tan
  17. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  18. Signed-off-by: Jun Yuan Tan <junyuan.tan@starfivetech.com>
  19. ---
  20. lldb/source/Host/CMakeLists.txt | 2 +-
  21. 1 file changed, 1 insertion(+), 1 deletion(-)
  22. diff --git a/lldb/source/Host/CMakeLists.txt b/lldb/source/Host/CMakeLists.txt
  23. index a018fd6c183d..936bdd461350 100644
  24. --- a/lldb/source/Host/CMakeLists.txt
  25. +++ b/lldb/source/Host/CMakeLists.txt
  26. @@ -137,7 +137,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
  27. list(APPEND EXTRA_LIBS kvm)
  28. endif()
  29. if (LLDB_ENABLE_LIBXML2)
  30. - list(APPEND EXTRA_LIBS ${LIBXML2_LIBRARIES})
  31. + list(APPEND EXTRA_LIBS xml2)
  32. endif()
  33. if (HAVE_LIBDL)
  34. list(APPEND EXTRA_LIBS ${CMAKE_DL_LIBS})
  35. --
  36. 2.33.1