diff --git a/cpython-unix/build-cpython.sh b/cpython-unix/build-cpython.sh index 25ee091b..614f6b4c 100755 --- a/cpython-unix/build-cpython.sh +++ b/cpython-unix/build-cpython.sh @@ -146,6 +146,12 @@ if [ -n "${PYTHON_MEETS_MAXIMUM_VERSION_3_10}" ]; then patch -p1 -i ${ROOT}/patch-makesetup-deduplicate-objs.patch fi +# testembed links against Tcl/Tk and libpython which already has Tcl/Tk leading +# duplicate symbols and warnings from objc (which causes test failures). +if [ -n "${PYTHON_MEETS_MAXIMUM_VERSION_3_13}" ]; then + patch -p1 -i ${ROOT}/patch-make-testembed-nolink-tcltk.patch +fi + # The default build rule for the macOS dylib doesn't pick up libraries # from modules / makesetup. So patch it accordingly. if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_13}" ]; then diff --git a/cpython-unix/patch-make-testembed-nolink-tcltk.patch b/cpython-unix/patch-make-testembed-nolink-tcltk.patch new file mode 100644 index 00000000..65c1989f --- /dev/null +++ b/cpython-unix/patch-make-testembed-nolink-tcltk.patch @@ -0,0 +1,10 @@ +diff --git a/Makefile.pre.in b/Makefile.pre.in +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1432,6 +1432,8 @@ + $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/build/generate_re_casefix.py $(srcdir)/Lib/re/_casefix.py + + Programs/_testembed: Programs/_testembed.o $(LINK_PYTHON_DEPS) ++ $(eval MODLIBS := $(subst -Xlinker -hidden-ltcl8.6, , $(MODLIBS))) ++ $(eval MODLIBS := $(subst -Xlinker -hidden-ltk8.6, , $(MODLIBS))) + $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/_testembed.o $(LINK_PYTHON_OBJS) $(LIBS) $(MODLIBS) $(SYSLIBS)