commit e3b5e3aebc
Date: Wed Apr 23 13:38:50 2025 +0200
libxml2: upgrade to 2.14.3
* In https://gitlab.gnome.org/GNOME/libxml2/-/commit/712a31abe458eed75f0e2a442b35af58cf7091ca
some members used by Libreoffice were marked as deprecated.
Add deprecated.patch.0 to undeprecate them for now.
Meanwhile
https://gitlab.gnome.org/GNOME/libxml2/-/issues/936#note_2461334 has been
opened to discuss it. The necessary code changes
will be addressed in a follow-up commit
[...]
added a patch to ignore deprecated symbols in
the internal libxml2, by undeprecating the symbols for
that version.
Drop that patch again and instead let compilers ignore
the deprecation warnings for now, to also make the --enable-werror
build pass for the (default) system libxml2 used e.g. on
Debian testing (which currently provides 2.14.5+dfsg-0.2).
Build failure seen there otherwise:
/home/michi/development/git/libreoffice/xmlsecurity/source/xmlsec/saxhelper.cxx:162:24: error: 'recovery' is deprecated [-Werror,-Wdeprecated-declarations]
162 | m_pParserCtxt->recovery = 1 ;
| ^
/usr/include/libxml2/libxml/parser.h:377:18: note: 'recovery' has been explicitly marked deprecated here
377 | int recovery XML_DEPRECATED_MEMBER;
| ^
/usr/include/libxml2/libxml/xmlexports.h:74:50: note: expanded from macro 'XML_DEPRECATED_MEMBER'
74 | #define XML_DEPRECATED_MEMBER __attribute__((deprecated))
| ^
/home/michi/development/git/libreoffice/xmlsecurity/source/xmlsec/saxhelper.cxx:209:20: error: 'nodeTab' is deprecated [-Werror,-Wdeprecated-declarations]
209 | m_pParserCtxt->nodeTab[m_pParserCtxt->nodeNr - 1]
| ^
/usr/include/libxml2/libxml/parser.h:284:25: note: 'nodeTab' has been explicitly marked deprecated here
284 | xmlNodePtr *nodeTab XML_DEPRECATED_MEMBER;
| ^
/usr/include/libxml2/libxml/xmlexports.h:74:50: note: expanded from macro 'XML_DEPRECATED_MEMBER'
74 | #define XML_DEPRECATED_MEMBER __attribute__((deprecated))
| ^
/home/michi/development/git/libreoffice/xmlsecurity/source/xmlsec/saxhelper.cxx:209:43: error: 'nodeNr' is deprecated [-Werror,-Wdeprecated-declarations]
209 | m_pParserCtxt->nodeTab[m_pParserCtxt->nodeNr - 1]
| ^
/usr/include/libxml2/libxml/parser.h:280:16: note: 'nodeNr' has been explicitly marked deprecated here
280 | int nodeNr XML_DEPRECATED_MEMBER;
| ^
/usr/include/libxml2/libxml/xmlexports.h:74:50: note: expanded from macro 'XML_DEPRECATED_MEMBER'
74 | #define XML_DEPRECATED_MEMBER __attribute__((deprecated))
| ^
/home/michi/development/git/libreoffice/xmlsecurity/source/xmlsec/saxhelper.cxx:229:62: error: 'inputMax' is deprecated [-Werror,-Wdeprecated-declarations]
229 | if( m_pParserCtxt->inputTab != nullptr && m_pParserCtxt->inputMax != 0 )
| ^
/usr/include/libxml2/libxml/parser.h:271:18: note: 'inputMax' has been explicitly marked deprecated here
271 | int inputMax XML_DEPRECATED_MEMBER;
| ^
/usr/include/libxml2/libxml/xmlexports.h:74:50: note: expanded from macro 'XML_DEPRECATED_MEMBER'
74 | #define XML_DEPRECATED_MEMBER __attribute__((deprecated))
| ^
4 errors generated.
make[1]: *** [/home/michi/development/git/libreoffice/solenv/gbuild/LinkTarget.mk:338: /home/michi/development/git/libreoffice/workdir/CxxObject/xmlsecurity/source/xmlsec/saxhelper.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:301: build] Error 2
Change-Id: I1124859c0ef766b73f506dd997d89543ccf6eb12
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190668
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Building with --without-system-libxml fails with
/usr/bin/ld: /home/xisco/libreoffice/workdir/UnpackedTarball/raptor/src/.libs/libraptor2.so: undefined reference to `xmlNanoHTTPScanProxy'
/usr/bin/ld: /home/xisco/libreoffice/workdir/UnpackedTarball/raptor/src/.libs/libraptor2.so: undefined reference to `xmlNanoHTTPClose'
/usr/bin/ld: /home/xisco/libreoffice/workdir/UnpackedTarball/raptor/src/.libs/libraptor2.so: undefined reference to `xmlNanoHTTPReturnCode'
/usr/bin/ld: /home/xisco/libreoffice/workdir/UnpackedTarball/raptor/src/.libs/libraptor2.so: undefined reference to `xmlNanoHTTPRead'
/usr/bin/ld: /home/xisco/libreoffice/workdir/UnpackedTarball/raptor/src/.libs/libraptor2.so: undefined reference to `xmlNanoHTTPCleanup'
/usr/bin/ld: /home/xisco/libreoffice/workdir/UnpackedTarball/raptor/src/.libs/libraptor2.so: undefined reference to `xmlNanoHTTPMethod'
/usr/bin/ld: /home/xisco/libreoffice/workdir/UnpackedTarball/raptor/src/.libs/libraptor2.so: undefined reference to `xmlNanoHTTPInit'
collect2: error: ld returned 1 exit status
so use --without-www in external/redland/ExternalProject_raptor.mk
since it seems no to be used by raptor.
Libxml2 disabled http support by default in
https://gitlab.gnome.org/GNOME/libxml2/-/commit/3018842c07e9b88d6bb0257f5644e7695cdeb2e2
Downloaded from https://download.gnome.org/sources/libxml2/2.13/libxml2-2.13.1.tar.xz
Kudos to Michael Weghorn for helping me with this patch
Change-Id: I2e41021e8aea3551eb9eec29cf12f6cd9f6ff89e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169327
Reviewed-by: Taichi Haradaguchi <20001722@ymail.ne.jp>
Tested-by: Jenkins
Diverging from upstream by inventing a LIBXML2_GLOBAL_VARIABLES version
should only be done if actually required.
Change-Id: I1520ca5078dc24ffd83e927f9c857d625e71749b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163455
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
what I'm really after is some vexating not-reproducible oss-fuzz msan
warnings when using libxml2 in the fodt2pdf fuzzer. So lets upgrade
libxml2 to the latest, which requires bumping libxslt, and then requires
a newer liblangtag because of no longer implicit includes that it
depended on.
xmlKeepBlanksDefaultValue and xmlSubstituteEntitiesDefault are
deprecated, we should get around to updating those uses
Change-Id: I8fda0dffda0a7ea65407d246a3121875cb8ad4a4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161598
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
After 5b42f148e2 "ExternalProject_libxml2 still
needs to build the xmllint executable" (which I had happened to prepare on
macOS, so didn't originally notice the issue addressed here now), Linux builds
like <https://ci.libreoffice.org/job/lo_callgrind_linux/13374/> started to fail
with
> CCLD xmllint
> /opt/rh/devtoolset-11/root/usr/libexec/gcc/x86_64-redhat-linux/11/ld: xmllint-xmllint.o: in function `testSAX':
> /home/tdf/lode/jenkins/workspace/lo_callgrind_linux/workdir/UnpackedTarball/libxml2/xmllint.c:1646: undefined reference to `xmlNewSAXParserCtxt'
> /opt/rh/devtoolset-11/root/usr/libexec/gcc/x86_64-redhat-linux/11/ld: xmllint-xmllint.o: in function `myReallocFunc':
> /home/tdf/lode/jenkins/workspace/lo_callgrind_linux/workdir/UnpackedTarball/libxml2/xmllint.c:357: undefined reference to `xmlMemSize'
> collect2: error: ld returned 1 exit status
> make[2]: *** [Makefile:1007: xmllint] Error 1
> make[1]: *** [/home/tdf/lode/jenkins/workspace/lo_callgrind_linux/external/libxml2/ExternalProject_libxml2.mk:37: /home/tdf/lode/jenkins/workspace/lo_callgrind_linux/workdir/ExternalProject/libxml2/build] Error 1
Turns out that those two functions have been introduced after the previously
used libxml2 2.10.4. No idea how things are supposed to work (given that
workdir/UnpackedTarball/libxml2/libxml2.syms starts off with "Retained for
backward compatibility. Don't add new symbols.", it appears that there should be
some other mechanism at play to make xmllint on Linux find the libxml2.so
symbols it needs, but which doesn't work as intended in our build), but just add
those two symbols to libxml2.syms for now. (With a new version named
LIBXML2_2.11.4, even if the symbols can actually have been introduced in some
other version between 2.10.4 and 2.11.4, but who cares.)
Change-Id: Ib9d5c7901fe94b8014a87b049fc27ef5658fd954
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152292
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
No idea why fd6cbd983a "upgrade to libxml2-2.11.4"
started to only explicitly make libxml2.la (the commit message doesn't say), but
that caused at least <https://ci.libreoffice.org/job/lo_ubsan/2788/> to fail
with
> make[1]: *** Deleting file '/home/tdf/lode/jenkins/workspace/lo_ubsan/workdir/CustomTarget/sfx2/classification/example.validated'
> [build VAL] CustomTarget/sfx2/classification/example.validated
> /bin/sh: /home/tdf/lode/jenkins/workspace/lo_ubsan/workdir/UnpackedTarball/libxml2//xmllint: No such file or directory
> make[1]: *** [/home/tdf/lode/jenkins/workspace/lo_ubsan/sfx2/CustomTarget_classification.mk:20: /home/tdf/lode/jenkins/workspace/lo_ubsan/workdir/CustomTarget/sfx2/classification/example.validated] Error 1
Change-Id: I7e7aa2bae05cf8674720cfd72c78840cd7a28919
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152256
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This is basically ea68de2968 but
for LDFLAGS. A number of external libs cannot use this because
their libtool mishandles -fuse-ld.
Change-Id: Idee379eb0a3afb475b536519ee3de064b4e218f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133639
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
No idea why we just provided the platform flags when cross-
compiling. In the curious case, where the host platform is
detected as x86_64-pc-mingw32 per default and we actually
want to override it with x86_64-pc-cygwin, we don't do a
cross compile, but must override the host platform.
But there is additional special handling needed for the omitted
cross-platform build in the special case of --host=i686-pc-cygwin
and --build=x86_64-pc-cygwin, where we deliberatly ignore cross
building; Windows is already a slow build, so try to keep this
optimization (AMD64 can execute x86 binaries).
There is the theoretical case, where the externals config.guess
would have detected something else and that "magically" even
worked, while the LO detected triplet would fail, but this
should be fixed in the external in any way.
Change-Id: Ib7a9719e0e406fe90334b7611dc3f01b51692bfa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129153
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
When building a static LO with --disable-dynloading on Linux,
--without-system-libs failed for me. And it left me really puzzled:
raptor configure failed and claimed it couldn't link libxml2.
raptor's config.log showed missing math functions. xml2-config of
LO's build is patched and it includes a -lm. The xml2-config in my
chroot doesn't. But we explicitly pass the xml2-config for
non-system-libxml2 build. Reading the configure from raptor didn't
reveal a way, that it could somehow pick up the xml2-config from
the chroot, but that code is autoconf-complex...
When running "sh -x configure", it turned out the configure script
actually picks up the LIBXML_* flags from the environment, which
are set by LO's config_host.mk. These just add -lm for Android.
So this adds a xml2-config.in "dummy", which overwrites the one
from the libxml2 source and just echos LO's LIBXML_* values and
it adds -lm for all DISABLE_DYNLOADING targets.
Change-Id: Ia713cf80c8e7dc989cf23c224e7a0f7ea1210a87
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116409
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
See instructions in solenv/gbuild/Trace.mk . This generates a file than
can be viewed e.g. in the Chromium tracing view.
Change-Id: I5f90647c58ca729375525b6daed2d4918adc8188
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88754
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
... which is, surprisingly enough, required to build the latest libxslt.
Change-Id: Ifbb36ed61b8f68185f9c788f63a8edeb58899f94
Reviewed-on: https://gerrit.libreoffice.org/83311
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
...that had been added with fcb2d8a87a
"external/libxml2: Avoid UBSan nullptr-with-offset"
Change-Id: I7ee234c8c6a868ed825a8ed3fa0dcdc69decb7ba
Reviewed-on: https://gerrit.libreoffice.org/81299
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
...(new with Clang 10 trunk), where adding even an offset of 0 to a null pointer
is UB in C. Seen when building UIConfig_modules/schart:
> [UIL] chart2/uiconfig/ui/3dviewdialog
> xpath.c:14532:5: runtime error: applying zero offset to null pointer
> #0 in xmlXPathTryStreamCompile at workdir/UnpackedTarball/libxml2/xpath.c:14532:5
> #1 in xmlXPathCtxtCompile__internal_alias at workdir/UnpackedTarball/libxml2/xpath.c:14634:12
> #2 in xsltXPathCompileFlags at workdir/UnpackedTarball/libxslt/libxslt/xsltutils.c:2323:11
> #3 in xsltValueOfComp at workdir/UnpackedTarball/libxslt/libxslt/preproc.c:1258:18
> #4 in xsltStylePreCompute at workdir/UnpackedTarball/libxslt/libxslt/preproc.c:2225:6
> #5 in xsltParseTemplateContent at workdir/UnpackedTarball/libxslt/libxslt/xslt.c:4916:13
> #6 in xsltParseStylesheetTemplate at workdir/UnpackedTarball/libxslt/libxslt/xslt.c:5467:5
> #7 in xsltParseStylesheetTop at workdir/UnpackedTarball/libxslt/libxslt/xslt.c:6205:6
> #8 in xsltParseStylesheetProcess at workdir/UnpackedTarball/libxslt/libxslt/xslt.c:6461:2
> #9 in xsltParseStylesheetImportedDoc at workdir/UnpackedTarball/libxslt/libxslt/xslt.c:6675:9
> #10 in xsltParseStylesheetDoc at workdir/UnpackedTarball/libxslt/libxslt/xslt.c:6714:11
> #11 in main at workdir/UnpackedTarball/libxslt/xsltproc/xsltproc.c:888:9
Change-Id: I016ca8d24315385bcfeafca56dda44d9be10f517
Reviewed-on: https://gerrit.libreoffice.org/81285
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
* fixes CVE-2018-14404
* drop one hunk from libxml2-android.patch that was added in commit
6a17d2f2ba7acfec277314b97b50e41532d6b44d; presumably nan() exists now
given that other code is calling it.
Change-Id: I696cc4e1da55536ea1c89a6e0446ce5bc8398ba4
Reviewed-on: https://gerrit.libreoffice.org/66308
Tested-by: Jenkins
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>