This is an automated email from the ASF dual-hosted git repository.

jimjag pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 0f155d76b3 macOS: bundle the external libraries by default; add 
--enable-jemalloc
0f155d76b3 is described below

commit 0f155d76b3fa3703e54ee72457a8422ca7d11b60
Author: Jim Jagielski <[email protected]>
AuthorDate: Thu Nov 5 09:49:07 2026 -0500

    macOS: bundle the external libraries by default; add --enable-jemalloc
    
    curl stays at 8.7.1 on Windows; 8.23.0 has no winbuild/.
---
 main/LICENSE                                   |  33 +-
 main/configure.ac                              |  41 +-
 main/curl/curl-bundled_openssl.patch           |  47 +-
 main/curl/makefile.mk                          |  20 +-
 main/desktop/prj/build.lst                     |   2 +-
 main/desktop/source/pkgchk/unopkg/makefile.mk  |   6 +
 main/desktop/util/makefile.mk                  |   9 +
 main/expat/expat-2.5.0.patch                   | 815 -------------------------
 main/expat/expat-2.8.1.patch                   | 195 ++++++
 main/expat/makefile.mk                         |   6 +-
 main/expat/prj/d.lst                           |   4 +-
 main/external_deps.lst                         |  29 +-
 main/{expat => jemalloc}/makefile.mk           |  46 +-
 main/jemalloc/prj/build.lst                    |   3 +
 main/jemalloc/prj/d.lst                        |   3 +
 main/libxml2/makefile.mk                       |   2 +-
 main/libxslt/makefile.mk                       |   2 +-
 main/openssl/makefile.mk                       |   4 +-
 main/openssl/openssl.patch                     |  12 +-
 main/openssl/opensslunx.patch                  |   4 +-
 main/python/makefile.mk                        |  36 +-
 main/python/python-3.11.15-selfcontained.patch |  23 +
 main/scp2/source/ooo/file_library_ooo.scp      |  15 +
 main/scp2/source/ooo/makefile.mk               |   4 +
 main/scp2/source/ooo/module_hidden_ooo.scp     |   1 +
 main/scp2/source/ooo/ure.scp                   |   3 +-
 main/set_soenv.in                              |   1 +
 main/solenv/inc/unxlng.mk                      |   2 +-
 28 files changed, 463 insertions(+), 905 deletions(-)

diff --git a/main/LICENSE b/main/LICENSE
index 488e5acede..7f1ef7f04b 100644
--- a/main/LICENSE
+++ b/main/LICENSE
@@ -1004,7 +1004,7 @@ ____
 For integration of the library curl - built in main/curl/
 - license like MIT license
 
-Copyright (c) 1996 - 2020, Daniel Stenberg, <[email protected]>, and many
+Copyright (c) 1996 - 2026, Daniel Stenberg, <[email protected]>, and many
 contributors, see the THANKS file.
 
 All rights reserved.
@@ -1031,7 +1031,7 @@ For integration of XML Expat - built in main/expat/
 - MIT license
 
 Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper
-Copyright (c) 2001-2022 Expat maintainers
+Copyright (c) 2001-2025 Expat maintainers
 
 Permission is hereby granted, free of charge, to any person obtaining
 a copy of this software and associated documentation files (the
@@ -1492,6 +1492,35 @@ SUCH DAMAGE.
 
 ____
 
+For jemalloc - built in main/jemalloc/:
+- BSD license
+
+Copyright (C) 2002-present Jason Evans <[email protected]>.
+All rights reserved.
+Copyright (C) 2007-2012 Mozilla Foundation.  All rights reserved.
+Copyright (C) 2009-present Facebook, Inc.  All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+1. Redistributions of source code must retain the above copyright notice(s),
+   this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice(s),
+   this list of conditions and the following disclaimer in the documentation
+   and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY EXPRESS
+OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
+EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+____
+
 For Python version 2.7.18 - built in /main/python:
 - Python Software Foundation License
 
diff --git a/main/configure.ac b/main/configure.ac
index bd629b67ea..a543002f26 100644
--- a/main/configure.ac
+++ b/main/configure.ac
@@ -936,6 +936,12 @@ AC_ARG_WITH(alloc,
 
                           Note that on FreeBSD/NetBSD system==jemalloc
 ],,)
+AC_ARG_ENABLE(jemalloc,
+[  --enable-jemalloc       Download, build and bundle jemalloc and use it as 
the
+                          allocator (Linux and macOS only). Use
+                          --with-alloc=jemalloc instead to link a jemalloc
+                          already installed on the system.
+],,)
 AC_ARG_ENABLE(verbose,
 [  --enable-verbose        Increase build verbosity.
   --disable-verbose       Decrease build verbosity.
@@ -3474,6 +3480,20 @@ dnl 
===================================================================
 dnl allocator
 dnl ===================================================================
 AC_MSG_CHECKING([which memory allocator to use])
+if test "$enable_jemalloc" = "yes"; then
+    case "$_os" in
+    Linux|Darwin) ;;
+    *) AC_MSG_ERROR([--enable-jemalloc is only supported on Linux and macOS]) 
;;
+    esac
+    if test -n "$with_alloc" -a "$with_alloc" != "jemalloc"; then
+        AC_MSG_ERROR([--enable-jemalloc cannot be combined with 
--with-alloc=$with_alloc])
+    fi
+    AC_MSG_RESULT([jemalloc (bundled)])
+    ALLOC="JEMALLOC"
+    ENABLE_JEMALLOC=YES
+    BUILD_TYPE="$BUILD_TYPE JEMALLOC"
+    with_alloc="bundled-jemalloc"
+fi
 if test "$with_alloc" = "system"; then
     AC_MSG_RESULT([system])
     ALLOC="SYS_ALLOC";
@@ -3507,6 +3527,7 @@ if test "$with_alloc" = "internal" -o -z "$with_alloc"; 
then
    AC_MSG_RESULT([internal])
 fi
 AC_SUBST(ALLOC)
+AC_SUBST(ENABLE_JEMALLOC)
 
 dnl ===================================================================
 dnl Custom build version
@@ -4347,9 +4368,6 @@ AC_SUBST(SYSTEM_STDLIBS)
 dnl ===================================================================
 dnl Check for system zlib
 dnl ===================================================================
-if test "$_os" = "Darwin" && test "$with_system_zlib" != "no"; then
-   with_system_zlib=yes
-fi
 AC_MSG_CHECKING([which zlib to use])
 if test -n "$with_system_zlib" -o -n "$with_system_libs" && \
        test "$with_system_zlib" != "no"; then
@@ -4456,8 +4474,7 @@ dnl 
===================================================================
 dnl Check for system libxslt
 dnl ===================================================================
 AC_MSG_CHECKING([which libxslt to use])
-if test -n "$with_system_libxslt" -o -n "$with_system_libs" -o \
-       "$_os" = "Darwin" && \
+if test -n "$with_system_libxslt" -o -n "$with_system_libs" && \
    test "$with_system_libxslt" != "no"; then
    AC_MSG_RESULT([external])
    SYSTEM_LIBXSLT=YES
@@ -4504,8 +4521,7 @@ dnl 
===================================================================
 dnl Check for system libxml
 dnl ===================================================================
 AC_MSG_CHECKING([which libxml to use])
-if test -n "$with_system_libxml" -o -n "$with_system_libs" -o \
-            "$_os" = "Darwin" && \
+if test -n "$with_system_libxml" -o -n "$with_system_libs" && \
        test "$with_system_libxml" != "no"; then
     AC_MSG_RESULT([external])
     SYSTEM_LIBXML=YES
@@ -4648,7 +4664,9 @@ dnl 
===================================================================
 dnl Check for system python
 dnl ===================================================================
 AC_MSG_CHECKING([which python to use])
-if test "$_os" = "Darwin" && test "$with_system_python" != "no"; then
+if test "$_os" = "Darwin" && \
+   test -n "$with_system_python" -o -n "$with_system_libs" && \
+   test "$with_system_python" != "no"; then
    with_system_python=yes
 
    dnl Recent macOS releases no longer ship a usable Python under /usr/bin,
@@ -5209,14 +5227,7 @@ AC_SUBST(COINMP_LIBS)
 dnl ===================================================================
 dnl Check for system curl
 dnl ===================================================================
-dnl Darwin always treats curl as external (see the "-o \"$_os\" = \"Darwin\""
-dnl clause below), regardless of whether --with-system-curl was actually
-dnl given a directory -- capture the as-given value first, before it gets
-dnl forced to a bare "yes", so a real --with-system-curl=DIR isn't lost.
 with_system_curl_dir="$with_system_curl"
-if test "$_os" = "Darwin" && test "$with_system_curl" != "no"; then
-   with_system_curl=yes
-fi
 AC_MSG_CHECKING([which curl to use])
 if test -n "$with_system_curl" -o -n "$with_system_libs" && \
        test "$with_system_curl" != "no"; then
diff --git a/main/curl/curl-bundled_openssl.patch 
b/main/curl/curl-bundled_openssl.patch
index 02398175f9..92e207b550 100644
--- a/main/curl/curl-bundled_openssl.patch
+++ b/main/curl/curl-bundled_openssl.patch
@@ -1,29 +1,28 @@
---- misc/build/curl-8.7.1/configure    2024-04-21 19:20:02.487331000 +0200
-+++ misc/build/curl-8.7.1/configure    2024-04-21 19:20:26.529989000 +0200
-@@ -26416,7 +26416,7 @@
-     fi
+--- misc/build/curl-8.23.0/configure
++++ misc/build/curl-8.23.0/configure
+@@ -27437,14 +27437,14 @@
+       fi
  
-     if test "$PKGTEST" != "yes"; then
--      if test ! -f "$PREFIX_OPENSSL/include/openssl/ssl.h"; then
-+      if test ! -f "$PREFIX_OPENSSL/inc/external/openssl/ssl.h"; then
+       if test "$PKGTEST" != "yes" &&
+-         test ! -f "$PREFIX_OPENSSL/include/openssl/ssl.h"; then
++         test ! -f "$PREFIX_OPENSSL/inc/external/openssl/ssl.h"; then
          as_fn_error $? "$PREFIX_OPENSSL is a bad --with-openssl prefix!" 
"$LINENO" 5
        fi
+ 
+                   LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
+       if test "$PREFIX_OPENSSL" != "/usr"; then
+         SSL_LDFLAGS="-L$LIB_OPENSSL"
+-        SSL_CPPFLAGS="-I$PREFIX_OPENSSL/include"
++        SSL_CPPFLAGS="-I$PREFIX_OPENSSL/inc/external"
+       fi
+       ;;
+   esac
+@@ -27792,7 +27792,7 @@
+       LDFLAGSPC="$CLEANLDFLAGSPC -L$LIB_OPENSSL"
      fi
-@@ -26424,7 +26424,7 @@
-             LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
-     if test "$PREFIX_OPENSSL" != "/usr" ; then
-       SSL_LDFLAGS="-L$LIB_OPENSSL"
--      SSL_CPPFLAGS="-I$PREFIX_OPENSSL/include"
-+      SSL_CPPFLAGS="-I$PREFIX_OPENSSL/inc/external"
+     if test "$PKGCONFIG" = "no" && test -n "$PREFIX_OPENSSL"; then
+-            CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include"
++            CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/inc/external"
      fi
