[PATCH] D129662: [Proof of concept] Add an opt-in way to statically link a hermetic libxml2

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 13 09:44:26 PDT 2022


thakis created this revision.
thakis added a reviewer: hans.
Herald added subscribers: hiraditya, mgorny.
Herald added a project: All.
thakis requested review of this revision.
Herald added a project: LLVM.

When LLVM_ENABLE_LIBXML2 is set to HERMETIC, we now download libxml2
at cmake time, build it at build time, and statically link to it
in llvm-mt.

This reverts https://reviews.llvm.org/D129571 and uses
LLVM_ENABLE_LIBXML2=HERMETIC instead for the Windows installer.

---

This works for llvm-mt, but c-index-test and lldb also pick up the hermetic libxml2, and since the built libxml2 is so minimal, fail to link.

But even if that worked, I'm not sure if this is worth it. It looks kind of janky: The external project build step runs on every build; every target depending on libxml needs some extra code to force the install step to run, cmake is a bit temperamental about this, and so on. Maybe this isn't all that much easier than what D129571 <https://reviews.llvm.org/D129571> did.

Or maybe there's a better way for doing this that I can't see.

Maybe this should be WindowsManifest-specific and WindowsManifest should optionally depend on the hermetic stuff, and HermeticLibXML2.cmake shouldn't try to pretend its find_package()-compatible. Then lldb and c-index-test wouldn't pick up the hermetic lib.

I've spent more time on this than I should've, so uploading as-is. Maybe someone has an opinion on this.


https://reviews.llvm.org/D129662

Files:
  llvm/CMakeLists.txt
  llvm/cmake/config-ix.cmake
  llvm/cmake/modules/HermeticLibXML2.cmake
  llvm/lib/WindowsManifest/CMakeLists.txt
  llvm/utils/release/build_llvm_release.bat

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129662.444310.patch
Type: text/x-patch
Size: 11265 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220713/072d397a/attachment.bin>


More information about the llvm-commits mailing list