[php-src] Issue #15534: Build with libxml2 versions 2.9.0 to 2.9.3 fails
| From: | petk | Date: | Wed, 21 Aug 2024 23:32:59 +0000 |
| Subject: | [php-src] Issue #15534: Build with libxml2 versions 2.9.0 to 2.9.3 fails | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-247571@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/15534
Author: petk
### Description
The following code:
```php
./buildconf
./configure
make
```
Resulted in this output:
```
In file included from /libxml2.9.3/usr/local/include/libxml2/libxml/tree.h:333,
from /libxml2.9.3/usr/local/include/libxml2/libxml/dict.h:16,
from /php-src/ext/dom/lexbor/lexbor/selectors-adapted/selectors.c:10:
/libxml2.9.3/usr/local/include/libxml2/libxml/xmlregexp.h:123:42: error: unknown type name
‘xmlDictPtr’
123 | xmlDictPtr dict);
| ^~~~~~~~~~
In file included from /libxml2.9.3/usr/local/include/libxml2/libxml/parser.h:18,
from /libxml2.9.3/usr/local/include/libxml2/libxml/globals.h:18,
from /libxml2.9.3/usr/local/include/libxml2/libxml/threads.h:35,
from /libxml2.9.3/usr/local/include/libxml2/libxml/xmlmemory.h:218,
from /libxml2.9.3/usr/local/include/libxml2/libxml/tree.h:1307:
/libxml2.9.3/usr/local/include/libxml2/libxml/hash.h:110:42: error: unknown type name
‘xmlDictPtr’; did you mean ‘xmlDocPtr’?
110 | xmlDictPtr dict);
| ^~~~~~~~~~
| xmlDocPtr
/libxml2.9.3/usr/local/include/libxml2/libxml/parser.h:263:5: error: unknown type name
‘xmlDictPtr’
263 | xmlDictPtr dict; /* dictionnary for the parser */
| ^~~~~~~~~~
```
But I expected this output instead:
```
Successful build
```
There seems to be a change done in libxml2 2.9.4 version in
<libxml/dict.h> file
where the xmlDictPtr type was added before other includes so the
<libxml/dict.h> can be included directly. In PHP 8.3 it works ok. PHP 8.4 with
libxml2 2.9.4 also works ok. Perhaps some more includes need to be done before dict.h?
### PHP Version
PHP 8.4
### Operating System
Linux