-     ;;
-   esac
-@@ -26655,7 +26655,7 @@
-      fi
-      if test "$PKGCONFIG" = "no" -a -n "$PREFIX_OPENSSL" ; then
-        # only set this if pkg-config wasn't used
--       CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include"
-+       CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/inc/external"
-      fi
-      # Linking previously failed, try extra paths from --with-openssl or
-      # pkg-config.  Use a different function name to avoid reusing the earlier
+                 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 
HMAC_Init_ex in -lcrypto" >&5
+ printf %s "checking for HMAC_Init_ex in -lcrypto... " >&6; }
diff --git a/main/curl/makefile.mk b/main/curl/makefile.mk
index 7bff8fcfcb..a7003bcb5b 100644
--- a/main/curl/makefile.mk
+++ b/main/curl/makefile.mk
@@ -37,9 +37,15 @@ all:
 
 # --- Files --------------------------------------------------------
 
+.IF "$(GUI)"=="WNT"
+# curl 8.23.0 has no winbuild/ directory, so Windows stays on 8.7.1 for now.
 TARFILE_NAME=curl-8.7.1
 TARFILE_MD5=92f7a11836678b725e2cb59fef10c273
 PATCH_FILES=curl-wnt.patch
+.ELSE
+TARFILE_NAME=curl-8.23.0
+TARFILE_MD5=d45ab886d8224c77c91d7161ddc179c1
+.ENDIF
 
 #ADDITIONAL_FILES= lib$/config-os2.h lib$/Makefile.os2
 
@@ -69,10 +75,20 @@ curl_LDFLAGS+=-L$(SOLARLIBDIR)
 PATCH_FILES+= curl-bundled_openssl.patch
 .ENDIF
 
+.IF "$(OS)"=="MACOSX" && "$(SYSTEM_ZLIB)"!="YES"
+# curl probes for -lz, but the bundled zlib is delivered as libzlib.a, so
+# give configure a private prefix where it has the names it expects.
+ZLIB_SHIM=$(shell @pwd)$/$(INPATH)$/misc$/zlib-shim
+zlib_prep=mkdir -p $(ZLIB_SHIM)/include $(ZLIB_SHIM)/lib && ln -sf 
$(SOLARINCDIR)/external/zlib/zlib.h $(ZLIB_SHIM)/include/zlib.h && ln -sf 
$(SOLARINCDIR)/external/zlib/zconf.h $(ZLIB_SHIM)/include/zconf.h && ln -sf 
$(SOLARLIBDIR)/libzlib.a $(ZLIB_SHIM)/lib/libz.a &&
+# The bundled zlib has no gz*.c, which configure probes for (gzread); curl
+# itself only uses the inflate/deflate calls.
+zlib_param=--with-zlib=$(ZLIB_SHIM) ac_cv_lib_z_gzread=yes
+.ENDIF
+
 CONFIGURE_DIR=.$/
 #relative to CONFIGURE_DIR
-CONFIGURE_ACTION=.$/configure
-CONFIGURE_FLAGS= $(ssl_param) --without-libidn --enable-ftp --enable-ipv6 
--enable-http --disable-gopher --disable-file --disable-ldap --disable-telnet 
--disable-dict --disable-static CPPFLAGS="$(curl_CFLAGS)"  
LDFLAGS="$(curl_LDFLAGS)"
+CONFIGURE_ACTION=$(zlib_prep) .$/configure
+CONFIGURE_FLAGS= $(ssl_param) $(zlib_param) --without-iconv --without-libidn2 
--without-libpsl --without-nghttp2 --without-nghttp3 --without-ngtcp2 
--without-quiche --without-brotli --without-zstd --without-libssh2 
--without-libssh --enable-ftp --enable-ipv6 --enable-http --disable-gopher 
--disable-file --disable-ldap --disable-telnet --disable-dict --disable-static 
CPPFLAGS="$(curl_CFLAGS)"  LDFLAGS="$(curl_LDFLAGS)"
 
 BUILD_DIR=$(CONFIGURE_DIR)$/lib
 BUILD_ACTION=$(GNUMAKE)
diff --git a/main/desktop/prj/build.lst b/main/desktop/prj/build.lst
index 31fbea129d..b2af8e4541 100644
--- a/main/desktop/prj/build.lst
+++ b/main/desktop/prj/build.lst
@@ -1,4 +1,4 @@
-dt      desktop :    L10N:l10n sfx2 stoc sysui SO:sysui_so BOOST:boost svx 
xmlhelp sal unoil officecfg offapi filter LIBXSLT:libxslt NULL
+dt      desktop :    L10N:l10n sfx2 stoc sysui SO:sysui_so BOOST:boost svx 
xmlhelp sal unoil officecfg offapi filter LIBXSLT:libxslt JEMALLOC:jemalloc NULL
 dt     desktop                                                                 
usr1    -       all     dt_mkout NULL
 dt     desktop\inc                                                             
nmake   -       all     dt_inc NULL
 dt     desktop\prj                                                             
get             -       all     dt_prj NULL
diff --git a/main/desktop/source/pkgchk/unopkg/makefile.mk 
b/main/desktop/source/pkgchk/unopkg/makefile.mk
index 109b5b6cbb..f6a04c92b2 100644
--- a/main/desktop/source/pkgchk/unopkg/makefile.mk
+++ b/main/desktop/source/pkgchk/unopkg/makefile.mk
@@ -53,6 +53,12 @@ APP1LINKRES = $(MISC)$/$(TARGET)1.res
 APP2TARGET = unopkg
 APP2OBJS = $(OBJFILES)
 APP2STDLIBS = $(SALLIB) $(UNOPKGAPPLIB)
+.IF "$(ENABLE_JEMALLOC)" == "YES"
+.IF "$(OS)" == "LINUX"
+APP2STDLIBS += -Wl,--no-as-needed
+.ENDIF
+APP2STDLIBS += -ljemalloc
+.ENDIF
 APP2DEPN = $(SHL1TARGETN)
 APP2NOSAL = TRUE
 APP2RPATH = BRAND
diff --git a/main/desktop/util/makefile.mk b/main/desktop/util/makefile.mk
index f19ecad786..5b21d4cc54 100644
--- a/main/desktop/util/makefile.mk
+++ b/main/desktop/util/makefile.mk
@@ -113,6 +113,15 @@ APP5STDLIBS = $(SALLIB) $(SOFFICELIB)
 APP5STDLIBS+= -lXext -lX11
 #APP5STDLIBS+= -lXext -lSM -lICE
 .ENDIF # LINUX
+.IF "$(ENABLE_JEMALLOC)" == "YES"
+# Must be linked into the executable itself to replace malloc process-wide.
+# --no-as-needed: the executable names no jemalloc symbol, so a default
+# --as-needed link would drop the dependency.
+.IF "$(OS)" == "LINUX"
+APP5STDLIBS+= -Wl,--no-as-needed
+.ENDIF
+APP5STDLIBS+= -ljemalloc
+.ENDIF
 
 APP5DEPN= $(APP1TARGETN) $(APP5RES) ooverinfo.rc
 APP5DEF=    $(MISCX)$/$(TARGET).def
