Don't overlink with libxml2's dependencies.
--- a/acinclude.m4	2019-01-09 03:54:13.000000000 -0600
+++ b/acinclude.m4	2024-01-10 10:55:20.000000000 -0600
@@ -2549,7 +2549,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	2019-01-09 04:25:58.000000000 -0600
+++ b/configure	2024-01-10 10:55:20.000000000 -0600
@@ -23127,7 +23127,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
@@ -34954,7 +34954,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
@@ -84375,7 +84375,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
@@ -85907,7 +85907,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
@@ -95664,7 +95664,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
@@ -96511,7 +96511,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
@@ -97301,7 +97301,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
@@ -98015,7 +98015,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
@@ -100339,7 +100339,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
