[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failure with libxml2 v2.13.0 #14563

Closed
nono303 opened this issue Jun 13, 2024 · 3 comments
Closed

Build failure with libxml2 v2.13.0 #14563

nono303 opened this issue Jun 13, 2024 · 3 comments

Comments

@nono303
Copy link
Contributor
nono303 commented Jun 13, 2024

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

@nielsdos
Copy link
Member
nielsdos commented Jun 13, 2024

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...

@nono303
Copy link
Contributor Author
nono303 commented Jun 14, 2024

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.

nono303 pushed a commit to nono303/win-build-scripts that referenced this issue Jun 14, 2024
@nielsdos
Copy link
Member
nielsdos commented Jun 29, 2024

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.

nielsdos added a commit to nielsdos/php-src that referenced this issue Jun 29, 2024
Remove xmlErrMemory from the export section for Windows, this fixes the
build. Even though the original function was renamed [1] it is hidden,
so removing this should be sufficient and not be a BC break.

[1] GNOME/libxml2@1304369
@nielsdos nielsdos linked a pull request Jun 29, 2024 that will close this issue
nielsdos added a commit that referenced this issue Jun 29, 2024
* PHP-8.2:
  Fix GH-14563: Build failure with libxml2 v2.13.0
nielsdos added a commit that referenced this issue Jun 29, 2024
* PHP-8.3:
  Fix GH-14563: Build failure with libxml2 v2.13.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants