From aef0b9bebb96791c71343f64c10365d43ed38d8a Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Sun, 1 Sep 2024 08:53:54 +0200 Subject: [PATCH 1/2] Autotools: Fix iconv shared build with external library When building: ./configure --with-iconv=shared,/path/to/libiconv the iconv couldn't be found due to linker error Autoconf places LDFLAGS before the conftest.c file in the test compile command and LIBS after it. GCC also requires this. Similar issue discovered at https://github.com/remicollet/php-xpass/pull/1 --- ext/iconv/config.m4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/iconv/config.m4 b/ext/iconv/config.m4 index de76ea9e53008..4d0dc36489833 100644 --- a/ext/iconv/config.m4 +++ b/ext/iconv/config.m4 @@ -8,9 +8,9 @@ if test "$PHP_ICONV" != "no"; then PHP_SETUP_ICONV([ICONV_SHARED_LIBADD],, [AC_MSG_FAILURE([The iconv not found.])]) - save_LDFLAGS=$LDFLAGS + save_LIBS=$LIBS save_CFLAGS=$CFLAGS - LDFLAGS="$ICONV_SHARED_LIBADD $LDFLAGS" + LIBS="$LIBS $ICONV_SHARED_LIBADD" CFLAGS="$INCLUDES $CFLAGS" AC_CACHE_CHECK([for iconv implementation], [php_cv_iconv_implementation], [ @@ -111,7 +111,7 @@ int main(void) { [AC_DEFINE([ICONV_BROKEN_IGNORE], [1], [Define to 1 if iconv has broken IGNORE.])]) - LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS CFLAGS=$save_CFLAGS AC_DEFINE([HAVE_ICONV], [1], From 1fd69169b696b5dabe39bd5c0135998cae7dff2b Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Sun, 1 Sep 2024 22:04:41 +0200 Subject: [PATCH 2/2] [skip ci] Add NEWS note --- NEWS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS b/NEWS index 3488723b8a43b..91d18be9d66f8 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,8 @@ PHP NEWS . Fixed bug GH-15330 (Do not scan generator frames more than once). (Arnaud) . Fixed bug GH-15644 (Asymmetric visibility doesn't work with hooks). (ilutov) . Implemented lazy objects RFC. (Arnaud) + . Fixed bug GH-15686 (Building shared iconv with external iconv library). + (Peter Kokot, zeriyoshi) - DOM: . Fixed bug GH-13988 (Storing DOMElement consume 4 times more memory in