diff --git a/main/expat/expat-2.5.0.patch b/main/expat/expat-2.5.0.patch
deleted file mode 100644
index f1e57ab91f..0000000000
--- a/main/expat/expat-2.5.0.patch
+++ /dev/null
@@ -1,815 +0,0 @@
-diff -ru misc/expat-2.5.0/lib/makefile.mk 
misc/build/expat-2.5.0/lib/makefile.mk
---- misc/expat-2.5.0/lib/makefile.mk   2023-02-06 23:22:07.391327553 +0100
-+++ misc/build/expat-2.5.0/lib/makefile.mk     2023-02-06 23:22:40.584115842 
+0100
-@@ -1,1 +1,79 @@
--dummy
-+#**************************************************************
-+#  
-+#  Licensed to the Apache Software Foundation (ASF) under one
-+#  or more contributor license agreements.  See the NOTICE file
-+#  distributed with this work for additional information
-+#  regarding copyright ownership.  The ASF licenses this file
-+#  to you under the Apache License, Version 2.0 (the
-+#  "License"); you may not use this file except in compliance
-+#  with the License.  You may obtain a copy of the License at
-+#  
-+#    http://www.apache.org/licenses/LICENSE-2.0
-+#  
-+#  Unless required by applicable law or agreed to in writing,
-+#  software distributed under the License is distributed on an
-+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-+#  KIND, either express or implied.  See the License for the
-+#  specific language governing permissions and limitations
-+#  under the License.
-+#  
-+#**************************************************************
-+PRJ=..$/..$/..$/..$/..
-+
-+PRJNAME=expat
-+TARGET=expat
-+LIBTARGET=NO
-+EXTERNAL_WARNINGS_NOT_ERRORS=TRUE
-+
-+# --- Settings -----------------------------------------------------
-+.INCLUDE :  settings.mk
-+# --- Files --------------------------------------------------------
-+
-+CFLAGS+=-I..
-+
-+.IF "$(OS)"=="WNT"
-+CDEFS+=-DWIN32
-+.ELSE
-+CDEFS+=-DHAVE_EXPAT_CONFIG_H
-+.ENDIF
-+
-+.IF "$(OS)"=="MACOSX" && "$(SYSBASE)"!=""
-+CDEFS+=-DHAVE_MEMMOVE -DHAVE_BCOPY
-+.ENDIF # "$(OS)"=="MACOSX"
-+
-+SECOND_BUILD=UNICODE
-+UNICODE_SLOFILES=$(SLO)$/xmlparse.obj
-+UNICODECDEFS+=-DXML_UNICODE
-+
-+LIB1ARCHIV=$(LB)$/libascii_$(TARGET)_xmlparse.a
-+LIB1TARGET=$(SLB)$/ascii_$(TARGET)_xmlparse.lib
-+LIB1OBJFILES=$(SLO)$/xmlparse.obj
-+
-+LIB2ARCHIV=$(LB)$/lib$(TARGET)_xmlparse.a
-+LIB2TARGET=$(SLB)$/$(TARGET)_xmlparse.lib
-+LIB2OBJFILES =$(REAL_UNICODE_SLOFILES)
-+
-+LIB3ARCHIV=$(LB)$/lib$(TARGET)_xmltok.a
-+LIB3TARGET=$(SLB)$/$(TARGET)_xmltok.lib
-+LIB3OBJFILES=$(SLO)$/xmlrole.obj $(SLO)$/xmltok.obj
-+
-+.IF "$(BUILD_X64)"!=""
-+# ---------------- X64 stuff special ---------------------
-+#  use UNICODE only because shell/shlxthandler
-+#  doesn't link against ascii_expat_xmlparse
-+#---------------------------------------------------------
-+SLOFILES_X64=$(SLO_X64)$/xmlparse.obj \
-+             $(SLO_X64)$/xmlrole.obj \
-+             $(SLO_X64)$/xmltok.obj
-+CDEFS_X64+=-DXML_UNICODE -DWIN32
-+CFLAGS_X64+=-I..
-+LIB1TARGET_X64=$(SLB_X64)$/$(TARGET)_xmlparse.lib
-+LIB1OBJFILES_X64=$(SLO_X64)$/xmlparse.obj
-+LIB2TARGET_X64=$(SLB_X64)$/$(TARGET)_xmltok.lib
-+LIB2OBJFILES_X64=$(SLO_X64)$/xmlrole.obj $(SLO_X64)$/xmltok.obj
-+.ENDIF # "$(BUILD_X64)"!=""
-+
-+# --- Targets ------------------------------------------------------
-+.INCLUDE :  set_wntx64.mk
-+.INCLUDE :    target.mk
-+.INCLUDE :  tg_wntx64.mk
-diff -ru misc/expat-2.5.0/Changes misc/build/expat-2.5.0/Changes
---- misc/expat-2.5.0/Changes   2022-10-25 17:09:08.000000000 +0200
-+++ misc/build/expat-2.5.0/Changes     2023-02-06 23:22:40.572115558 +0100
-@@ -2,6 +2,9 @@
-       https://github.com/libexpat/libexpat/labels/help%20wanted
-       If you can help, please get in touch.  Thanks!
- 
-+Release 2.5.0-aoo Sat February 04 2023
-+        Adapted to AOO sources.
-+
- Release 2.5.0 Tue October 25 2022
-         Security fixes:
-   #616 #649 #650  CVE-2022-43680 -- Fix heap use-after-free after overeager
-diff -ru misc/expat-2.5.0/expat_config.h misc/build/expat-2.5.0/expat_config.h
---- misc/expat-2.5.0/expat_config.h    2022-10-25 17:34:58.000000000 +0200
-+++ misc/build/expat-2.5.0/expat_config.h      2023-02-06 23:22:40.604116318 
+0100
-@@ -14,7 +14,7 @@
- /* #undef HAVE_ARC4RANDOM */
- 
- /* Define to 1 if you have the `arc4random_buf' function. */
--#define HAVE_ARC4RANDOM_BUF 1
-+/* #undef HAVE_ARC4RANDOM_BUF */
- 
- /* Define to 1 if you have the <dlfcn.h> header file. */
- #define HAVE_DLFCN_H 1
-@@ -74,13 +74,13 @@
- #define PACKAGE "expat"
- 
- /* Define to the address where bug reports for this package should be sent. */
--#define PACKAGE_BUGREPORT "[email protected]"
-+#define PACKAGE_BUGREPORT "[email protected]"
- 
- /* Define to the full name of this package. */
- #define PACKAGE_NAME "expat"
- 
- /* Define to the full name and version of this package. */
--#define PACKAGE_STRING "expat 2.5.0"
-+#define PACKAGE_STRING "expat 2.5.0-aoo"
- 
- /* Define to the one symbol short name of this package. */
- #define PACKAGE_TARNAME "expat"
-@@ -89,7 +89,7 @@
- #define PACKAGE_URL ""
- 
- /* Define to the version of this package. */
--#define PACKAGE_VERSION "2.5.0"
-+#define PACKAGE_VERSION "2.5.0-aoo"
- 
- /* Define to 1 if all of the C90 standard headers exist (not just the ones
-    required in a freestanding environment). This macro is provided for
-@@ -97,7 +97,7 @@
- #define STDC_HEADERS 1
- 
- /* Version number of package */
--#define VERSION "2.5.0"
-+#define VERSION "2.5.0-aoo"
- 
- /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
-    significant byte first (like Motorola and SPARC, unlike Intel). */
-@@ -119,8 +119,10 @@
-    point. */
- #define XML_CONTEXT_BYTES 1024
- 
-+#if ! defined(_WIN32)
- /* Define to include code reading entropy from `/dev/urandom'. */
- #define XML_DEV_URANDOM 1
-+#endif
- 
- /* Define to make parameter entity parsing functionality available. */
- #define XML_DTD 1
-@@ -128,6 +130,11 @@
- /* Define to make XML Namespaces functionality available. */
- #define XML_NS 1
- 
-+/* Define to __FUNCTION__ or "" if `__func__' does not conform to ANSI C. */
-+#ifdef _MSC_VER
-+#  define __func__ __FUNCTION__
-+#endif
-+
- /* Define to empty if `const' does not conform to ANSI C. */
- /* #undef const */
- 
-diff -ru misc/expat-2.5.0/lib/siphash.h misc/build/expat-2.5.0/lib/siphash.h
---- misc/expat-2.5.0/lib/siphash.h     2022-10-23 17:16:56.000000000 +0200
-+++ misc/build/expat-2.5.0/lib/siphash.h       2023-02-06 23:22:40.588115938 
+0100
-@@ -99,7 +99,15 @@
- #define SIPHASH_H
- 
- #include <stddef.h> /* size_t */
--#include <stdint.h> /* uint64_t uint32_t uint8_t */
-+#if defined(_WIN32) && defined(_MSC_VER) && (_MSC_VER < 1600)
-+/* For vs2003/7.1 up to vs2008/9.0; _MSC_VER 1600 is vs2010/10.0 */
-+typedef unsigned __int8 uint8_t;
-+typedef unsigned __int32 uint32_t;
-+typedef unsigned __int64 uint64_t;
-+#else
-+#  include <stdint.h> /* uint64_t uint32_t uint8_t */
-+#endif
-+
- 
- /*
-  * Workaround to not require a C++11 compiler for using ULL suffix
-diff -ru misc/expat-2.5.0/lib/winconfig.h 
misc/build/expat-2.5.0/lib/winconfig.h
---- misc/expat-2.5.0/lib/winconfig.h   2022-10-24 18:32:55.000000000 +0200
-+++ misc/build/expat-2.5.0/lib/winconfig.h     2023-02-06 23:22:40.584115842 
+0100
-@@ -42,4 +42,11 @@
- #include <memory.h>
- #include <string.h>
- 
-+#  define XML_NS 1
-+#  define XML_DTD 1
-+#  define XML_CONTEXT_BYTES 1024
-+
-+/* we will assume all Windows platforms are little endian */
-+#  define BYTEORDER 1234
-+
- #endif /* ndef WINCONFIG_H */
-diff -ru misc/expat-2.5.0/lib/xmlparse.c misc/build/expat-2.5.0/lib/xmlparse.c
---- misc/expat-2.5.0/lib/xmlparse.c    2022-10-25 17:09:08.000000000 +0200
-+++ misc/build/expat-2.5.0/lib/xmlparse.c      2023-02-06 23:22:40.584115842 
+0100
-@@ -60,8 +60,6 @@
- 
- #define XML_BUILDING_EXPAT 1
- 
--#include <expat_config.h>
--
- #if ! defined(_GNU_SOURCE)
- #  define _GNU_SOURCE 1 /* syscall prototype */
- #endif
-@@ -79,9 +77,19 @@
- #include <limits.h> /* UINT_MAX */
- #include <stdio.h>  /* fprintf */
- #include <stdlib.h> /* getenv, rand_s */
--#include <stdint.h> /* uintptr_t */
- #include <math.h>   /* isnan */
- 
-+#if defined(_WIN32) && defined(_MSC_VER) && (_MSC_VER < 1600)
-+/* vs2008/9.0 and earlier lack stdint.h; _MSC_VER 1600 is vs2010/10.0 */
-+#  if defined(_WIN64)
-+typedef unsigned __int64 uintptr_t;
-+#  else
-+typedef unsigned __int32 uintptr_t;
-+#  endif
-+#else
-+#  include <stdint.h> /* uintptr_t */
-+#endif
-+
- #ifdef _WIN32
- #  define getpid GetCurrentProcessId
- #else
-@@ -94,7 +102,13 @@
- 
- #ifdef _WIN32
- #  include "winconfig.h"
-+#include <float.h>
-+#ifndef isnan
-+#define isnan _isnan
- #endif
-+#else
-+#  include <expat_config.h>
-+#endif /* ndef _WIN32 */
- 
- #include "ascii.h"
- #include "expat.h"
-@@ -720,7 +734,9 @@
- 
- XML_Parser XMLCALL
- XML_ParserCreateNS(const XML_Char *encodingName, XML_Char nsSep) {
--  XML_Char tmp[2] = {nsSep, 0};
-+  XML_Char tmp[2];
-+  tmp[0] = nsSep;
-+  tmp[1] = 0;
-   return XML_ParserCreate_MM(encodingName, NULL, tmp);
- }
- 
-@@ -1354,7 +1370,9 @@
-      would be otherwise.
-   */
-   if (parser->m_ns) {
--    XML_Char tmp[2] = {parser->m_namespaceSeparator, 0};
-+    XML_Char tmp[2];
-+    tmp[0] = parser->m_namespaceSeparator;
-+    tmp[1] = 0;
-     parser = parserCreate(encodingName, &parser->m_mem, tmp, newDtd);
-   } else {
-     parser = parserCreate(encodingName, &parser->m_mem, NULL, newDtd);
-@@ -3469,6 +3487,8 @@
-   i = 0;
-   if (nPrefixes) {
-     int j; /* hash table index */
-+    unsigned int nsAttsSize;
-+    unsigned char oldNsAttsPower;
-     unsigned long version = parser->m_nsAttsVersion;
- 
-     /* Detect and prevent invalid shift */
-@@ -3476,8 +3496,8 @@
-       return XML_ERROR_NO_MEMORY;
-     }
- 
--    unsigned int nsAttsSize = 1u << parser->m_nsAttsPower;
--    unsigned char oldNsAttsPower = parser->m_nsAttsPower;
-+    nsAttsSize = 1u << parser->m_nsAttsPower;
-+    oldNsAttsPower = parser->m_nsAttsPower;
-     /* size of hash table must be at least 2 * (# of prefixed attributes) */
-     if ((nPrefixes << 1)
-         >> parser->m_nsAttsPower) { /* true for m_nsAttsPower = 0 */
-@@ -3922,6 +3942,7 @@
-   if (parser->m_freeBindingList) {
-     b = parser->m_freeBindingList;
-     if (len > b->uriAlloc) {
-+      XML_Char *temp = NULL;
-       /* Detect and prevent integer overflow */
-       if (len > INT_MAX - EXPAND_SPARE) {
-         return XML_ERROR_NO_MEMORY;
-@@ -3937,7 +3958,7 @@
-       }
- #endif
- 
--      XML_Char *temp = (XML_Char *)REALLOC(
-+      temp = (XML_Char *)REALLOC(
-           parser, b->uri, sizeof(XML_Char) * (len + EXPAND_SPARE));
-       if (temp == NULL)
-         return XML_ERROR_NO_MEMORY;
-@@ -4638,11 +4659,6 @@
-          ASCII_I, ASCII_O, ASCII_N, ASCII_LPAREN, '\0'};
-   static const XML_Char enumValueSep[] = {ASCII_PIPE, '\0'};
-   static const XML_Char enumValueStart[] = {ASCII_LPAREN, '\0'};
--
--#ifndef XML_DTD
--  UNUSED_P(account);
--#endif
--
-   /* save one level of indirection */
-   DTD *const dtd = parser->m_dtd;
- 
-@@ -4650,6 +4666,10 @@
-   const char **eventEndPP;
-   enum XML_Content_Quant quant;
- 
-+#ifndef XML_DTD
-+  UNUSED_P(account);
-+#endif
-+
-   if (enc == parser->m_encoding) {
-     eventPP = &parser->m_eventPtr;
-     eventEndPP = &parser->m_eventEndPtr;
-@@ -5290,12 +5310,13 @@
-       if (parser->m_prologState.level >= parser->m_groupSize) {
-         if (parser->m_groupSize) {
-           {
-+          char *new_connector = NULL;
-             /* Detect and prevent integer overflow */
-             if (parser->m_groupSize > (unsigned int)(-1) / 2u) {
-               return XML_ERROR_NO_MEMORY;
-             }
- 
--            char *const new_connector = (char *)REALLOC(
-+            new_connector = (char *)REALLOC(
-                 parser, parser->m_groupConnector, parser->m_groupSize *= 2);
-             if (new_connector == NULL) {
-               parser->m_groupSize /= 2;
-@@ -5309,13 +5330,14 @@
-              * The preprocessor guard addresses the "always false" warning
-              * from -Wtype-limits on platforms where
-              * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
-+          int *new_scaff_index = NULL;
- #if UINT_MAX >= SIZE_MAX
-             if (parser->m_groupSize > (size_t)(-1) / sizeof(int)) {
-               return XML_ERROR_NO_MEMORY;
-             }
- #endif
- 
--            int *const new_scaff_index = (int *)REALLOC(
-+            new_scaff_index = (int *)REALLOC(
-                 parser, dtd->scaffIndex, parser->m_groupSize * sizeof(int));
-             if (new_scaff_index == NULL)
-               return XML_ERROR_NO_MEMORY;
-@@ -6404,13 +6426,14 @@
-       }
-     } else {
-       DEFAULT_ATTRIBUTE *temp;
-+      int count;
- 
-       /* Detect and prevent integer overflow */
-       if (type->allocDefaultAtts > INT_MAX / 2) {
-         return 0;
-       }
- 
--      int count = type->allocDefaultAtts * 2;
-+      count = type->allocDefaultAtts * 2;
- 
-       /* Detect and prevent integer overflow.
-        * The preprocessor guard addresses the "always false" warning
-@@ -7072,22 +7095,26 @@
-     /* check for overflow (table is half full) */
-     if (table->used >> (table->power - 1)) {
-       unsigned char newPower = table->power + 1;
-+      size_t newSize;
-+      unsigned long newMask;
-+      size_t tsize;
-+      NAMED **newV = NULL;
- 
-       /* Detect and prevent invalid shift */
-       if (newPower >= sizeof(unsigned long) * 8 /* bits per byte */) {
-         return NULL;
-       }
- 
--      size_t newSize = (size_t)1 << newPower;
--      unsigned long newMask = (unsigned long)newSize - 1;
-+      newSize = (size_t)1 << newPower;
-+      newMask = (unsigned long)newSize - 1;
- 
-       /* Detect and prevent integer overflow */
-       if (newSize > (size_t)(-1) / sizeof(NAMED *)) {
-         return NULL;
-       }
- 
--      size_t tsize = newSize * sizeof(NAMED *);
--      NAMED **newV = table->mem->malloc_fcn(tsize);
-+      tsize = newSize * sizeof(NAMED *);
-+      newV = table->mem->malloc_fcn(tsize);
-       if (! newV)
-         return NULL;
-       memset(newV, 0, tsize);
-@@ -7489,6 +7516,10 @@
-   DTD *const dtd = parser->m_dtd; /* save one level of indirection */
-   XML_Content *ret;
-   XML_Char *str; /* the current string writing location */
-+  size_t allocsize;
-+  XML_Content *dest = NULL;
-+  XML_Content *destLimit = NULL;
-+  XML_Content *jobDest = NULL;
- 
-   /* Detect and prevent integer overflow.
-    * The preprocessor guard addresses the "always false" warning
-@@ -7507,7 +7538,7 @@
-     return NULL;
-   }
- 
--  const size_t allocsize = (dtd->scaffCount * sizeof(XML_Content)
-+  allocsize = (dtd->scaffCount * sizeof(XML_Content)
-                             + (dtd->contentStringLen * sizeof(XML_Char)));
- 
-   ret = (XML_Content *)MALLOC(parser, allocsize);
-@@ -7563,9 +7594,9 @@
-    *
-    * - The algorithm repeats until all target array indices have been 
processed.
-    */
--  XML_Content *dest = ret; /* tree node writing location, moves upwards */
--  XML_Content *const destLimit = &ret[dtd->scaffCount];
--  XML_Content *jobDest = ret; /* next free writing location in target array */
-+  dest = ret; /* tree node writing location, moves upwards */
-+  destLimit = &ret[dtd->scaffCount];
-+  jobDest = ret; /* next free writing location in target array */
-   str = (XML_Char *)&ret[dtd->scaffCount];
- 
-   /* Add the starting job, the root node (index 0) of the source tree  */
-@@ -7670,13 +7701,14 @@
- static void
- accountingReportStats(XML_Parser originParser, const char *epilog) {
-   const XML_Parser rootParser = getRootParserOf(originParser, NULL);
-+  float amplificationFactor;
-   assert(! rootParser->m_parentParser);
- 
-   if (rootParser->m_accounting.debugLevel < 1) {
-     return;
-   }
- 
--  const float amplificationFactor
-+  amplificationFactor
-       = accountingGetCurrentAmplification(rootParser);
-   fprintf(stderr,
-           "expat: Accounting(%p): Direct " EXPAT_FMT_ULL(
-@@ -7696,6 +7728,10 @@
-                      unsigned int levelsAwayFromRootParser, const char 
*before,
-                      const char *after, ptrdiff_t bytesMore, int source_line,
-                      enum XML_Account account) {
-+  const char ellipis[] = "[..]";
-+  const size_t ellipsisLength = sizeof(ellipis) /* because compile-time */ - 
1;
-+  const unsigned int contextLength = 10;
-+  const char *walker = NULL;
-   assert(! rootParser->m_parentParser);
- 
-   fprintf(stderr,
-@@ -7703,12 +7739,8 @@
-           bytesMore, (account == XML_ACCOUNT_DIRECT) ? "DIR" : "EXP",
-           levelsAwayFromRootParser, source_line, 10, "");
- 
--  const char ellipis[] = "[..]";
--  const size_t ellipsisLength = sizeof(ellipis) /* because compile-time */ - 
1;
--  const unsigned int contextLength = 10;
--
-   /* Note: Performance is of no concern here */
--  const char *walker = before;
-+  walker = before;
-   if ((rootParser->m_accounting.debugLevel >= 3)
-       || (after - before)
-              <= (ptrdiff_t)(contextLength + ellipsisLength + contextLength)) {
-@@ -7732,6 +7764,14 @@
- accountingDiffTolerated(XML_Parser originParser, int tok, const char *before,
-                         const char *after, int source_line,
-                         enum XML_Account account) {
-+  unsigned int levelsAwayFromRootParser;
-+  XML_Parser rootParser;
-+  int isDirect;
-+  ptrdiff_t bytesMore;
-+  XmlBigCount *additionTarget = NULL;
-+  XmlBigCount countBytesOutput;
-+  float amplificationFactor;
-+  XML_Bool tolerated;
-   /* Note: We need to check the token type *first* to be sure that
-    *       we can even access variable <after>, safely.
-    *       E.g. for XML_TOK_NONE <after> may hold an invalid pointer. */
-@@ -7746,16 +7786,15 @@
-   if (account == XML_ACCOUNT_NONE)
-     return XML_TRUE; /* because these bytes have been accounted for, already 
*/
- 
--  unsigned int levelsAwayFromRootParser;
--  const XML_Parser rootParser
-+  rootParser
-       = getRootParserOf(originParser, &levelsAwayFromRootParser);
-   assert(! rootParser->m_parentParser);
- 
--  const int isDirect
-+  isDirect
-       = (account == XML_ACCOUNT_DIRECT) && (originParser == rootParser);
--  const ptrdiff_t bytesMore = after - before;
-+  bytesMore = after - before;
- 
--  XmlBigCount *const additionTarget
-+  additionTarget
-       = isDirect ? &rootParser->m_accounting.countBytesDirect
-                  : &rootParser->m_accounting.countBytesIndirect;
- 
-@@ -7764,12 +7803,12 @@
-     return XML_FALSE;
-   *additionTarget += bytesMore;
- 
--  const XmlBigCount countBytesOutput
-+  countBytesOutput
-       = rootParser->m_accounting.countBytesDirect
-         + rootParser->m_accounting.countBytesIndirect;
--  const float amplificationFactor
-+  amplificationFactor
-       = accountingGetCurrentAmplification(rootParser);
--  const XML_Bool tolerated
-+  tolerated
-       = (countBytesOutput < rootParser->m_accounting.activationThresholdBytes)
-         || (amplificationFactor
-             <= rootParser->m_accounting.maximumAmplificationFactor);
-@@ -7800,14 +7839,15 @@
- static void
- entityTrackingReportStats(XML_Parser rootParser, ENTITY *entity,
-                           const char *action, int sourceLine) {
-+  const char *entityName;
-   assert(! rootParser->m_parentParser);
-   if (rootParser->m_entity_stats.debugLevel < 1)
-     return;
- 
- #  if defined(XML_UNICODE)
--  const char *const entityName = "[..]";
-+  entityName = "[..]";
- #  else
--  const char *const entityName = entity->name;
-+  entityName = entity->name;
- #  endif
- 
-   fprintf(
-@@ -8387,14 +8427,17 @@
- static unsigned long
- getDebugLevel(const char *variableName, unsigned long defaultDebugLevel) {
-   const char *const valueOrNull = getenv(variableName);
-+  const char *value = NULL;
-+  char *afterValue = NULL;
-+  unsigned long debugLevel;
-   if (valueOrNull == NULL) {
-     return defaultDebugLevel;
-   }
--  const char *const value = valueOrNull;
-+  value = valueOrNull;
- 
-   errno = 0;
--  char *afterValue = (char *)value;
--  unsigned long debugLevel = strtoul(value, &afterValue, 10);
-+  afterValue = (char *)value;
-+  debugLevel = strtoul(value, &afterValue, 10);
-   if ((errno != 0) || (afterValue[0] != '\0')) {
-     errno = 0;
-     return defaultDebugLevel;
-diff -ru misc/expat-2.5.0/lib/xmltok.c misc/build/expat-2.5.0/lib/xmltok.c
---- misc/expat-2.5.0/lib/xmltok.c      2022-10-24 18:32:55.000000000 +0200
-+++ misc/build/expat-2.5.0/lib/xmltok.c        2023-02-06 23:22:40.588115938 
+0100
-@@ -44,14 +44,22 @@
-    USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
- 
--#include <expat_config.h>
--
- #include <stddef.h>
- #include <string.h> /* memcpy */
--#include <stdbool.h>
-+
-+#if defined(_MSC_VER) && (_MSC_VER <= 1700)
-+/* for vs2012/11.0/1700 and earlier Visual Studio compilers */
-+#  define bool int
-+#  define false 0
-+#  define true 1
-+#else
-+#  include <stdbool.h>
-+#endif
- 
- #ifdef _WIN32
- #  include "winconfig.h"
-+#else
-+#  include <expat_config.h>
- #endif
- 
- #include "expat_external.h"
-diff -ru misc/expat-2.5.0/tests/runtests.c 
misc/build/expat-2.5.0/tests/runtests.c
---- misc/expat-2.5.0/tests/runtests.c  2022-10-25 17:09:08.000000000 +0200
-+++ misc/build/expat-2.5.0/tests/runtests.c    2023-02-06 23:22:40.592116032 
+0100
-@@ -40,7 +40,15 @@
-    USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
- 
--#include <expat_config.h>
-+#ifdef _WIN32
-+#  include "winconfig.h"
-+#include <float.h>
-+#ifndef isnan
-+#define isnan _isnan
-+#endif
-+#else
-+#  include <expat_config.h>
-+#endif /* ndef _WIN32 */
- 
- #if defined(NDEBUG)
- #  undef NDEBUG /* because test suite relies on assert(...) at the moment */
-@@ -53,11 +61,28 @@
- #include <stddef.h> /* ptrdiff_t */
- #include <ctype.h>
- #include <limits.h>
--#include <stdint.h> /* intptr_t uint64_t */
-+
-+#if defined(_WIN32) && defined(_MSC_VER) && (_MSC_VER < 1600)
-+/* vs2008/9.0 and earlier lack stdint.h; _MSC_VER 1600 is vs2010/10.0 */
-+#  if defined(_WIN64)
-+typedef unsigned __int64 uintptr_t;
-+#  else
-+typedef unsigned __int32 uintptr_t;
-+#  endif
-+#else
-+#  include <stdint.h> /* uintptr_t */
-+#endif
- 
- #if ! defined(__cplusplus)
-+#if defined(_MSC_VER) && (_MSC_VER <= 1700)
-+/* for vs2012/11.0/1700 and earlier Visual Studio compilers */
-+#  define bool int
-+#  define false 0
-+#  define true 1
-+#else
- #  include <stdbool.h>
- #endif
-+#endif
- 
- #include "expat.h"
- #include "chardata.h"
-@@ -2666,8 +2691,8 @@
- static void XMLCALL
- element_decl_check_model(void *userData, const XML_Char *name,
-                          XML_Content *model) {
--  UNUSED_P(userData);
-   uint32_t errorFlags = 0;
-+  UNUSED_P(userData);
- 
-   /* Expected model array structure is this:
-    * [0] (type 6, quant 0)
-@@ -3926,10 +3951,9 @@
- #if defined(XML_CONTEXT_BYTES)
- START_TEST(test_get_buffer_3_overflow) {
-   XML_Parser parser = XML_ParserCreate(NULL);
--  assert(parser != NULL);
--
--  const char *const text = "\n";
-+  const char *text = "\n";
-   const int expectedKeepValue = (int)strlen(text);
-+  assert(parser != NULL);
- 
-   // After this call, variable "keep" in XML_GetBuffer will
-   // have value expectedKeepValue
-@@ -4992,8 +5016,8 @@
- 
- static void XMLCALL
- suspending_comment_handler(void *userData, const XML_Char *data) {
--  UNUSED_P(data);
-   XML_Parser parser = (XML_Parser)userData;
-+  UNUSED_P(data);
-   XML_StopParser(parser, XML_TRUE);
- }
- 
-@@ -6210,13 +6234,16 @@
-     for (; j < sizeof(atNameStart) / sizeof(atNameStart[0]); j++) {
-       const bool expectedSuccess
-           = atNameStart[j] ? cases[i].goodNameStart : cases[i].goodName;
-+      XML_Parser parser;
-+      enum XML_Status status;
-+      bool success;
-       sprintf(doc, "<%s%s><!--", atNameStart[j] ? "" : "a", cases[i].tagName);
--      XML_Parser parser = XML_ParserCreate(NULL);
-+      parser = XML_ParserCreate(NULL);
- 
--      const enum XML_Status status
-+      status
-           = XML_Parse(parser, doc, (int)strlen(doc), /*isFinal=*/XML_FALSE);
- 
--      bool success = true;
-+      success = true;
-       if ((status == XML_STATUS_OK) != expectedSuccess) {
-         success = false;
-       }
-@@ -6812,13 +6839,14 @@
-   CharData storage;
-   XML_Parser parser = XML_ParserCreate(NULL);
-   ParserPlusStorage parserPlusStorage = {parser, &storage};
--
-+  enum XML_Status status;
-+  
-   CharData_Init(&storage);
-   XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
-   XML_SetCommentHandler(parser, accumulate_and_suspend_comment_handler);
-   XML_SetUserData(parser, &parserPlusStorage);
- 
--  enum XML_Status status = XML_Parse(parser, text, (int)strlen(text), 
XML_TRUE);
-+  status = XML_Parse(parser, text, (int)strlen(text), XML_TRUE);
-   while (status == XML_STATUS_SUSPENDED) {
-     status = XML_ResumeParser(parser);
-   }
-@@ -10214,6 +10242,8 @@
-                                                  const XML_Char *base,
-                                                  const XML_Char *systemId,
-                                                  const XML_Char *publicId) {
-+  const XML_Char *encodingName = XCS("UTF-8"); // needs something non-NULL
-+  XML_Parser ext_parser;
-   UNUSED_P(base);
-   UNUSED_P(systemId);
-   UNUSED_P(publicId);
-@@ -10226,8 +10256,7 @@
-   // &(parser->m_mem));" in function parserInit.
-   allocation_count = 3;
- 
--  const XML_Char *const encodingName = XCS("UTF-8"); // needs something 
non-NULL
--  const XML_Parser ext_parser
-+  ext_parser
-       = XML_ExternalEntityParserCreate(parser, context, encodingName);
-   if (ext_parser != NULL)
-     fail(
-@@ -11718,14 +11747,17 @@
-                                        const XML_Char *base,
-                                        const XML_Char *systemId,
-                                        const XML_Char *publicId) {
--  UNUSED_P(context);
--  UNUSED_P(base);
--  UNUSED_P(publicId);
--
-   const struct AccountingTestCase *const testCase
-       = (const struct AccountingTestCase *)XML_GetUserData(parser);
- 
-   const char *externalText = NULL;
-+  XML_Parser entParser;
-+  XmlParseFunction xmlParseFunction;
-+  enum XML_Status status;
-+  UNUSED_P(context);
-+  UNUSED_P(base);
-+  UNUSED_P(publicId);
-+
-   if (xcstrcmp(systemId, XCS("first.ent")) == 0) {
-     externalText = testCase->firstExternalText;
-   } else if (xcstrcmp(systemId, XCS("second.ent")) == 0) {
-@@ -11735,13 +11767,13 @@
-   }
-   assert(externalText);
- 
--  XML_Parser entParser = XML_ExternalEntityParserCreate(parser, context, 0);
-+  entParser = XML_ExternalEntityParserCreate(parser, context, 0);
-   assert(entParser);
- 
--  const XmlParseFunction xmlParseFunction
-+  xmlParseFunction
-       = testCase->singleBytesWanted ? _XML_Parse_SINGLE_BYTES : XML_Parse;
- 
--  const enum XML_Status status = xmlParseFunction(
-+  status = xmlParseFunction(
-       entParser, externalText, (int)strlen(externalText), XML_TRUE);
- 
-   XML_ParserFree(entParser);
-@@ -11951,6 +11983,10 @@
-             + cases[u].expectedCountBytesIndirectExtra;
- 
-       XML_Parser parser = XML_ParserCreate(NULL);
-+      XmlParseFunction xmlParseFunction;
-+      enum XML_Status status;
-+      unsigned long long actualCountBytesDirect;
-+      unsigned long long actualCountBytesIndirect;
-       XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
-       if (cases[u].firstExternalText) {
-         XML_SetExternalEntityRefHandler(parser,
-@@ -11959,19 +11995,19 @@
-         cases[u].singleBytesWanted = singleBytesWanted;
-       }
- 
--      const XmlParseFunction xmlParseFunction
-+      xmlParseFunction
-           = singleBytesWanted ? _XML_Parse_SINGLE_BYTES : XML_Parse;
- 
--      enum XML_Status status
-+      status
-           = xmlParseFunction(parser, cases[u].primaryText,
-                              (int)strlen(cases[u].primaryText), XML_TRUE);
-       if (status != XML_STATUS_OK) {
-         _xml_failure(parser, __FILE__, __LINE__);
-       }
- 
--      const unsigned long long actualCountBytesDirect
-+      actualCountBytesDirect
-           = testingAccountingGetCountBytesDirect(parser);
--      const unsigned long long actualCountBytesIndirect
-+      actualCountBytesIndirect
-           = testingAccountingGetCountBytesIndirect(parser);
- 
-       XML_ParserFree(parser);
diff --git a/main/expat/expat-2.8.1.patch b/main/expat/expat-2.8.1.patch
new file mode 100644
index 0000000000..ed252a0b05
--- /dev/null
+++ b/main/expat/expat-2.8.1.patch
@@ -0,0 +1,195 @@
+--- misc/expat-2.8.1/lib/makefile.mk   2026-11-05 08:28:38
++++ misc/build/expat-2.8.1/lib/makefile.mk     2026-11-05 08:30:26
+@@ -1 +1,102 @@
+-dummy
++#**************************************************************
++#
++#  Licensed to the Apache Software Foundation (ASF) under one
++#  or more contributor license agreements.  See the NOTICE file
++#  distributed with this work for additional information
++#  regarding copyright ownership.  The ASF licenses this file
++#  to you under the Apache License, Version 2.0 (the
++#  "License"); you may not use this file except in compliance
++#  with the License.  You may obtain a copy of the License at
++#
++#    http://www.apache.org/licenses/LICENSE-2.0
++#
++#  Unless required by applicable law or agreed to in writing,
++#  software distributed under the License is distributed on an
++#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
++#  KIND, either express or implied.  See the License for the
++#  specific language governing permissions and limitations
++#  under the License.
++#
++#**************************************************************
++PRJ=..$/..$/..$/..$/..
++
++PRJNAME=expat
++TARGET=expat
++LIBTARGET=NO
++EXTERNAL_WARNINGS_NOT_ERRORS=TRUE
++
++# --- Settings -----------------------------------------------------
++.INCLUDE :  settings.mk
++# --- Files --------------------------------------------------------
++
++CFLAGS+=-I..
++
++.IF "$(OS)"=="WNT"
++CDEFS+=-DWIN32
++.ELSE
++CDEFS+=-DHAVE_EXPAT_CONFIG_H
++.ENDIF
++
++.IF "$(OS)"=="MACOSX" && "$(SYSBASE)"!=""
++CDEFS+=-DHAVE_MEMMOVE -DHAVE_BCOPY
++.ENDIF # "$(OS)"=="MACOSX"
++
++# Entropy sources. Same selection as lib/Makefile.am; on Unix it is read from
++# the expat_config.h that configure has just written.
++.IF "$(OS)"=="WNT"
++RANDOM_OBJS=$(SLO)$/random_rand_s.obj
++.ELSE
++RANDOM_OBJS=$(SLO)$/random_dev_urandom.obj
++.IF "$(shell grep -c 'define HAVE_ARC4RANDOM 1' ..$/expat_config.h || 
true)"!="0"
++RANDOM_OBJS+=$(SLO)$/random_arc4random.obj
++.ENDIF
++.IF "$(shell grep -c 'define HAVE_ARC4RANDOM_BUF 1' ..$/expat_config.h || 
true)"!="0"
++RANDOM_OBJS+=$(SLO)$/random_arc4random_buf.obj
++.ENDIF
++.IF "$(shell grep -c 'define HAVE_GETENTROPY 1' ..$/expat_config.h || 
true)"!="0"
++RANDOM_OBJS+=$(SLO)$/random_getentropy.obj
++.ENDIF
++.IF "$(shell grep -c -E 'define (HAVE_GETRANDOM|HAVE_SYSCALL_GETRANDOM) 1' 
..$/expat_config.h || true)"!="0"
++RANDOM_OBJS+=$(SLO)$/random_getrandom.obj
++.ENDIF
++.ENDIF
++
++SECOND_BUILD=UNICODE
++UNICODE_SLOFILES=$(SLO)$/xmlparse.obj
++UNICODECDEFS+=-DXML_UNICODE
++
++LIB1ARCHIV=$(LB)$/libascii_$(TARGET)_xmlparse.a
++LIB1TARGET=$(SLB)$/ascii_$(TARGET)_xmlparse.lib
++LIB1OBJFILES=$(SLO)$/xmlparse.obj
++
++LIB2ARCHIV=$(LB)$/lib$(TARGET)_xmlparse.a
++LIB2TARGET=$(SLB)$/$(TARGET)_xmlparse.lib
++LIB2OBJFILES =$(REAL_UNICODE_SLOFILES)
++
++# xmlparse calls the entropy functions, and both xmlparse libraries are
++# always linked ahead of this one, so they live here.
++LIB3ARCHIV=$(LB)$/lib$(TARGET)_xmltok.a
++LIB3TARGET=$(SLB)$/$(TARGET)_xmltok.lib
++LIB3OBJFILES=$(SLO)$/xmlrole.obj $(SLO)$/xmltok.obj $(RANDOM_OBJS)
++
++.IF "$(BUILD_X64)"!=""
++# ---------------- X64 stuff special ---------------------
++#  use UNICODE only because shell/shlxthandler
++#  doesn't link against ascii_expat_xmlparse
++#---------------------------------------------------------
++SLOFILES_X64=$(SLO_X64)$/xmlparse.obj \
++             $(SLO_X64)$/xmlrole.obj \
++             $(SLO_X64)$/xmltok.obj \
++             $(SLO_X64)$/random_rand_s.obj
++CDEFS_X64+=-DXML_UNICODE -DWIN32
++CFLAGS_X64+=-I..
++LIB1TARGET_X64=$(SLB_X64)$/$(TARGET)_xmlparse.lib
++LIB1OBJFILES_X64=$(SLO_X64)$/xmlparse.obj
++LIB2TARGET_X64=$(SLB_X64)$/$(TARGET)_xmltok.lib
++LIB2OBJFILES_X64=$(SLO_X64)$/xmlrole.obj $(SLO_X64)$/xmltok.obj 
$(SLO_X64)$/random_rand_s.obj
++.ENDIF # "$(BUILD_X64)"!=""
++
++# --- Targets ------------------------------------------------------
++.INCLUDE :  set_wntx64.mk
++.INCLUDE :    target.mk
++.INCLUDE :  tg_wntx64.mk
+--- misc/expat-2.8.1/expat_config.h    2026-11-05 08:28:38
++++ misc/build/expat-2.8.1/expat_config.h      2026-11-05 08:28:46
+@@ -11,10 +11,14 @@
+ #define BYTEORDER 1234
+ 
+ /* Define to 1 if you have the `arc4random' function. */
++#if ! defined(_WIN32)
+ #define HAVE_ARC4RANDOM 1
++#endif
+ 
+ /* Define to 1 if you have the `arc4random_buf' function. */
++#if ! defined(_WIN32)
+ #define HAVE_ARC4RANDOM_BUF 1
++#endif
+ 
+ /* define if the compiler supports basic C++11 syntax */
+ #define HAVE_CXX11 1
+@@ -26,13 +30,17 @@
+ #define HAVE_FCNTL_H 1
+ 
+ /* Define to 1 if you have the `getentropy' function. */
++#if ! defined(_WIN32)
+ #define HAVE_GETENTROPY 1
++#endif
+ 
+ /* Define to 1 if you have the 'getpagesize' function. */
+ #define HAVE_GETPAGESIZE 1
+ 
+ /* Define to 1 if you have the `getrandom' function. */
++#if ! defined(_WIN32)
+ #define HAVE_GETRANDOM 1
++#endif
+ 
+ /* Define to 1 if you have the <inttypes.h> header file. */
+ #define HAVE_INTTYPES_H 1
+@@ -56,7 +64,9 @@
+ #define HAVE_STRING_H 1
+ 
+ /* Define to 1 if you have `syscall' and `SYS_getrandom'. */
++#if ! defined(_WIN32)
+ #define HAVE_SYSCALL_GETRANDOM 1
++#endif
+ 
+ /* Define to 1 if you have the <sys/param.h> header file. */
+ #define HAVE_SYS_PARAM_H 1
+@@ -77,13 +87,13 @@
+ #define PACKAGE "expat"
+ 
+ /* Define to the address where bug reports for this package should be sent. */
+-#define PACKAGE_BUGREPORT "https://github.com/libexpat/libexpat/issues";
++#define PACKAGE_BUGREPORT "[email protected]"
+ 
+ /* Define to the full name of this package. */
+ #define PACKAGE_NAME "expat"
+ 
+ /* Define to the full name and version of this package. */
+-#define PACKAGE_STRING "expat 2.8.1"
++#define PACKAGE_STRING "expat 2.8.1-aoo"
+ 
+ /* Define to the one symbol short name of this package. */
+ #define PACKAGE_TARNAME "expat"
+@@ -92,7 +102,7 @@
+ #define PACKAGE_URL ""
+ 
+ /* Define to the version of this package. */
+-#define PACKAGE_VERSION "2.8.1"
++#define PACKAGE_VERSION "2.8.1-aoo"
+ 
+ /* Define to 1 if all of the C89 standard headers exist (not just the ones
+    required in a freestanding environment). This macro is provided for
+@@ -100,7 +110,7 @@
+ #define STDC_HEADERS 1
+ 
+ /* Version number of package */
+-#define VERSION "2.8.1"
++#define VERSION "2.8.1-aoo"
+ 
+ /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+    significant byte first (like Motorola and SPARC, unlike Intel). */
+@@ -123,7 +133,9 @@
+ #define XML_CONTEXT_BYTES 1024
+ 
+ /* Define to include code reading entropy from `/dev/urandom'. */
++#if ! defined(_WIN32)
+ #define XML_DEV_URANDOM 1
++#endif
+ 
+ /* Define to make parameter entity parsing functionality available. */
+ #define XML_DTD 1
diff --git a/main/expat/makefile.mk b/main/expat/makefile.mk
index 23dde2651c..3490bb77de 100644
--- a/main/expat/makefile.mk
+++ b/main/expat/makefile.mk
@@ -38,8 +38,8 @@ all:
 
 # --- Files --------------------------------------------------------
 
-TARFILE_NAME=expat-2.5.0
-TARFILE_MD5=5e9974d422dc4b157f300568ad28ebf6
+TARFILE_NAME=expat-2.8.1
+TARFILE_MD5=0e4b4a4fc77940a8d46194d57780f840
 ADDITIONAL_FILES=lib$/makefile.mk
 PATCH_FILES=$(TARFILE_NAME).patch
 
@@ -47,7 +47,7 @@ CONFIGURE_DIR=
 .IF "$(OS)"=="WNT"
 CONFIGURE_ACTION=
 .ELSE
-CONFIGURE_ACTION=.$/configure --without-docbook
+CONFIGURE_ACTION=.$/configure --without-docbook --without-iconv
 .ENDIF
 
 BUILD_DIR=lib
diff --git a/main/expat/prj/d.lst b/main/expat/prj/d.lst
index 2b14abf04a..5a721923f6 100644
--- a/main/expat/prj/d.lst
+++ b/main/expat/prj/d.lst
@@ -1,7 +1,7 @@
 mkdir: %_DEST%\inc%_EXT%\external\expat
 mkdir: %_DEST%\lib%_EXT%\x64
-..\%__SRC%\misc\build\expat-2.5.0\lib\expat.h 
%_DEST%\inc%_EXT%\external\expat.h
-..\%__SRC%\misc\build\expat-2.5.0\lib\expat_external.h 
%_DEST%\inc%_EXT%\external\expat_external.h
+..\%__SRC%\misc\build\expat-2.8.1\lib\expat.h 
%_DEST%\inc%_EXT%\external\expat.h
+..\%__SRC%\misc\build\expat-2.8.1\lib\expat_external.h 
%_DEST%\inc%_EXT%\external\expat_external.h
 ..\%__SRC%\slb\expat_xmltok.lib %_DEST%\lib%_EXT%\expat_xmltok.lib
 ..\%__SRC%\slb\expat_xmlparse.lib %_DEST%\lib%_EXT%\expat_xmlparse.lib
 ..\%__SRC%\slb\ascii_expat_xmlparse.lib 
%_DEST%\lib%_EXT%\ascii_expat_xmlparse.lib
diff --git a/main/external_deps.lst b/main/external_deps.lst
index 83bbbe17b7..0f46354aeb 100644
--- a/main/external_deps.lst
+++ b/main/external_deps.lst
@@ -158,9 +158,9 @@ if (SOLAR_JAVA==TRUE)
     URL2 = $(OOO_EXTRAS)$(MD5)-$(name)
 
 if (SYSTEM_OPENSSL!=YES)
-    MD5 = fabdcf86f3f54e27689253f85b738959
-    name = openssl-3.0.20.tar.gz
-    URL1 = 
https://github.com/openssl/openssl/releases/download/openssl-3.0.20/$(name)
+    MD5 = 4e59f265667c74aa82d426b016e194c9
+    name = openssl-3.0.21.tar.gz
+    URL1 = 
https://github.com/openssl/openssl/releases/download/openssl-3.0.21/$(name)
     URL2 = $(OOO_EXTRAS)$(MD5)-$(name)
 
 # On Windows, we need Strawberry Perl to build OpenSSL 3:
@@ -208,15 +208,28 @@ if (SYSTEM_VIGRA != YES)
     URL2 = $(OOO_EXTRAS)$(MD5)-$(name)
 
 if (SYSTEM_EXPAT != YES)
-    MD5 = 5e9974d422dc4b157f300568ad28ebf6
-    name = expat-2.5.0.tar.bz2
-    URL1 = 
https://github.com/libexpat/libexpat/releases/download/R_2_5_0/$(name)
+    MD5 = 0e4b4a4fc77940a8d46194d57780f840
+    name = expat-2.8.1.tar.bz2
+    URL1 = 
https://github.com/libexpat/libexpat/releases/download/R_2_8_1/$(name)
     URL2 = $(OOO_EXTRAS)$(MD5)-$(name)
 
-if (SYSTEM_CURL != YES)
+if (SYSTEM_CURL != YES && GUI != WNT)
+    MD5 = d45ab886d8224c77c91d7161ddc179c1
+    name = curl-8.23.0.tar.gz
+    URL1 = https://curl.se/download/$(name)
+    URL2 = $(OOO_EXTRAS)$(MD5)-$(name)
+
+# curl 8.23.0 dropped winbuild/, which curl-wnt.patch and the nmake build need
+if (SYSTEM_CURL != YES && GUI == WNT)
     MD5 = 92f7a11836678b725e2cb59fef10c273
     name = curl-8.7.1.tar.gz
-    URL1 = https://curl.haxx.se/download/$(name)
+    URL1 = https://curl.se/download/$(name)
+    URL2 = $(OOO_EXTRAS)$(MD5)-$(name)
+
+if (ENABLE_JEMALLOC == YES)
+    MD5 = e9abfa20270beb35e54043240ba37369
+    name = jemalloc-5.4.0.tar.bz2
+    URL1 = https://github.com/jemalloc/jemalloc/releases/download/5.4.0/$(name)
     URL2 = $(OOO_EXTRAS)$(MD5)-$(name)
 
 if (WITH_CATA_FONTS == YES)
diff --git a/main/expat/makefile.mk b/main/jemalloc/makefile.mk
similarity index 57%
copy from main/expat/makefile.mk
copy to main/jemalloc/makefile.mk
index 23dde2651c..ce05968e3b 100644
--- a/main/expat/makefile.mk
+++ b/main/jemalloc/makefile.mk
@@ -17,41 +17,51 @@
 #  specific language governing permissions and limitations
 #  under the License.
 #
-#**************************************************************
-
 
 
 PRJ=.
 
-PRJNAME=so_expat
-TARGET=so_expat
+PRJNAME=so_jemalloc
+TARGET=so_jemalloc
 
 # --- Settings -----------------------------------------------------
 
 .INCLUDE :     settings.mk
 
-.IF "$(SYSTEM_EXPAT)" == "YES"
+.IF "$(ENABLE_JEMALLOC)" != "YES"
 all:
-        @echo "An already available installation of expat should exist on your 
system."
-       @echo "Therefore the version provided here does not need to be built in 
addition."
+       @echo "jemalloc is not enabled; configure with --enable-jemalloc to 
build it."
 .ENDIF
 
 # --- Files --------------------------------------------------------
 
-TARFILE_NAME=expat-2.5.0
-TARFILE_MD5=5e9974d422dc4b157f300568ad28ebf6
-ADDITIONAL_FILES=lib$/makefile.mk
-PATCH_FILES=$(TARFILE_NAME).patch
+TARFILE_NAME=jemalloc-5.4.0
+TARFILE_MD5=e9abfa20270beb35e54043240ba37369
 
-CONFIGURE_DIR=
-.IF "$(OS)"=="WNT"
-CONFIGURE_ACTION=
-.ELSE
-CONFIGURE_ACTION=.$/configure --without-docbook
+CONFIGURE_DIR=.$/
+CONFIGURE_ACTION=.$/configure
+CONFIGURE_FLAGS=--disable-static --disable-cxx --disable-doc
+CONFIGURE_FLAGS+=CC="$(CC) $(ARCH_FLAGS)"
+
+.IF "$(OS)"=="LINUX"
+# libjemalloc is loaded together with libraries that dlopen() it late, which
+# the initial-exec TLS model does not allow.
+CONFIGURE_FLAGS+=--disable-initial-exec-tls
+.IF "$(CPUNAME)"=="AARCH64"
+# Linux/arm64 kernels come with 4K, 16K or 64K pages; 64K covers all of them.
+CONFIGURE_FLAGS+=--with-lg-page=16
 .ENDIF
+.ENDIF
+
+BUILD_DIR=$(CONFIGURE_DIR)
+BUILD_ACTION=$(GNUMAKE) build_lib_shared
+BUILD_FLAGS+= -j$(EXTMAXPROCESS)
 
-BUILD_DIR=lib
-BUILD_ACTION=dmake $(MFLAGS) $(CALLMACROS)
+.IF "$(OS)"=="MACOSX"
+OUT2LIB=lib$/libjemalloc.2.dylib
+.ELSE
+OUT2LIB=lib$/libjemalloc.so.2
+.ENDIF
 
 # --- Targets ------------------------------------------------------
 
diff --git a/main/jemalloc/prj/build.lst b/main/jemalloc/prj/build.lst
new file mode 100644
index 0000000000..5849949da4
--- /dev/null
+++ b/main/jemalloc/prj/build.lst
@@ -0,0 +1,3 @@
+je     jemalloc        :       soltools NULL
+je     jemalloc        usr1    -       all     je_mkout NULL
+je     jemalloc        nmake   -       all     je_jemalloc NULL
diff --git a/main/jemalloc/prj/d.lst b/main/jemalloc/prj/d.lst
new file mode 100644
index 0000000000..b94aa4a83b
--- /dev/null
+++ b/main/jemalloc/prj/d.lst
@@ -0,0 +1,3 @@
+..\%__SRC%\lib\libjemalloc.* %_DEST%\lib%_EXT%\libjemalloc.*
+
+linklib: libjemalloc.*.*
diff --git a/main/libxml2/makefile.mk b/main/libxml2/makefile.mk
index 3716ac0fbf..d88ef8b870 100644
--- a/main/libxml2/makefile.mk
+++ b/main/libxml2/makefile.mk
@@ -102,7 +102,7 @@ CONFIGURE_FLAGS=--enable-ipv6=no --without-python 
--without-zlib --without-lzma
 # 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 --without-iconv --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 --without-icu --without-readline 
--without-history --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 --without-iconv --enable-static=no --with-sax1=yes 
ADDCFLAGS="$(xml2_CFLAGS) $(EXTRA_CFLAGS)" LDFLAGS="$(xml2_LDFLAGS) 
$(EXTRA_LINKFLAGS)"
diff --git a/main/libxslt/makefile.mk b/main/libxslt/makefile.mk
index c4ca26c56b..18f7741ce4 100644
--- a/main/libxslt/makefile.mk
+++ b/main/libxslt/makefile.mk
@@ -118,7 +118,7 @@ CONFIGURE_ACTION=.$/configure
 # module just built. --with-libxml-prefix pins it to the bundled
 # xml2-config instead, matching the consumer-side fix in xmlsecurity/
 # forms.
-CONFIGURE_FLAGS=--enable-ipv6=no --without-crypto --without-python 
--enable-static=yes --enable-shared=no --with-sax1=yes 
--with-libxml-prefix=$(SOLARVERSION)/$(INPATH) ac_cv_func_clock_gettime=false
+CONFIGURE_FLAGS=--enable-ipv6=no --without-crypto --without-python 
--without-iconv --enable-static=yes --enable-shared=no --with-sax1=yes 
--with-libxml-prefix=$(SOLARVERSION)/$(INPATH) ac_cv_func_clock_gettime=false
 .ELSE
 CONFIGURE_FLAGS=--enable-ipv6=no --without-crypto --without-python 
--enable-static=no --with-sax1=yes ac_cv_func_clock_gettime=false
 .ENDIF
diff --git a/main/openssl/makefile.mk b/main/openssl/makefile.mk
index 587ed7f322..5944c983fa 100644
--- a/main/openssl/makefile.mk
+++ b/main/openssl/makefile.mk
@@ -38,10 +38,10 @@ TARGET=openssl
 .ENDIF
 
 
-OPENSSL_NAME=openssl-3.0.20
+OPENSSL_NAME=openssl-3.0.21
 
 TARFILE_NAME=$(OPENSSL_NAME)
-TARFILE_MD5=fabdcf86f3f54e27689253f85b738959
+TARFILE_MD5=4e59f265667c74aa82d426b016e194c9
 
 CONFIGURE_DIR=.
 CONFIGURE_ACTION=config
diff --git a/main/openssl/openssl.patch b/main/openssl/openssl.patch
index 985899516c..9c5a6858e2 100644
--- a/main/openssl/openssl.patch
+++ b/main/openssl/openssl.patch
@@ -1,5 +1,5 @@
---- misc/build/openssl-3.0.20/crypto/bio/bio_sock2.c
-+++ misc/build/openssl-3.0.20/crypto/bio/bio_sock2.c
+--- misc/build/openssl-3.0.21/crypto/bio/bio_sock2.c
++++ misc/build/openssl-3.0.21/crypto/bio/bio_sock2.c
 @@ -268,6 +268,10 @@
           * Therefore we always have to use setsockopt here.
           */
@@ -11,8 +11,8 @@
          if (setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY,
                  (const void *)&on, sizeof(on))
              != 0) {
---- misc/build/openssl-3.0.20/crypto/init.c
-+++ misc/build/openssl-3.0.20/crypto/init.c
+--- misc/build/openssl-3.0.21/crypto/init.c
++++ misc/build/openssl-3.0.21/crypto/init.c
 @@ -133,7 +133,7 @@
 
  #if !defined(OPENSSL_USE_NODELETE) \
@@ -31,8 +31,8 @@
          HMODULE handle = NULL;
          BOOL ret;
          union {
---- misc/build/openssl-3.0.20/crypto/threads_win.c
-+++ misc/build/openssl-3.0.20/crypto/threads_win.c
+--- misc/build/openssl-3.0.21/crypto/threads_win.c
++++ misc/build/openssl-3.0.21/crypto/threads_win.c
 @@ -54,7 +54,7 @@
          return NULL;
      }
diff --git a/main/openssl/opensslunx.patch b/main/openssl/opensslunx.patch
index 84829be5e9..c64f73ee9d 100644
--- a/main/openssl/opensslunx.patch
+++ b/main/openssl/opensslunx.patch
@@ -1,5 +1,5 @@
---- misc/build/openssl-3.0.20/Configurations/00-base-templates.conf    
2024-04-14 20:51:59.953276000 +0200
-+++ misc/build/openssl-3.0.20/Configurations/00-base-templates.conf    
2024-04-15 04:41:41.558374000 +0200
+--- misc/build/openssl-3.0.21/Configurations/00-base-templates.conf    
2024-04-14 20:51:59.953276000 +0200
++++ misc/build/openssl-3.0.21/Configurations/00-base-templates.conf    
2024-04-15 04:41:41.558374000 +0200
 @@ -67,9 +67,13 @@
  
          AR              => "ar",
diff --git a/main/python/makefile.mk b/main/python/makefile.mk
index 0919f12ac2..14c307e125 100644
--- a/main/python/makefile.mk
+++ b/main/python/makefile.mk
@@ -48,6 +48,11 @@ PATCH_FILES=\
        python-solver-before-std.patch \
        python-$(PYVERSION)-sysbase.patch \
        python-$(PYVERSION)-nohardlink.patch
+.IF "$(OS)"=="MACOSX"
+# Drops setup.py's /usr/local search paths and disables the modules that
+# would link host or SDK libraries (readline, curses, sqlite3, bz2, lzma, ...).
+PATCH_FILES+=python-$(PYVERSION)-selfcontained.patch
+.ENDIF
 # python-freebsd.patch: all hunks obsolete in Python 3.11 (upstream fixes).
 # python-ssl.patch: dropped. Python 3.11's setup.py finds the bundled OpenSSL
 #   through the compiler include/lib search paths instead of the old hard-coded
@@ -88,6 +93,34 @@ MYCWD=$(shell @pwd)/$(INPATH)/misc/build
 # undefined at import time.
 python_CFLAGS+=-I$(MYCWD)$/$(TARFILE_NAME)$/Modules$/expat
 
+.IF "$(OS)"=="MACOSX"
+# Self-contained build: configure and setup.py must see only the bundled zlib
+# and OpenSSL, never a copy that happens to be installed on the build machine
+# (pkg-config, /usr/local, /opt/local, the SDK). The bundled libraries are
+# delivered as external/zlib/zlib.h, external/openssl/ and libzlib.a, libssl.a,
+# libcrypto.a, so give configure a private prefix where they have the names it
+# looks for. OpenSSL is linked statically into _ssl and _hashlib; the shared
+# libraries carry a packaging-time install name that cannot be loaded here, and
+# lib-dynload could not find them next to the office libraries anyway.
+PY_SHIM=$(MYCWD)$/py-shim
+python_prep=mkdir -p $(PY_SHIM)/include $(PY_SHIM)/lib &&
+python_CFLAGS+=-I$(PY_SHIM)/include
+python_LDFLAGS+=-L$(PY_SHIM)/lib
+python_env=PKG_CONFIG_PATH= PKG_CONFIG_LIBDIR=/dev/null
+# Use the copies of expat and libmpdec that come with CPython. _ctypes still
+# links the OS libffi; the OS copy is always present.
+python_conf=--without-system-expat --without-system-libmpdec 
--without-system-ffi
+.IF "$(SYSTEM_ZLIB)"!="YES"
+python_prep+=ln -sf $(SOLARINCDIR)/external/zlib/zlib.h 
$(PY_SHIM)/include/zlib.h && ln -sf $(SOLARINCDIR)/external/zlib/zconf.h 
$(PY_SHIM)/include/zconf.h && ln -sf $(SOLARLIBDIR)/libzlib.a 
$(PY_SHIM)/lib/libz.a &&
+# Given directly because configure's fallback probe looks for gzread, which the
+# bundled zlib does not contain; the zlib module itself does not use it.
+python_conf+=ZLIB_CFLAGS="-I$(PY_SHIM)/include" ZLIB_LIBS="-L$(PY_SHIM)/lib 
-lz"
+.ENDIF
+.IF "$(SYSTEM_OPENSSL)"!="YES"
+python_prep+=ln -sfn $(SOLARINCDIR)/external/openssl 
$(PY_SHIM)/include/openssl && ln -sf $(SOLARLIBDIR)/libssl.a 
$(PY_SHIM)/lib/libssl.a && ln -sf $(SOLARLIBDIR)/libcrypto.a 
$(PY_SHIM)/lib/libcrypto.a &&
+python_conf+=--with-openssl=$(PY_SHIM)
+.ENDIF
+.ELSE
 # Point Python's setup.py at the bundled OpenSSL delivered to the solver.
 # (Replaces the old python-ssl.patch: Python 3.11 discovers _ssl/_hashlib via
 # the C compiler include/lib search paths, so feeding the solver's external
@@ -96,6 +129,7 @@ python_CFLAGS+=-I$(MYCWD)$/$(TARFILE_NAME)$/Modules$/expat
 # that setup.py's "openssl/ssl.h" probe resolves.)
 python_CFLAGS+=-I$(SOLARINCDIR)$/external
 python_LDFLAGS+=-L$(SOLARLIBDIR)
+.ENDIF
 
 # CLFLAGS get overwritten in Makefile.pre.in
 .IF "$(SYSBASE)"!=""
@@ -111,7 +145,7 @@ CC+:=$(ARCH_FLAGS)
 python_LDFLAGS+=$(ARCH_FLAGS)
 .ENDIF
 
-CONFIGURE_ACTION=$(AUGMENT_LIBRARY_PATH) ./configure 
--prefix=$(MYCWD)/python-inst --enable-shared CFLAGS="$(python_CFLAGS)" 
LDFLAGS="$(python_LDFLAGS)"
+CONFIGURE_ACTION=$(python_prep) $(AUGMENT_LIBRARY_PATH) $(python_env) 
./configure --prefix=$(MYCWD)/python-inst --enable-shared $(python_conf) 
CFLAGS="$(python_CFLAGS)" LDFLAGS="$(python_LDFLAGS)"
 .IF "$(OS)$(CPU)" == "SOLARISI"
 CONFIGURE_ACTION += --disable-ipv6
 .ENDIF
diff --git a/main/python/python-3.11.15-selfcontained.patch 
b/main/python/python-3.11.15-selfcontained.patch
new file mode 100644
index 0000000000..ad8aa7f618
--- /dev/null
+++ b/main/python/python-3.11.15-selfcontained.patch
@@ -0,0 +1,23 @@
+--- misc/build/Python-3.11.15/setup.py
++++ misc/build/Python-3.11.15/setup.py
+@@ -844,12 +844,8 @@
+                         add_dir_to_list(dir_list, directory)
+ 
+     def configure_compiler(self):
+-        # Ensure that /usr/local is always used, but the local build
+-        # directories (i.e. '.' and 'Include') must be first.  See issue
+-        # 10520.
+-        if not CROSS_COMPILING:
+-            add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
+-            add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
++        # Do not search /usr/local: libraries installed there on the build
++        # machine must not leak into the bundled interpreter.
+         # only change this for cross builds for 3.3, issues on Mageia
+         if CROSS_COMPILING:
+             self.add_cross_compiling_paths()
+--- misc/build/Python-3.11.15/Modules/Setup.local
++++ misc/build/Python-3.11.15/Modules/Setup.local
+@@ -0,0 +1,3 @@
++# AOO: do not build modules that need libraries from the build machine or SDK.
++*disabled*
++readline _curses _curses_panel _sqlite3 _bz2 _lzma _gdbm _dbm _tkinter _uuid 
nis
diff --git a/main/scp2/source/ooo/file_library_ooo.scp 
b/main/scp2/source/ooo/file_library_ooo.scp
index 345048aa2f..b8d4f03c84 100644
--- a/main/scp2/source/ooo/file_library_ooo.scp
+++ b/main/scp2/source/ooo/file_library_ooo.scp
@@ -227,6 +227,21 @@ End
 
 #endif
 
+#ifdef ENABLE_JEMALLOC
+
+File gid_File_Lib_Jemalloc
+    TXT_FILE_BODY;
+    Styles = (PACKED);
+    Dir = SCP2_OOO_BIN_DIR;
+  #ifdef MACOSX
+    Name = STRING(CONCAT2(libjemalloc.2,UNXSUFFIX));
+  #else
+    Name = STRING(CONCAT3(libjemalloc,UNXSUFFIX,.2));
+  #endif
+End
+
+#endif
+
 #ifdef UNX
 #ifdef ENABLE_GTK
 #ifdef ENABLE_SYSTRAY_GTK
diff --git a/main/scp2/source/ooo/makefile.mk b/main/scp2/source/ooo/makefile.mk
index 04fe5c2985..5df438f0b4 100644
--- a/main/scp2/source/ooo/makefile.mk
+++ b/main/scp2/source/ooo/makefile.mk
@@ -138,6 +138,10 @@ SCPDEFS+=-DWITH_LDAP
 SCPDEFS+=-DSYSTEM_CURL
 .ENDIF
 
+.IF "$(ENABLE_JEMALLOC)" == "YES"
+SCPDEFS+=-DENABLE_JEMALLOC
+.ENDIF
+
 .IF "$(SYSTEM_STDLIBS)" == "YES"
 SCPDEFS+=-DSYSTEM_STDLIBS
 .ENDIF
diff --git a/main/scp2/source/ooo/module_hidden_ooo.scp 
b/main/scp2/source/ooo/module_hidden_ooo.scp
index 8878189f6b..392d837c86 100644
--- a/main/scp2/source/ooo/module_hidden_ooo.scp
+++ b/main/scp2/source/ooo/module_hidden_ooo.scp
@@ -299,6 +299,7 @@ Module gid_Module_Root_Files_5
        gid_File_Lib_Adabas,
        gid_File_Lib_Cached1,
        gid_File_Lib_Curl,
+       gid_File_Lib_Jemalloc,
        gid_File_Lib_Db,
        gid_File_Lib_Dbpool,
        gid_File_Lib_Embobj,
diff --git a/main/scp2/source/ooo/ure.scp b/main/scp2/source/ooo/ure.scp
index 615b96946f..b58634ef3a 100644
--- a/main/scp2/source/ooo/ure.scp
+++ b/main/scp2/source/ooo/ure.scp
@@ -840,7 +840,8 @@ File gid_File_Dl_Uuresolver
     Styles = (PACKED, VERSION_INDEPENDENT_COMP_ID);
 End
 
-#if !defined SYSTEM_LIBXML
+// On macOS libxml2 is linked in statically; there is no dylib to ship.
+#if !defined SYSTEM_LIBXML && !defined MACOSX
 File gid_File_Dl_Libxml2
     TXT_FILE_BODY;
     Dir = SCP2_URE_DL_DIR;
diff --git a/main/set_soenv.in b/main/set_soenv.in
index 2645a39248..8cf59bf3fe 100644
--- a/main/set_soenv.in
+++ b/main/set_soenv.in
@@ -2016,6 +2016,7 @@ ToFile( "MINGWCXX",          "@MINGWCXX@",       "e" );
 ToFile( "MINGWSTRIP",        "@MINGWSTRIP@",     "e" );
 ToFile( "USE_SYSTEM_STL",    "@USE_SYSTEM_STL@", "e" );
 ToFile( "ALLOC",             "@ALLOC@",          "e" );
+ToFile( "ENABLE_JEMALLOC",   "@ENABLE_JEMALLOC@","e" );
 ToFile( "ENABLE_SYMBOLS",    "@ENABLE_SYMBOLS@",    "e" );
 ToFile( "DISABLE_STRIP",     "@DISABLE_STRIP@",     "e" );
 ToFile( "LFS_CFLAGS",        "@LFS_CFLAGS@",     "e" );
diff --git a/main/solenv/inc/unxlng.mk b/main/solenv/inc/unxlng.mk
index abe9832f19..5d638a5704 100644
--- a/main/solenv/inc/unxlng.mk
+++ b/main/solenv/inc/unxlng.mk
@@ -214,7 +214,7 @@ STDSHLGUIMT+=-ltcmalloc
 STDSHLCUIMT+=-ltcmalloc
 .ENDIF
 
-.IF "$(ALLOC)" == "JEMALLOC"
+.IF "$(ALLOC)" == "JEMALLOC" && "$(ENABLE_JEMALLOC)" != "YES"
 STDLIBGUIMT+=-ljemalloc
 STDLIBCUIMT+=-ljemalloc
 STDSHLGUIMT+=-ljemalloc

Reply via email to