Don't overlink with libxml2's dependencies.
--- a/acinclude.m4	2010-05-05 16:55:44.000000000 -0500
+++ b/acinclude.m4	2024-01-10 11:04:49.000000000 -0600
@@ -2523,7 +2523,7 @@
     IFS=$ac_IFS
     LIBXML_VERSION=`expr [$]1 \* 1000000 + [$]2 \* 1000 + [$]3`
     if test "$LIBXML_VERSION" -ge "2006011"; then
-      LIBXML_LIBS=`$XML2_CONFIG --libs`
+      LIBXML_LIBS=`$XML2_CONFIG --libs --dynamic`
       LIBXML_INCS=`$XML2_CONFIG --cflags`
       PHP_EVAL_LIBLINE($LIBXML_LIBS, $1)
       PHP_EVAL_INCLINE($LIBXML_INCS)
--- a/configure	2011-01-06 17:04:43.000000000 -0600
+++ b/configure	2024-01-10 11:05:29.000000000 -0600
@@ -20569,7 +20569,7 @@
     IFS=$ac_IFS
     LIBXML_VERSION=`expr $1 \* 1000000 + $2 \* 1000 + $3`
     if test "$LIBXML_VERSION" -ge "2006011"; then
-      LIBXML_LIBS=`$XML2_CONFIG --libs`
+      LIBXML_LIBS=`$XML2_CONFIG --libs --dynamic`
       LIBXML_INCS=`$XML2_CONFIG --cflags`
       
   for ac_i in $LIBXML_LIBS; do
@@ -31337,7 +31337,7 @@
     IFS=$ac_IFS
     LIBXML_VERSION=`expr $1 \* 1000000 + $2 \* 1000 + $3`
     if test "$LIBXML_VERSION" -ge "2006011"; then
-      LIBXML_LIBS=`$XML2_CONFIG --libs`
+      LIBXML_LIBS=`$XML2_CONFIG --libs --dynamic`
       LIBXML_INCS=`$XML2_CONFIG --cflags`
       
   for ac_i in $LIBXML_LIBS; do
@@ -87068,7 +87068,7 @@
     IFS=$ac_IFS
     LIBXML_VERSION=`expr $1 \* 1000000 + $2 \* 1000 + $3`
     if test "$LIBXML_VERSION" -ge "2006011"; then
-      LIBXML_LIBS=`$XML2_CONFIG --libs`
+      LIBXML_LIBS=`$XML2_CONFIG --libs --dynamic`
       LIBXML_INCS=`$XML2_CONFIG --cflags`
       
   for ac_i in $LIBXML_LIBS; do
@@ -89596,7 +89596,7 @@
     IFS=$ac_IFS
     LIBXML_VERSION=`expr $1 \* 1000000 + $2 \* 1000 + $3`
     if test "$LIBXML_VERSION" -ge "2006011"; then
-      LIBXML_LIBS=`$XML2_CONFIG --libs`
+      LIBXML_LIBS=`$XML2_CONFIG --libs --dynamic`
       LIBXML_INCS=`$XML2_CONFIG --cflags`
       
   for ac_i in $LIBXML_LIBS; do
@@ -100602,7 +100602,7 @@
     IFS=$ac_IFS
     LIBXML_VERSION=`expr $1 \* 1000000 + $2 \* 1000 + $3`
     if test "$LIBXML_VERSION" -ge "2006011"; then
-      LIBXML_LIBS=`$XML2_CONFIG --libs`
+      LIBXML_LIBS=`$XML2_CONFIG --libs --dynamic`
       LIBXML_INCS=`$XML2_CONFIG --cflags`
       
   for ac_i in $LIBXML_LIBS; do
@@ -101461,7 +101461,7 @@
     IFS=$ac_IFS
     LIBXML_VERSION=`expr $1 \* 1000000 + $2 \* 1000 + $3`
     if test "$LIBXML_VERSION" -ge "2006011"; then
-      LIBXML_LIBS=`$XML2_CONFIG --libs`
+      LIBXML_LIBS=`$XML2_CONFIG --libs --dynamic`
       LIBXML_INCS=`$XML2_CONFIG --cflags`
       
   for ac_i in $LIBXML_LIBS; do
@@ -102261,7 +102261,7 @@
     IFS=$ac_IFS
     LIBXML_VERSION=`expr $1 \* 1000000 + $2 \* 1000 + $3`
     if test "$LIBXML_VERSION" -ge "2006011"; then
-      LIBXML_LIBS=`$XML2_CONFIG --libs`
+      LIBXML_LIBS=`$XML2_CONFIG --libs --dynamic`
       LIBXML_INCS=`$XML2_CONFIG --cflags`
       
   for ac_i in $LIBXML_LIBS; do
@@ -102988,7 +102988,7 @@
     IFS=$ac_IFS
     LIBXML_VERSION=`expr $1 \* 1000000 + $2 \* 1000 + $3`
     if test "$LIBXML_VERSION" -ge "2006011"; then
-      LIBXML_LIBS=`$XML2_CONFIG --libs`
+      LIBXML_LIBS=`$XML2_CONFIG --libs --dynamic`
       LIBXML_INCS=`$XML2_CONFIG --cflags`
       
   for ac_i in $LIBXML_LIBS; do
@@ -105447,7 +105447,7 @@
     IFS=$ac_IFS
     LIBXML_VERSION=`expr $1 \* 1000000 + $2 \* 1000 + $3`
     if test "$LIBXML_VERSION" -ge "2006011"; then
-      LIBXML_LIBS=`$XML2_CONFIG --libs`
+      LIBXML_LIBS=`$XML2_CONFIG --libs --dynamic`
       LIBXML_INCS=`$XML2_CONFIG --cflags`
       
   for ac_i in $LIBXML_LIBS; do
