This is an automated email from the ASF dual-hosted git repository.
jimjag pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/AOO42X by this push:
new 93b8026614 libxml2: build --without-iconv, and drop the resulting
-liconv linkage
93b8026614 is described below
commit 93b8026614f5d70f8783b249285a4f981e9b309e
Author: Jim Jagielski <[email protected]>
AuthorDate: Thu Aug 6 19:53:11 2026 -0400
libxml2: build --without-iconv, and drop the resulting -liconv linkage
No OpenOffice code calls iconv, and libxml2-configure.patch has always
meant to disable it -- but it patches the generated xmlversion.h, which
configure regenerates, so it never took effect. Windows already passed
iconv=no.
--with-static-system-libs=libiconv stays, for a system libxml2 whose own
build enabled iconv and whose xml2-config therefore reports -liconv.
---
main/RepositoryExternal.mk | 16 +++-------------
main/configure.ac | 12 ++++--------
main/libxml2/makefile.mk | 14 ++++++++++----
main/set_soenv.in | 2 --
main/solenv/inc/libs.mk | 9 ++-------
5 files changed, 19 insertions(+), 34 deletions(-)
diff --git a/main/RepositoryExternal.mk b/main/RepositoryExternal.mk
index a8b4216f04..eb937a75ed 100644
--- a/main/RepositoryExternal.mk
+++ b/main/RepositoryExternal.mk
@@ -158,22 +158,12 @@ ifeq ($(OS),MACOSX)
# Bundled libxml2 builds as a static archive on macOS
(main/libxml2/makefile.mk),
# not a dylib, so it can't be a PLAINLIB like the else-branch below. A static
-# archive carries no transitive deps, so its own libxml-2.0.pc's
-# "Libs.private: -lpthread -liconv -lm" must be added explicitly.
-#
-# --with-static-system-libs=libiconv:DIR pins iconv to that archive; the SDK
-# ships only a .tbd stub for the dylib, so there is no system libiconv.a to
-# fall back on.
-ifeq ($(STATIC_SYSTEM_LIBICONV),YES)
-gb_libiconv_lib := $(LIBICONV_PREFIX)/lib/libiconv.a
-else
-gb_libiconv_lib := -liconv
-endif
-
+# archive carries no transitive deps, so its own libxml-2.0.pc's Libs.private
+# must be added explicitly. It is built --without-iconv, so no -liconv here.
define gb_LinkTarget__use_libxml2
$(call gb_LinkTarget_add_libs,$(1),\
$(OUTDIR)/lib/libxml2.a \
- -lpthread $(gb_libiconv_lib) -lm \
+ -lpthread -lm \
)
endef
diff --git a/main/configure.ac b/main/configure.ac
index 1aa6a311bb..7e8d7d194c 100644
--- a/main/configure.ac
+++ b/main/configure.ac
@@ -4734,8 +4734,6 @@ STATIC_SYSTEM_LIBS=
STATIC_SYSTEM_LIBXML=NO
STATIC_SYSTEM_LIBXSLT=NO
STATIC_SYSTEM_CURL=NO
-STATIC_SYSTEM_LIBICONV=NO
-LIBICONV_PREFIX=
if test -n "$with_static_system_libs" -a "$with_static_system_libs" != "no";
then
if test "$with_static_system_libs" = "yes"; then
AC_MSG_ERROR([--with-static-system-libs needs a list, e.g.
--with-static-system-libs=libxml,libxslt,curl])
@@ -4764,9 +4762,10 @@ if test -n "$with_static_system_libs" -a
"$with_static_system_libs" != "no"; the
_ssarchives="libcurl.a"; _sslflags="-lcurl"
;;
libiconv)
- dnl No --with-system-libiconv exists: iconv is only ever pulled in
- dnl as a transitive dep of the XML libs, so there is nothing to
- dnl enable and the prefix must be given as libiconv:DIR.
+ dnl The bundled XML libs are built --without-iconv, so this only
+ dnl covers a *system* libxml2/libxslt/curl whose own build enabled
+ dnl iconv and whose *-config therefore reports -liconv. There is no
+ dnl --with-system-libiconv to take a prefix from, hence libiconv:DIR.
_ssenabled=YES; _ssprefix="$_ssgiven"; _ssopt=
_ssarchives="libiconv.a"; _sslflags="-liconv"
;;
@@ -4815,7 +4814,6 @@ if test -n "$with_static_system_libs" -a
"$with_static_system_libs" != "no"; the
libxml) STATIC_SYSTEM_LIBXML=YES ;;
libxslt) STATIC_SYSTEM_LIBXSLT=YES ;;
curl) STATIC_SYSTEM_CURL=YES ;;
- libiconv) STATIC_SYSTEM_LIBICONV=YES; LIBICONV_PREFIX="$_ssprefix" ;;
esac
STATIC_SYSTEM_LIBS="$STATIC_SYSTEM_LIBS $_sslib"
AC_MSG_RESULT([$_ssprefix/lib])
@@ -4826,8 +4824,6 @@ AC_SUBST(STATIC_SYSTEM_LIBS)
AC_SUBST(STATIC_SYSTEM_LIBXML)
AC_SUBST(STATIC_SYSTEM_LIBXSLT)
AC_SUBST(STATIC_SYSTEM_CURL)
-AC_SUBST(STATIC_SYSTEM_LIBICONV)
-AC_SUBST(LIBICONV_PREFIX)
dnl ===================================================================
dnl Check for system mdds
diff --git a/main/libxml2/makefile.mk b/main/libxml2/makefile.mk
index 056e3a852f..8f5a105406 100644
--- a/main/libxml2/makefile.mk
+++ b/main/libxml2/makefile.mk
@@ -65,7 +65,7 @@ xml2_LIBS+=$(MINGW_SHARED_LIBSTDCPP)
.ENDIF
CONFIGURE_DIR=
CONFIGURE_ACTION=.$/configure
-CONFIGURE_FLAGS=--enable-ipv6=no --without-python --without-lzma
--enable-static=no --without-debug --build=i586-pc-mingw32
--host=i586-pc-mingw32 lt_cv_cc_dll_switch="-shared" CC="$(xml2_CC)"
LDFLAGS="-no-undefined -Wl,--enable-runtime-pseudo-reloc-v2 -L$(ILIB:s/;/ -L/)"
LIBS="$(xml2_LIBS)" OBJDUMP=objdump
+CONFIGURE_FLAGS=--enable-ipv6=no --without-python --without-lzma
--without-iconv --enable-static=no --without-debug --build=i586-pc-mingw32
--host=i586-pc-mingw32 lt_cv_cc_dll_switch="-shared" CC="$(xml2_CC)"
LDFLAGS="-no-undefined -Wl,--enable-runtime-pseudo-reloc-v2 -L$(ILIB:s/;/ -L/)"
LIBS="$(xml2_LIBS)" OBJDUMP=objdump
BUILD_ACTION=$(GNUMAKE)
BUILD_DIR=$(CONFIGURE_DIR)
.ELSE
@@ -87,19 +87,25 @@ xml2_CFLAGS+=$(ARCH_FLAGS) $(C_RESTRICTIONFLAGS)
xml2_LDFLAGS+=-L$(SYSBASE)$/usr$/lib
.ENDIF # "$(SYSBASE)"!=""
+# --without-iconv: no OpenOffice code calls iconv, and libxml2-configure.patch
+# has always meant to turn it off -- it patches the generated xmlversion.h,
+# which configure then regenerates, so it never took effect here. The Windows
+# build has passed iconv=no all along. Dropping it keeps UTF-8/UTF-16/ASCII/
+# Latin-1 and turns on libxml2's built-in ISO-8859-x tables; only encodings
+# like Shift_JIS, Big5 and KOI8-R go.
CONFIGURE_DIR=
.IF "$(OS)"=="OS2"
CONFIGURE_ACTION=sh .$/configure
-CONFIGURE_FLAGS=--enable-ipv6=no --without-python --without-zlib
--without-lzma --enable-static=yes --with-sax1=yes ADDCFLAGS="$(xml2_CFLAGS)"
CFLAGS="$(EXTRA_CFLAGS)" LDFLAGS="$(xml2_LDFLAGS) $(EXTRA_LINKFLAGS)"
+CONFIGURE_FLAGS=--enable-ipv6=no --without-python --without-zlib
--without-lzma --without-iconv --enable-static=yes --with-sax1=yes
ADDCFLAGS="$(xml2_CFLAGS)" CFLAGS="$(EXTRA_CFLAGS)" LDFLAGS="$(xml2_LDFLAGS)
$(EXTRA_LINKFLAGS)"
.ELIF "$(OS)"=="MACOSX"
# Community builds bundle a static libxml2 rather than a dylib -- see
# main/xmlsecurity/util/makefile.mk and main/forms/util/makefile.mk for
# the consumer side of this.
CONFIGURE_ACTION=.$/configure
-CONFIGURE_FLAGS=--enable-ipv6=no --without-python --without-zlib
--without-lzma --enable-static=yes --enable-shared=no --with-sax1=yes
ADDCFLAGS="$(xml2_CFLAGS) $(EXTRA_CFLAGS)" LDFLAGS="$(xml2_LDFLAGS)
$(EXTRA_LINKFLAGS)"
+CONFIGURE_FLAGS=--enable-ipv6=no --without-python --without-zlib
--without-lzma --without-iconv --enable-static=yes --enable-shared=no
--with-sax1=yes ADDCFLAGS="$(xml2_CFLAGS) $(EXTRA_CFLAGS)"
LDFLAGS="$(xml2_LDFLAGS) $(EXTRA_LINKFLAGS)"
.ELSE
CONFIGURE_ACTION=.$/configure
-CONFIGURE_FLAGS=--enable-ipv6=no --without-python --without-zlib
--without-lzma --enable-static=no --with-sax1=yes ADDCFLAGS="$(xml2_CFLAGS)
$(EXTRA_CFLAGS)" LDFLAGS="$(xml2_LDFLAGS) $(EXTRA_LINKFLAGS)"
+CONFIGURE_FLAGS=--enable-ipv6=no --without-python --without-zlib
--without-lzma --without-iconv --enable-static=no --with-sax1=yes
ADDCFLAGS="$(xml2_CFLAGS) $(EXTRA_CFLAGS)" LDFLAGS="$(xml2_LDFLAGS)
$(EXTRA_LINKFLAGS)"
.ENDIF
BUILD_ACTION=$(GNUMAKE)
BUILD_FLAGS+= -j$(EXTMAXPROCESS)
diff --git a/main/set_soenv.in b/main/set_soenv.in
index 595d33affd..f3613d1381 100644
--- a/main/set_soenv.in
+++ b/main/set_soenv.in
@@ -1986,8 +1986,6 @@ ToFile( "STATIC_SYSTEM_LIBS", "@STATIC_SYSTEM_LIBS@",
"e" );
ToFile( "STATIC_SYSTEM_LIBXML", "@STATIC_SYSTEM_LIBXML@", "e" );
ToFile( "STATIC_SYSTEM_LIBXSLT","@STATIC_SYSTEM_LIBXSLT@","e" );
ToFile( "STATIC_SYSTEM_CURL", "@STATIC_SYSTEM_CURL@", "e" );
-ToFile( "STATIC_SYSTEM_LIBICONV","@STATIC_SYSTEM_LIBICONV@","e" );
-ToFile( "LIBICONV_PREFIX", "@LIBICONV_PREFIX@", "e" );
ToFile( "SYSTEM_EXPAT", "@SYSTEM_EXPAT@", "e" );
ToFile( "ENABLE_MYSQLC", "@ENABLE_MYSQLC@", "e" );
ToFile( "SYSTEM_MYSQL", "@SYSTEM_MYSQL@", "e" );
diff --git a/main/solenv/inc/libs.mk b/main/solenv/inc/libs.mk
index e6ba0b20c5..0a0b2ff8c4 100644
--- a/main/solenv/inc/libs.mk
+++ b/main/solenv/inc/libs.mk
@@ -178,13 +178,8 @@ LIBXML2LIB=$(LIBXML_LIBS:s/-licuuc//)
.IF "$(OS)"=="MACOSX"
# Bundled libxml2 is a static archive on macOS (main/libxml2/makefile.mk),
which
# carries no transitive deps -- add what its own .pc's Libs.private needs.
-# --with-static-system-libs=libiconv:DIR pins iconv to that archive; the SDK
-# ships only a .tbd stub for the dylib, so there is no system libiconv.a.
-.IF "$(STATIC_SYSTEM_LIBICONV)"=="YES"
-LIBXML2LIB=-lxml2 -lpthread $(LIBICONV_PREFIX)/lib/libiconv.a -lm
-.ELSE
-LIBXML2LIB=-lxml2 -lpthread -liconv -lm
-.ENDIF
+# It is built --without-iconv, so no -liconv here.
+LIBXML2LIB=-lxml2 -lpthread -lm
.ELSE
LIBXML2LIB=-lxml2
.ENDIF