Skip to content

Build failure with libxml2 v2.13.0 #14563

Closed

Description

@nono303

Description

Build failed when linked to libxml2 v2.13.0

Resulted in this output:

php8.dll.def : error LNK2001: unresolved external symbol xmlErrMemory
C:\sdk\src\php-sdk\phpmaster\vs17\x64\build\Release\php8.lib : fatal error LNK1120: 1 unresolved externals

According to this change in libxml2: GNOME/libxml2@1304369 here is the corresponding patch for a working build

diff --git "a/ext/libxml/php_libxml2.def" "b/ext/libxml/php_libxml2.def"
index 5980df8bf8..c4eac9761c 100644
--- "a/ext/libxml/php_libxml2.def"
+++ "b/ext/libxml/php_libxml2.def"
@@ -345,7 +345,7 @@ xmlElemDump
 xmlEncodeEntities
 xmlEncodeEntitiesReentrant
 xmlEncodeSpecialChars
-xmlErrMemory
+xmlCtxtErr
 xmlFileClose
 xmlFileMatch
 xmlFileOpen

Build context:

  • php-src: 8.3.8 (from git tag)
  • libxml2 : 2.13.0 (from git tag)
  • MSVC (Windows) 14.40 x64

PHP Version

PHP 8.3.8

Operating System

Windows

Activity

  1. ndossche commented on Jun 13, 2024

    @ndossche
    Member

    Your patch is right, but please keep the file contents sorted alphabetically. Feel free to submit a PR.
    EDIT: actually, that won't work because now the build would fail on older libxml versions...

  2. nono303 commented on Jun 14, 2024

    @nono303
    ContributorAuthor

    actually, that won't work because now the build would fail on older libxml versions...

    That's why I just opened an issue - not a PR - because I don't know how to manage the switch between libxml version on def files.

  3. ndossche commented on Jun 29, 2024

    @ndossche
    Member

    The best solution to this is just removing the offending line I think. That would allow both old and new libxml versions to work. We can only do that on master though for BC reasons. I'll get a PR done.
    EDIT: actually that might not be a BC break because the symbol is supposed to be hidden anyway.

  4. added a commit that references this issue on Jun 29, 2024
    f9f3813
  5. added 3 commits that reference this issue on Jun 29, 2024
    b63b100
    de8b13f
    b08def5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions