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

commit 1bee6009929e8d9702c129fac7b07f6d4113cebb
Author: Jim Jagielski <[email protected]>
AuthorDate: Tue Aug 4 10:17:39 2026 -0400

    python: prefer CPython's own expat.h over the solver's external copy
---
 main/python/makefile.mk | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/main/python/makefile.mk b/main/python/makefile.mk
index 042a4cf092..55712c9097 100644
--- a/main/python/makefile.mk
+++ b/main/python/makefile.mk
@@ -76,6 +76,18 @@ CONFIGURE_DIR=
 BUILD_DIR=
 MYCWD=$(shell @pwd)/$(INPATH)/misc/build
 
+# CPython's own vendored expat (Modules/expat/expat.h) renames every public
+# symbol via pyexpatns.h so it can't clash with any expat also loaded into the
+# process. The solver's external include dir below also carries AOO's own
+# flat expat.h (main/expat delivers it to inc/external/expat.h for other
+# modules), which has no such renaming. Since -I dirs are searched in the
+# order given, put Python's own Modules/expat ahead of the solver dir so
+# "expat.h" resolves to CPython's copy — otherwise pyexpat.c/_elementtree.c
+# compile against the un-renamed declarations while linking against the
+# renamed symbols in libexpat.a, leaving XML_SetCommentHandler (and friends)
+# undefined at import time.
+python_CFLAGS+=-I$(MYCWD)$/$(TARFILE_NAME)$/Modules$/expat
+
 # 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

Reply via email to