[Lldb-commits] [lldb] [lldb] Add build option to specify the libxml 2 version (PR #142183)
https://github.com/Steelskin updated https://github.com/llvm/llvm-project/pull/142183 >From c517ba1aa6c17de47c125468c047366117a9989a Mon Sep 17 00:00:00 2001 From: Fabrice de Gans Date: Fri, 30 May 2025 09:27:54 -0700 Subject: [PATCH 1/3] [lldb] Add build option to specify the libxml 2 version The Swift Windows toolchain uses its own static build of libxml 2, which is more recent than 2.8, resulting in the provided libxml 2 to be rejected. This change allows to specify a custom version for libxml 2, while defaulting to 2.8. --- lldb/cmake/modules/LLDBConfig.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake index cfd626c9358a1..f25ad1333468c 100644 --- a/lldb/cmake/modules/LLDBConfig.cmake +++ b/lldb/cmake/modules/LLDBConfig.cmake @@ -51,13 +51,15 @@ macro(add_optional_dependency variable description package found) message(STATUS "${description}: ${${variable}}") endmacro() +option(LLDB_LIBXML2_VERSION "Sepcify the version of libxml 2 to use with LLDB" "2.8") + add_optional_dependency(LLDB_ENABLE_SWIG "Enable SWIG to generate LLDB bindings" SWIG SWIG_FOUND VERSION 4) add_optional_dependency(LLDB_ENABLE_LIBEDIT "Enable editline support in LLDB" LibEdit LibEdit_FOUND) add_optional_dependency(LLDB_ENABLE_CURSES "Enable curses support in LLDB" CursesAndPanel CURSESANDPANEL_FOUND) add_optional_dependency(LLDB_ENABLE_LZMA "Enable LZMA compression support in LLDB" LibLZMA LIBLZMA_FOUND) add_optional_dependency(LLDB_ENABLE_LUA "Enable Lua scripting support in LLDB" LuaAndSwig LUAANDSWIG_FOUND) add_optional_dependency(LLDB_ENABLE_PYTHON "Enable Python scripting support in LLDB" PythonAndSwig PYTHONANDSWIG_FOUND) -add_optional_dependency(LLDB_ENABLE_LIBXML2 "Enable Libxml 2 support in LLDB" LibXml2 LIBXML2_FOUND VERSION 2.8) +add_optional_dependency(LLDB_ENABLE_LIBXML2 "Enable Libxml 2 support in LLDB" LibXml2 LIBXML2_FOUND VERSION ${LLDB_LIBXML2_VERSION}) add_optional_dependency(LLDB_ENABLE_FBSDVMCORE "Enable libfbsdvmcore support in LLDB" FBSDVMCore FBSDVMCore_FOUND QUIET) option(LLDB_USE_ENTITLEMENTS "When codesigning, use entitlements if available" ON) >From 95aa2490f58d68e19aa59a275aad0b2a5c0ebe68 Mon Sep 17 00:00:00 2001 From: Fabrice de Gans Date: Fri, 30 May 2025 10:13:36 -0700 Subject: [PATCH 2/3] Fix string option setting --- lldb/cmake/modules/LLDBConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake index f25ad1333468c..c73815a3eb970 100644 --- a/lldb/cmake/modules/LLDBConfig.cmake +++ b/lldb/cmake/modules/LLDBConfig.cmake @@ -51,7 +51,7 @@ macro(add_optional_dependency variable description package found) message(STATUS "${description}: ${${variable}}") endmacro() -option(LLDB_LIBXML2_VERSION "Sepcify the version of libxml 2 to use with LLDB" "2.8") +set(LLDB_LIBXML2_VERSION "2.8" CACHE STRING "Sepcify the version of libxml 2 to use with LLDB") add_optional_dependency(LLDB_ENABLE_SWIG "Enable SWIG to generate LLDB bindings" SWIG SWIG_FOUND VERSION 4) add_optional_dependency(LLDB_ENABLE_LIBEDIT "Enable editline support in LLDB" LibEdit LibEdit_FOUND) >From ef27a1f1b00474881194b642ee6586531184 Mon Sep 17 00:00:00 2001 From: Fabrice de Gans Date: Fri, 30 May 2025 11:07:52 -0700 Subject: [PATCH 3/3] Clarify comment and mark variable as advanced --- lldb/cmake/modules/LLDBConfig.cmake | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake index c73815a3eb970..e8a80292c37db 100644 --- a/lldb/cmake/modules/LLDBConfig.cmake +++ b/lldb/cmake/modules/LLDBConfig.cmake @@ -51,7 +51,10 @@ macro(add_optional_dependency variable description package found) message(STATUS "${description}: ${${variable}}") endmacro() -set(LLDB_LIBXML2_VERSION "2.8" CACHE STRING "Sepcify the version of libxml 2 to use with LLDB") +set(LLDB_LIBXML2_VERSION "2.8" CACHE STRING + "Sepcify the version of libxml 2 to use with LLDB. This is only meant to be overridden for local + static builds of libxml 2. Use at your own risk.") +mark_as_advanced(LLDB_LIBXML2_VERSION) add_optional_dependency(LLDB_ENABLE_SWIG "Enable SWIG to generate LLDB bindings" SWIG SWIG_FOUND VERSION 4) add_optional_dependency(LLDB_ENABLE_LIBEDIT "Enable editline support in LLDB" LibEdit LibEdit_FOUND) ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add build option to specify the libxml 2 version (PR #142183)
https://github.com/Steelskin created https://github.com/llvm/llvm-project/pull/142183 The Swift Windows toolchain uses its own static build of libxml 2, which is more recent than 2.8, resulting in the provided libxml 2 to be rejected. This change allows to specify a custom version for libxml 2, while defaulting to 2.8. >From c517ba1aa6c17de47c125468c047366117a9989a Mon Sep 17 00:00:00 2001 From: Fabrice de Gans Date: Fri, 30 May 2025 09:27:54 -0700 Subject: [PATCH] [lldb] Add build option to specify the libxml 2 version The Swift Windows toolchain uses its own static build of libxml 2, which is more recent than 2.8, resulting in the provided libxml 2 to be rejected. This change allows to specify a custom version for libxml 2, while defaulting to 2.8. --- lldb/cmake/modules/LLDBConfig.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake index cfd626c9358a1..f25ad1333468c 100644 --- a/lldb/cmake/modules/LLDBConfig.cmake +++ b/lldb/cmake/modules/LLDBConfig.cmake @@ -51,13 +51,15 @@ macro(add_optional_dependency variable description package found) message(STATUS "${description}: ${${variable}}") endmacro() +option(LLDB_LIBXML2_VERSION "Sepcify the version of libxml 2 to use with LLDB" "2.8") + add_optional_dependency(LLDB_ENABLE_SWIG "Enable SWIG to generate LLDB bindings" SWIG SWIG_FOUND VERSION 4) add_optional_dependency(LLDB_ENABLE_LIBEDIT "Enable editline support in LLDB" LibEdit LibEdit_FOUND) add_optional_dependency(LLDB_ENABLE_CURSES "Enable curses support in LLDB" CursesAndPanel CURSESANDPANEL_FOUND) add_optional_dependency(LLDB_ENABLE_LZMA "Enable LZMA compression support in LLDB" LibLZMA LIBLZMA_FOUND) add_optional_dependency(LLDB_ENABLE_LUA "Enable Lua scripting support in LLDB" LuaAndSwig LUAANDSWIG_FOUND) add_optional_dependency(LLDB_ENABLE_PYTHON "Enable Python scripting support in LLDB" PythonAndSwig PYTHONANDSWIG_FOUND) -add_optional_dependency(LLDB_ENABLE_LIBXML2 "Enable Libxml 2 support in LLDB" LibXml2 LIBXML2_FOUND VERSION 2.8) +add_optional_dependency(LLDB_ENABLE_LIBXML2 "Enable Libxml 2 support in LLDB" LibXml2 LIBXML2_FOUND VERSION ${LLDB_LIBXML2_VERSION}) add_optional_dependency(LLDB_ENABLE_FBSDVMCORE "Enable libfbsdvmcore support in LLDB" FBSDVMCore FBSDVMCore_FOUND QUIET) option(LLDB_USE_ENTITLEMENTS "When codesigning, use entitlements if available" ON) ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add build option to specify the libxml 2 version (PR #142183)
Steelskin wrote: This is how the version file is configured in libxml2: https://github.com/GNOME/libxml2/blob/0740a367a570c40246fe8077c2d172b63693f105/CMakeLists.txt#L596 ```cmake write_basic_package_version_file( ${CMAKE_CURRENT_BINARY_DIR}/libxml2-config-version.cmake VERSION ${PROJECT_VERSION} COMPATIBILITY ExactVersion ) ``` The problem is the `COMPATIBILITY ExactVersion` part. I have been told there are also ABI incompatibilities with different libxml 2 versions for the Swift build but I am not familiar with the details. https://github.com/llvm/llvm-project/pull/142183 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add build option to specify the libxml 2 version (PR #142183)
https://github.com/Steelskin updated https://github.com/llvm/llvm-project/pull/142183 >From c517ba1aa6c17de47c125468c047366117a9989a Mon Sep 17 00:00:00 2001 From: Fabrice de Gans Date: Fri, 30 May 2025 09:27:54 -0700 Subject: [PATCH 1/2] [lldb] Add build option to specify the libxml 2 version The Swift Windows toolchain uses its own static build of libxml 2, which is more recent than 2.8, resulting in the provided libxml 2 to be rejected. This change allows to specify a custom version for libxml 2, while defaulting to 2.8. --- lldb/cmake/modules/LLDBConfig.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake index cfd626c9358a1..f25ad1333468c 100644 --- a/lldb/cmake/modules/LLDBConfig.cmake +++ b/lldb/cmake/modules/LLDBConfig.cmake @@ -51,13 +51,15 @@ macro(add_optional_dependency variable description package found) message(STATUS "${description}: ${${variable}}") endmacro() +option(LLDB_LIBXML2_VERSION "Sepcify the version of libxml 2 to use with LLDB" "2.8") + add_optional_dependency(LLDB_ENABLE_SWIG "Enable SWIG to generate LLDB bindings" SWIG SWIG_FOUND VERSION 4) add_optional_dependency(LLDB_ENABLE_LIBEDIT "Enable editline support in LLDB" LibEdit LibEdit_FOUND) add_optional_dependency(LLDB_ENABLE_CURSES "Enable curses support in LLDB" CursesAndPanel CURSESANDPANEL_FOUND) add_optional_dependency(LLDB_ENABLE_LZMA "Enable LZMA compression support in LLDB" LibLZMA LIBLZMA_FOUND) add_optional_dependency(LLDB_ENABLE_LUA "Enable Lua scripting support in LLDB" LuaAndSwig LUAANDSWIG_FOUND) add_optional_dependency(LLDB_ENABLE_PYTHON "Enable Python scripting support in LLDB" PythonAndSwig PYTHONANDSWIG_FOUND) -add_optional_dependency(LLDB_ENABLE_LIBXML2 "Enable Libxml 2 support in LLDB" LibXml2 LIBXML2_FOUND VERSION 2.8) +add_optional_dependency(LLDB_ENABLE_LIBXML2 "Enable Libxml 2 support in LLDB" LibXml2 LIBXML2_FOUND VERSION ${LLDB_LIBXML2_VERSION}) add_optional_dependency(LLDB_ENABLE_FBSDVMCORE "Enable libfbsdvmcore support in LLDB" FBSDVMCore FBSDVMCore_FOUND QUIET) option(LLDB_USE_ENTITLEMENTS "When codesigning, use entitlements if available" ON) >From 95aa2490f58d68e19aa59a275aad0b2a5c0ebe68 Mon Sep 17 00:00:00 2001 From: Fabrice de Gans Date: Fri, 30 May 2025 10:13:36 -0700 Subject: [PATCH 2/2] Fix string option setting --- lldb/cmake/modules/LLDBConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake index f25ad1333468c..c73815a3eb970 100644 --- a/lldb/cmake/modules/LLDBConfig.cmake +++ b/lldb/cmake/modules/LLDBConfig.cmake @@ -51,7 +51,7 @@ macro(add_optional_dependency variable description package found) message(STATUS "${description}: ${${variable}}") endmacro() -option(LLDB_LIBXML2_VERSION "Sepcify the version of libxml 2 to use with LLDB" "2.8") +set(LLDB_LIBXML2_VERSION "2.8" CACHE STRING "Sepcify the version of libxml 2 to use with LLDB") add_optional_dependency(LLDB_ENABLE_SWIG "Enable SWIG to generate LLDB bindings" SWIG SWIG_FOUND VERSION 4) add_optional_dependency(LLDB_ENABLE_LIBEDIT "Enable editline support in LLDB" LibEdit LibEdit_FOUND) ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add build option to specify the libxml 2 version (PR #142183)
https://github.com/Steelskin updated https://github.com/llvm/llvm-project/pull/142183 >From c517ba1aa6c17de47c125468c047366117a9989a Mon Sep 17 00:00:00 2001 From: Fabrice de Gans Date: Fri, 30 May 2025 09:27:54 -0700 Subject: [PATCH 1/4] [lldb] Add build option to specify the libxml 2 version The Swift Windows toolchain uses its own static build of libxml 2, which is more recent than 2.8, resulting in the provided libxml 2 to be rejected. This change allows to specify a custom version for libxml 2, while defaulting to 2.8. --- lldb/cmake/modules/LLDBConfig.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake index cfd626c9358a1..f25ad1333468c 100644 --- a/lldb/cmake/modules/LLDBConfig.cmake +++ b/lldb/cmake/modules/LLDBConfig.cmake @@ -51,13 +51,15 @@ macro(add_optional_dependency variable description package found) message(STATUS "${description}: ${${variable}}") endmacro() +option(LLDB_LIBXML2_VERSION "Sepcify the version of libxml 2 to use with LLDB" "2.8") + add_optional_dependency(LLDB_ENABLE_SWIG "Enable SWIG to generate LLDB bindings" SWIG SWIG_FOUND VERSION 4) add_optional_dependency(LLDB_ENABLE_LIBEDIT "Enable editline support in LLDB" LibEdit LibEdit_FOUND) add_optional_dependency(LLDB_ENABLE_CURSES "Enable curses support in LLDB" CursesAndPanel CURSESANDPANEL_FOUND) add_optional_dependency(LLDB_ENABLE_LZMA "Enable LZMA compression support in LLDB" LibLZMA LIBLZMA_FOUND) add_optional_dependency(LLDB_ENABLE_LUA "Enable Lua scripting support in LLDB" LuaAndSwig LUAANDSWIG_FOUND) add_optional_dependency(LLDB_ENABLE_PYTHON "Enable Python scripting support in LLDB" PythonAndSwig PYTHONANDSWIG_FOUND) -add_optional_dependency(LLDB_ENABLE_LIBXML2 "Enable Libxml 2 support in LLDB" LibXml2 LIBXML2_FOUND VERSION 2.8) +add_optional_dependency(LLDB_ENABLE_LIBXML2 "Enable Libxml 2 support in LLDB" LibXml2 LIBXML2_FOUND VERSION ${LLDB_LIBXML2_VERSION}) add_optional_dependency(LLDB_ENABLE_FBSDVMCORE "Enable libfbsdvmcore support in LLDB" FBSDVMCore FBSDVMCore_FOUND QUIET) option(LLDB_USE_ENTITLEMENTS "When codesigning, use entitlements if available" ON) >From 95aa2490f58d68e19aa59a275aad0b2a5c0ebe68 Mon Sep 17 00:00:00 2001 From: Fabrice de Gans Date: Fri, 30 May 2025 10:13:36 -0700 Subject: [PATCH 2/4] Fix string option setting --- lldb/cmake/modules/LLDBConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake index f25ad1333468c..c73815a3eb970 100644 --- a/lldb/cmake/modules/LLDBConfig.cmake +++ b/lldb/cmake/modules/LLDBConfig.cmake @@ -51,7 +51,7 @@ macro(add_optional_dependency variable description package found) message(STATUS "${description}: ${${variable}}") endmacro() -option(LLDB_LIBXML2_VERSION "Sepcify the version of libxml 2 to use with LLDB" "2.8") +set(LLDB_LIBXML2_VERSION "2.8" CACHE STRING "Sepcify the version of libxml 2 to use with LLDB") add_optional_dependency(LLDB_ENABLE_SWIG "Enable SWIG to generate LLDB bindings" SWIG SWIG_FOUND VERSION 4) add_optional_dependency(LLDB_ENABLE_LIBEDIT "Enable editline support in LLDB" LibEdit LibEdit_FOUND) >From ef27a1f1b00474881194b642ee6586531184 Mon Sep 17 00:00:00 2001 From: Fabrice de Gans Date: Fri, 30 May 2025 11:07:52 -0700 Subject: [PATCH 3/4] Clarify comment and mark variable as advanced --- lldb/cmake/modules/LLDBConfig.cmake | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake index c73815a3eb970..e8a80292c37db 100644 --- a/lldb/cmake/modules/LLDBConfig.cmake +++ b/lldb/cmake/modules/LLDBConfig.cmake @@ -51,7 +51,10 @@ macro(add_optional_dependency variable description package found) message(STATUS "${description}: ${${variable}}") endmacro() -set(LLDB_LIBXML2_VERSION "2.8" CACHE STRING "Sepcify the version of libxml 2 to use with LLDB") +set(LLDB_LIBXML2_VERSION "2.8" CACHE STRING + "Sepcify the version of libxml 2 to use with LLDB. This is only meant to be overridden for local + static builds of libxml 2. Use at your own risk.") +mark_as_advanced(LLDB_LIBXML2_VERSION) add_optional_dependency(LLDB_ENABLE_SWIG "Enable SWIG to generate LLDB bindings" SWIG SWIG_FOUND VERSION 4) add_optional_dependency(LLDB_ENABLE_LIBEDIT "Enable editline support in LLDB" LibEdit LibEdit_FOUND) >From d51be3e18093117c04094f175de2d42c3097d86b Mon Sep 17 00:00:00 2001 From: Fabrice de Gans Date: Fri, 30 May 2025 11:16:38 -0700 Subject: [PATCH 4/4] fix typo --- lldb/cmake/modules/LLDBConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake index e8a80292c37db..37b823feb584b 100644 --- a/lldb/cmake/modules/LLDBConfig.cmake +++ b/lldb/cmake/modules/LLDBConfig.cmake @@ -52,7 +52,7 @@ macro(add_optional_depe
[Lldb-commits] [lldb] [lldb] Add build option to specify the libxml 2 version (PR #142183)
@@ -51,13 +51,18 @@ macro(add_optional_dependency variable description package found) message(STATUS "${description}: ${${variable}}") endmacro() +set(LLDB_LIBXML2_VERSION "2.8" CACHE STRING + "Sepcify the version of libxml 2 to use with LLDB. This is only meant to be overridden for local Steelskin wrote: Doh, fixed. https://github.com/llvm/llvm-project/pull/142183 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add build option to specify the libxml 2 version (PR #142183)
Steelskin wrote: > Ack. My apt package doesn't install `libxml2-config-version.cmake` so I > assume CMake is falling back on some standard logic for finding it and that > would explain why CMake is happy to use 2.12 on my system. > > That said, it seems like this is done intentionally, and this is working > around that (e.g. the ABI incompatibility you mentioned). That might be fine > for how we use `libxml2` in lldb but let's make it clear that folks are doing > this at their own risk. Can you update the description or add a comment with > something along those lines? I updated the comment and marked the new cache variable as advanced. https://github.com/llvm/llvm-project/pull/142183 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits