Skip to content

ext/libxml: Fix build failure with libxml2 2.15.#22755

Open
devnexen wants to merge 2 commits into
php:PHP-8.4from
devnexen:gh22752
Open

ext/libxml: Fix build failure with libxml2 2.15.#22755
devnexen wants to merge 2 commits into
php:PHP-8.4from
devnexen:gh22752

Conversation

@devnexen

Copy link
Copy Markdown
Member

Fix GH-22752

libxml2 2.15 removed the built-in HTTP client, the FTP module, the functions in xmlunicode.h, the shell and several other legacy symbols. The Windows export list php_libxml2.def still referenced them, so the statically linked build failed with hundreds of unresolved external symbols.

Move the removed symbols into a separate php_libxml2_legacy.def and add it only when building against libxml2 < 2.15, keeping the exports intact for 2.11 through 2.14.

Fix phpGH-22752

libxml2 2.15 removed the built-in HTTP client, the FTP module, the
functions in xmlunicode.h, the shell and several other legacy symbols.
The Windows export list php_libxml2.def still referenced them, so the
statically linked build failed with hundreds of unresolved external
symbols.

Move the removed symbols into a separate php_libxml2_legacy.def and add
it only when building against libxml2 < 2.15, keeping the exports intact
for 2.11 through 2.14.
@devnexen devnexen marked this pull request as ready for review July 15, 2026 21:08
@devnexen devnexen requested a review from petk July 15, 2026 21:08
@shivammathur

Copy link
Copy Markdown
Member

@devnexen

I think we should keep the existing export file intact as php_libxml2_legacy.def and make php_libxml2.def the clean libxml2 2.15+ export list selecting one or the other instead of appending, that will be easier to review.

This still leaves several removed symbols in the 2.15 path and the build fails. See logs.

Alternatively, it might be a good idea to remove the def files completely for libxml2. That might require xsl and soap extensions to link directly with libxml2.

The first attempt left 85 removed symbols in the 2.15 export list, so
the link still failed: the SAX1 callbacks, the legacy.h helpers, the
global accessors and the xmlIOFTP/xmlLs helpers were all missed.
Windows CI reported the full set (LNK1120: 85 unresolved).

Keep php_libxml2_legacy.def as the original export list, unchanged, and
make php_libxml2.def the clean 2.15+ list, selecting one or the other
rather than appending the two, which is easier to review.

Suggested by shivammathur.
@devnexen

Copy link
Copy Markdown
Member Author

I think that removing .def seems to belong to master branch but I agree otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants