diff --git a/Makefile b/Makefile
index 0aa9c0d2..b34d7e05 100644
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,7 @@ BUILD_NUMBER=custom
# of a release cycle, as official binaries won't be published.
# PYTHON_MICRO_VERSION is the full version number, without any alpha/beta/rc suffix. (e.g., 3.10.0)
# PYTHON_VER is the major/minor version (e.g., 3.10)
-PYTHON_VERSION=3.14.0a4
+PYTHON_VERSION=3.14.0a5
PYTHON_PKG_VERSION=$(PYTHON_VERSION)
PYTHON_MICRO_VERSION=$(shell echo $(PYTHON_VERSION) | grep -Eo "\d+\.\d+\.\d+")
PYTHON_PKG_MICRO_VERSION=$(shell echo $(PYTHON_PKG_VERSION) | grep -Eo "\d+\.\d+\.\d+")
@@ -27,10 +27,10 @@ PYTHON_VER=$(basename $(PYTHON_VERSION))
# The binary releases of dependencies, published at:
# https://github.com/beeware/cpython-apple-source-deps/releases
BZIP2_VERSION=1.0.8-1
-LIBFFI_VERSION=3.4.6-1
+LIBFFI_VERSION=3.4.7-1
MPDECIMAL_VERSION=4.0.0-1
-OPENSSL_VERSION=3.0.15-1
-XZ_VERSION=5.6.2-1
+OPENSSL_VERSION=3.0.16-1
+XZ_VERSION=5.6.4-1
# Supported OS
OS_LIST=macOS iOS tvOS watchOS
diff --git a/patch/Python/Python.patch b/patch/Python/Python.patch
index 6137a65d..910f33c2 100644
--- a/patch/Python/Python.patch
+++ b/patch/Python/Python.patch
@@ -113,10 +113,10 @@ index 1f6baed66d3..235dd98c60a 100644
macos_release = mac_ver()[0]
if macos_release:
diff --git a/Lib/sysconfig/__init__.py b/Lib/sysconfig/__init__.py
-index 7a4a8f65a5e..04ceb922249 100644
+index 69f72452c40..34ce643340b 100644
--- a/Lib/sysconfig/__init__.py
+++ b/Lib/sysconfig/__init__.py
-@@ -691,6 +691,14 @@
+@@ -719,6 +719,14 @@
release = get_config_vars().get("IPHONEOS_DEPLOYMENT_TARGET", "13.0")
osname = sys.platform
machine = sys.implementation._multiarch
@@ -163,7 +163,7 @@ index ec0857a4a99..2350e9dc821 100644
# elif !defined(TARGET_OS_OSX) || TARGET_OS_OSX
PLATFORM_TRIPLET=darwin
diff --git a/configure b/configure
-index 70581e11b60..249a67228b0 100755
+index d46bc563a67..d5cd81d16a8 100755
--- a/configure
+++ b/configure
@@ -974,6 +974,8 @@
@@ -175,7 +175,7 @@ index 70581e11b60..249a67228b0 100755
IPHONEOS_DEPLOYMENT_TARGET
EXPORT_MACOSX_DEPLOYMENT_TARGET
CONFIGURE_MACOSX_DEPLOYMENT_TARGET
-@@ -4097,6 +4099,12 @@
+@@ -4100,6 +4102,12 @@
*-apple-ios*)
ac_sys_system=iOS
;;
@@ -188,7 +188,7 @@ index 70581e11b60..249a67228b0 100755
*-*-darwin*)
ac_sys_system=Darwin
;;
-@@ -4177,7 +4185,7 @@
+@@ -4181,7 +4189,7 @@
# On cross-compile builds, configure will look for a host-specific compiler by
# prepending the user-provided host triple to the required binary name.
#
@@ -197,7 +197,7 @@ index 70581e11b60..249a67228b0 100755
# which isn't a binary that exists, and isn't very convenient, as it contains the
# iOS version. As the default cross-compiler name won't exist, configure falls
# back to gcc, which *definitely* won't work. We're providing wrapper scripts for
-@@ -4192,6 +4200,14 @@
+@@ -4196,6 +4204,14 @@
aarch64-apple-ios*-simulator) AR=arm64-apple-ios-simulator-ar ;;
aarch64-apple-ios*) AR=arm64-apple-ios-ar ;;
x86_64-apple-ios*-simulator) AR=x86_64-apple-ios-simulator-ar ;;
@@ -212,7 +212,7 @@ index 70581e11b60..249a67228b0 100755
*)
esac
fi
-@@ -4200,6 +4216,14 @@
+@@ -4204,6 +4220,14 @@
aarch64-apple-ios*-simulator) CC=arm64-apple-ios-simulator-clang ;;
aarch64-apple-ios*) CC=arm64-apple-ios-clang ;;
x86_64-apple-ios*-simulator) CC=x86_64-apple-ios-simulator-clang ;;
@@ -227,7 +227,7 @@ index 70581e11b60..249a67228b0 100755
*)
esac
fi
-@@ -4208,6 +4232,14 @@
+@@ -4212,6 +4236,14 @@
aarch64-apple-ios*-simulator) CPP=arm64-apple-ios-simulator-cpp ;;
aarch64-apple-ios*) CPP=arm64-apple-ios-cpp ;;
x86_64-apple-ios*-simulator) CPP=x86_64-apple-ios-simulator-cpp ;;
@@ -242,7 +242,7 @@ index 70581e11b60..249a67228b0 100755
*)
esac
fi
-@@ -4216,6 +4248,14 @@
+@@ -4220,6 +4252,14 @@
aarch64-apple-ios*-simulator) CXX=arm64-apple-ios-simulator-clang++ ;;
aarch64-apple-ios*) CXX=arm64-apple-ios-clang++ ;;
x86_64-apple-ios*-simulator) CXX=x86_64-apple-ios-simulator-clang++ ;;
@@ -257,7 +257,7 @@ index 70581e11b60..249a67228b0 100755
*)
esac
fi
-@@ -4338,8 +4378,10 @@
+@@ -4342,8 +4382,10 @@
case $enableval in
yes)
case $ac_sys_system in
@@ -270,7 +270,7 @@ index 70581e11b60..249a67228b0 100755
*) as_fn_error $? "Unknown platform for framework build" "$LINENO" 5
esac
esac
-@@ -4348,6 +4390,8 @@
+@@ -4352,6 +4394,8 @@
no)
case $ac_sys_system in
iOS) as_fn_error $? "iOS builds must use --enable-framework" "$LINENO" 5 ;;
@@ -279,7 +279,7 @@ index 70581e11b60..249a67228b0 100755
*)
PYTHONFRAMEWORK=
PYTHONFRAMEWORKDIR=no-framework
-@@ -4454,6 +4498,36 @@
+@@ -4458,6 +4502,36 @@
ac_config_files="$ac_config_files iOS/Resources/Info.plist"
@@ -316,7 +316,7 @@ index 70581e11b60..249a67228b0 100755
;;
*)
as_fn_error $? "Unknown platform for framework build" "$LINENO" 5
-@@ -4465,6 +4539,8 @@
+@@ -4469,6 +4543,8 @@
e)
case $ac_sys_system in
iOS) as_fn_error $? "iOS builds must use --enable-framework" "$LINENO" 5 ;;
@@ -325,7 +325,7 @@ index 70581e11b60..249a67228b0 100755
*)
PYTHONFRAMEWORK=
PYTHONFRAMEWORKDIR=no-framework
-@@ -4519,8 +4595,8 @@
+@@ -4523,8 +4599,8 @@
case "$withval" in
yes)
case $ac_sys_system in
@@ -336,7 +336,7 @@ index 70581e11b60..249a67228b0 100755
APP_STORE_COMPLIANCE_PATCH="Mac/Resources/app-store-compliance.patch"
;;
*) as_fn_error $? "no default app store compliance patch available for $ac_sys_system" "$LINENO" 5 ;;
-@@ -4538,8 +4614,8 @@
+@@ -4542,8 +4618,8 @@
else case e in #(
e)
case $ac_sys_system in
@@ -347,7 +347,7 @@ index 70581e11b60..249a67228b0 100755
APP_STORE_COMPLIANCE_PATCH="Mac/Resources/app-store-compliance.patch"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: applying default app store compliance patch" >&5
printf "%s\n" "applying default app store compliance patch" >&6; }
-@@ -4594,6 +4670,50 @@
+@@ -4598,6 +4674,50 @@
;;
esac
;;
@@ -398,7 +398,7 @@ index 70581e11b60..249a67228b0 100755
*-*-darwin*)
case "$host_cpu" in
arm*)
-@@ -4684,9 +4804,13 @@
+@@ -4688,9 +4808,13 @@
define_xopen_source=no;;
Darwin/[12][0-9].*)
define_xopen_source=no;;
@@ -413,7 +413,7 @@ index 70581e11b60..249a67228b0 100755
# On QNX 6.3.2, defining _XOPEN_SOURCE prevents netdb.h from
# defining NI_NUMERICHOST.
QNX/6.3.2)
-@@ -4749,7 +4873,10 @@
+@@ -4753,7 +4877,10 @@
CONFIGURE_MACOSX_DEPLOYMENT_TARGET=
EXPORT_MACOSX_DEPLOYMENT_TARGET='#'
@@ -425,7 +425,7 @@ index 70581e11b60..249a67228b0 100755
# checks for alternative programs
-@@ -4790,6 +4917,16 @@
+@@ -4794,6 +4921,16 @@
as_fn_append CFLAGS " -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET}"
as_fn_append LDFLAGS " -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET}"
;; #(
@@ -442,7 +442,7 @@ index 70581e11b60..249a67228b0 100755
*) :
;;
esac
-@@ -7159,6 +7296,10 @@
+@@ -7163,6 +7300,10 @@
MULTIARCH="" ;; #(
iOS) :
MULTIARCH="" ;; #(
@@ -453,7 +453,7 @@ index 70581e11b60..249a67228b0 100755
FreeBSD*) :
MULTIARCH="" ;; #(
*) :
-@@ -7179,7 +7320,7 @@
+@@ -7183,7 +7324,7 @@
printf "%s\n" "$MULTIARCH" >&6; }
case $ac_sys_system in #(
@@ -462,7 +462,7 @@ index 70581e11b60..249a67228b0 100755
SOABI_PLATFORM=`echo "$PLATFORM_TRIPLET" | cut -d '-' -f2` ;; #(
*) :
SOABI_PLATFORM=$PLATFORM_TRIPLET
-@@ -7230,6 +7371,14 @@
+@@ -7234,6 +7375,14 @@
PY_SUPPORT_TIER=3 ;; #(
aarch64-apple-ios*/clang) :
PY_SUPPORT_TIER=3 ;; #(
@@ -477,7 +477,7 @@ index 70581e11b60..249a67228b0 100755
aarch64-*-linux-android/clang) :
PY_SUPPORT_TIER=3 ;; #(
x86_64-*-linux-android/clang) :
-@@ -7666,7 +7815,7 @@
+@@ -7670,7 +7819,7 @@
case $ac_sys_system in
Darwin)
LDLIBRARY='$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)';;
@@ -486,7 +486,7 @@ index 70581e11b60..249a67228b0 100755
LDLIBRARY='$(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK)';;
*)
as_fn_error $? "Unknown platform for framework build" "$LINENO" 5;;
-@@ -7732,7 +7881,7 @@
+@@ -7736,7 +7885,7 @@
BLDLIBRARY='-L. -lpython$(LDVERSION)'
RUNSHARED=DYLD_LIBRARY_PATH=`pwd`${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}}
;;
@@ -495,7 +495,7 @@ index 70581e11b60..249a67228b0 100755
LDLIBRARY='libpython$(LDVERSION).dylib'
;;
AIX*)
-@@ -13540,7 +13689,7 @@
+@@ -13544,7 +13693,7 @@
BLDSHARED="$LDSHARED"
fi
;;
@@ -504,7 +504,7 @@ index 70581e11b60..249a67228b0 100755
LDSHARED='$(CC) -dynamiclib -F . -framework $(PYTHONFRAMEWORK)'
LDCXXSHARED='$(CXX) -dynamiclib -F . -framework $(PYTHONFRAMEWORK)'
BLDSHARED="$LDSHARED"
-@@ -13673,7 +13822,7 @@
+@@ -13677,7 +13826,7 @@
Linux-android*) LINKFORSHARED="-pie -Xlinker -export-dynamic";;
Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
# -u libsys_s pulls in all symbols in libsys
@@ -513,7 +513,7 @@ index 70581e11b60..249a67228b0 100755
LINKFORSHARED="$extra_undefs -framework CoreFoundation"
# Issue #18075: the default maximum stack size (8MBytes) is too
-@@ -13697,7 +13846,7 @@
+@@ -13701,7 +13850,7 @@
LINKFORSHARED="$LINKFORSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
fi
LINKFORSHARED="$LINKFORSHARED"
@@ -522,7 +522,7 @@ index 70581e11b60..249a67228b0 100755
LINKFORSHARED="-Wl,-stack_size,$stack_size $LINKFORSHARED "'$(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK)'
fi
;;
-@@ -15282,7 +15431,7 @@
+@@ -15286,7 +15435,7 @@
ctypes_malloc_closure=yes
;; #(
@@ -531,7 +531,7 @@ index 70581e11b60..249a67228b0 100755
ctypes_malloc_closure=yes
;; #(
-@@ -19031,12 +19180,6 @@
+@@ -19038,12 +19187,6 @@
then :
printf "%s\n" "#define HAVE_DUP3 1" >>confdefs.h
@@ -544,7 +544,7 @@ index 70581e11b60..249a67228b0 100755
fi
ac_fn_c_check_func "$LINENO" "explicit_bzero" "ac_cv_func_explicit_bzero"
if test "x$ac_cv_func_explicit_bzero" = xyes
-@@ -19097,18 +19240,6 @@
+@@ -19104,18 +19247,6 @@
then :
printf "%s\n" "#define HAVE_FEXECVE 1" >>confdefs.h
@@ -563,7 +563,7 @@ index 70581e11b60..249a67228b0 100755
fi
ac_fn_c_check_func "$LINENO" "fpathconf" "ac_cv_func_fpathconf"
if test "x$ac_cv_func_fpathconf" = xyes
-@@ -19535,24 +19666,6 @@
+@@ -19542,24 +19673,6 @@
then :
printf "%s\n" "#define HAVE_POSIX_OPENPT 1" >>confdefs.h
@@ -588,7 +588,7 @@ index 70581e11b60..249a67228b0 100755
fi
ac_fn_c_check_func "$LINENO" "pread" "ac_cv_func_pread"
if test "x$ac_cv_func_pread" = xyes
-@@ -19853,12 +19966,6 @@
+@@ -19860,12 +19973,6 @@
then :
printf "%s\n" "#define HAVE_SIGACTION 1" >>confdefs.h
@@ -601,7 +601,7 @@ index 70581e11b60..249a67228b0 100755
fi
ac_fn_c_check_func "$LINENO" "sigfillset" "ac_cv_func_sigfillset"
if test "x$ac_cv_func_sigfillset" = xyes
-@@ -20127,11 +20234,11 @@
+@@ -20134,11 +20241,11 @@
fi
@@ -615,7 +615,7 @@ index 70581e11b60..249a67228b0 100755
ac_fn_c_check_func "$LINENO" "getentropy" "ac_cv_func_getentropy"
if test "x$ac_cv_func_getentropy" = xyes
then :
-@@ -20153,6 +20260,53 @@
+@@ -20160,6 +20267,53 @@
fi
@@ -669,7 +669,7 @@ index 70581e11b60..249a67228b0 100755
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5
printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; }
if test ${ac_cv_c_undeclared_builtin_options+y}
-@@ -23235,7 +23389,8 @@
+@@ -23242,7 +23396,8 @@
# check for openpty, login_tty, and forkpty
@@ -679,7 +679,7 @@ index 70581e11b60..249a67228b0 100755
for ac_func in openpty
do :
-@@ -23349,7 +23504,7 @@
+@@ -23356,7 +23511,7 @@
fi
done
@@ -688,7 +688,7 @@ index 70581e11b60..249a67228b0 100755
printf %s "checking for library containing login_tty... " >&6; }
if test ${ac_cv_search_login_tty+y}
then :
-@@ -23532,6 +23687,7 @@
+@@ -23539,6 +23694,7 @@
fi
done
@@ -696,7 +696,7 @@ index 70581e11b60..249a67228b0 100755
# check for long file support functions
ac_fn_c_check_func "$LINENO" "fseek64" "ac_cv_func_fseek64"
-@@ -23797,10 +23953,10 @@
+@@ -23804,10 +23960,10 @@
done
@@ -709,7 +709,7 @@ index 70581e11b60..249a67228b0 100755
then
for ac_func in clock_settime
-@@ -26139,8 +26295,8 @@
+@@ -26146,8 +26302,8 @@
LIBPYTHON="\$(BLDLIBRARY)"
fi
@@ -720,7 +720,7 @@ index 70581e11b60..249a67228b0 100755
MODULE_DEPS_SHARED="$MODULE_DEPS_SHARED \$(PYTHONFRAMEWORKDIR)/\$(PYTHONFRAMEWORK)"
fi
-@@ -29010,7 +29166,7 @@
+@@ -29017,7 +29173,7 @@
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for device files" >&5
printf "%s\n" "$as_me: checking for device files" >&6;}
@@ -729,7 +729,7 @@ index 70581e11b60..249a67228b0 100755
ac_cv_file__dev_ptmx=no
ac_cv_file__dev_ptc=no
else
-@@ -29458,7 +29614,7 @@
+@@ -29510,7 +29666,7 @@
with_ensurepip=no ;; #(
WASI) :
with_ensurepip=no ;; #(
@@ -738,7 +738,7 @@ index 70581e11b60..249a67228b0 100755
with_ensurepip=no ;; #(
*) :
with_ensurepip=upgrade
-@@ -30438,7 +30594,7 @@
+@@ -30490,7 +30646,7 @@
;; #(
Darwin) :
;; #(
@@ -747,7 +747,7 @@ index 70581e11b60..249a67228b0 100755
-@@ -34441,6 +34597,8 @@
+@@ -34493,6 +34649,8 @@
"Mac/Resources/framework/Info.plist") CONFIG_FILES="$CONFIG_FILES Mac/Resources/framework/Info.plist" ;;
"Mac/Resources/app/Info.plist") CONFIG_FILES="$CONFIG_FILES Mac/Resources/app/Info.plist" ;;
"iOS/Resources/Info.plist") CONFIG_FILES="$CONFIG_FILES iOS/Resources/Info.plist" ;;
@@ -757,7 +757,7 @@ index 70581e11b60..249a67228b0 100755
"Misc/python.pc") CONFIG_FILES="$CONFIG_FILES Misc/python.pc" ;;
"Misc/python-embed.pc") CONFIG_FILES="$CONFIG_FILES Misc/python-embed.pc" ;;
diff --git a/configure.ac b/configure.ac
-index d7c3920d049..6027da5752a 100644
+index faa89095303..9bd51f7da97 100644
--- a/configure.ac
+++ b/configure.ac
@@ -330,6 +330,12 @@
@@ -773,7 +773,7 @@ index d7c3920d049..6027da5752a 100644
*-*-darwin*)
ac_sys_system=Darwin
;;
-@@ -404,7 +410,7 @@
+@@ -405,7 +411,7 @@
# On cross-compile builds, configure will look for a host-specific compiler by
# prepending the user-provided host triple to the required binary name.
#
@@ -782,7 +782,7 @@ index d7c3920d049..6027da5752a 100644
# which isn't a binary that exists, and isn't very convenient, as it contains the
# iOS version. As the default cross-compiler name won't exist, configure falls
# back to gcc, which *definitely* won't work. We're providing wrapper scripts for
-@@ -419,6 +425,14 @@
+@@ -420,6 +426,14 @@
aarch64-apple-ios*-simulator) AR=arm64-apple-ios-simulator-ar ;;
aarch64-apple-ios*) AR=arm64-apple-ios-ar ;;
x86_64-apple-ios*-simulator) AR=x86_64-apple-ios-simulator-ar ;;
@@ -797,7 +797,7 @@ index d7c3920d049..6027da5752a 100644
*)
esac
fi
-@@ -427,6 +441,14 @@
+@@ -428,6 +442,14 @@
aarch64-apple-ios*-simulator) CC=arm64-apple-ios-simulator-clang ;;
aarch64-apple-ios*) CC=arm64-apple-ios-clang ;;
x86_64-apple-ios*-simulator) CC=x86_64-apple-ios-simulator-clang ;;
@@ -812,7 +812,7 @@ index d7c3920d049..6027da5752a 100644
*)
esac
fi
-@@ -435,6 +457,14 @@
+@@ -436,6 +458,14 @@
aarch64-apple-ios*-simulator) CPP=arm64-apple-ios-simulator-cpp ;;
aarch64-apple-ios*) CPP=arm64-apple-ios-cpp ;;
x86_64-apple-ios*-simulator) CPP=x86_64-apple-ios-simulator-cpp ;;
@@ -827,7 +827,7 @@ index d7c3920d049..6027da5752a 100644
*)
esac
fi
-@@ -443,6 +473,14 @@
+@@ -444,6 +474,14 @@
aarch64-apple-ios*-simulator) CXX=arm64-apple-ios-simulator-clang++ ;;
aarch64-apple-ios*) CXX=arm64-apple-ios-clang++ ;;
x86_64-apple-ios*-simulator) CXX=x86_64-apple-ios-simulator-clang++ ;;
@@ -842,7 +842,7 @@ index d7c3920d049..6027da5752a 100644
*)
esac
fi
-@@ -557,8 +595,10 @@
+@@ -558,8 +596,10 @@
case $enableval in
yes)
case $ac_sys_system in
@@ -855,7 +855,7 @@ index d7c3920d049..6027da5752a 100644
*) AC_MSG_ERROR([Unknown platform for framework build])
esac
esac
-@@ -567,6 +607,8 @@
+@@ -568,6 +608,8 @@
no)
case $ac_sys_system in
iOS) AC_MSG_ERROR([iOS builds must use --enable-framework]) ;;
@@ -864,7 +864,7 @@ index d7c3920d049..6027da5752a 100644
*)
PYTHONFRAMEWORK=
PYTHONFRAMEWORKDIR=no-framework
-@@ -669,6 +711,34 @@
+@@ -670,6 +712,34 @@
AC_CONFIG_FILES([iOS/Resources/Info.plist])
;;
@@ -899,7 +899,7 @@ index d7c3920d049..6027da5752a 100644
*)
AC_MSG_ERROR([Unknown platform for framework build])
;;
-@@ -677,6 +747,8 @@
+@@ -678,6 +748,8 @@
],[
case $ac_sys_system in
iOS) AC_MSG_ERROR([iOS builds must use --enable-framework]) ;;
@@ -908,7 +908,7 @@ index d7c3920d049..6027da5752a 100644
*)
PYTHONFRAMEWORK=
PYTHONFRAMEWORKDIR=no-framework
-@@ -729,8 +801,8 @@
+@@ -730,8 +802,8 @@
case "$withval" in
yes)
case $ac_sys_system in
@@ -919,7 +919,7 @@ index d7c3920d049..6027da5752a 100644
APP_STORE_COMPLIANCE_PATCH="Mac/Resources/app-store-compliance.patch"
;;
*) AC_MSG_ERROR([no default app store compliance patch available for $ac_sys_system]) ;;
-@@ -744,8 +816,8 @@
+@@ -745,8 +817,8 @@
esac
],[
case $ac_sys_system in
@@ -930,7 +930,7 @@ index d7c3920d049..6027da5752a 100644
APP_STORE_COMPLIANCE_PATCH="Mac/Resources/app-store-compliance.patch"
AC_MSG_RESULT([applying default app store compliance patch])
;;
-@@ -793,6 +865,46 @@
+@@ -794,6 +866,46 @@
;;
esac
;;
@@ -977,7 +977,7 @@ index d7c3920d049..6027da5752a 100644
*-*-darwin*)
case "$host_cpu" in
arm*)
-@@ -882,9 +994,13 @@
+@@ -883,9 +995,13 @@
define_xopen_source=no;;
Darwin/@<:@[12]@:>@@<:@0-9@:>@.*)
define_xopen_source=no;;
@@ -992,7 +992,7 @@ index d7c3920d049..6027da5752a 100644
# On QNX 6.3.2, defining _XOPEN_SOURCE prevents netdb.h from
# defining NI_NUMERICHOST.
QNX/6.3.2)
-@@ -943,8 +1059,11 @@
+@@ -944,8 +1060,11 @@
CONFIGURE_MACOSX_DEPLOYMENT_TARGET=
EXPORT_MACOSX_DEPLOYMENT_TARGET='#'
@@ -1005,7 +1005,7 @@ index d7c3920d049..6027da5752a 100644
# checks for alternative programs
-@@ -978,11 +1097,17 @@
+@@ -979,11 +1098,17 @@
],
)
@@ -1024,7 +1024,7 @@ index d7c3920d049..6027da5752a 100644
],
)
-@@ -1171,6 +1296,8 @@
+@@ -1172,6 +1297,8 @@
AS_CASE([$ac_sys_system],
[Darwin*], [MULTIARCH=""],
[iOS], [MULTIARCH=""],
@@ -1033,7 +1033,7 @@ index d7c3920d049..6027da5752a 100644
[FreeBSD*], [MULTIARCH=""],
[MULTIARCH=$($CC --print-multiarch 2>/dev/null)]
)
-@@ -1192,7 +1319,7 @@
+@@ -1193,7 +1320,7 @@
dnl use a single "fat" binary at runtime. SOABI_PLATFORM is the component of
dnl the PLATFORM_TRIPLET that will be used in binary module extensions.
AS_CASE([$ac_sys_system],
@@ -1042,7 +1042,7 @@ index d7c3920d049..6027da5752a 100644
[SOABI_PLATFORM=$PLATFORM_TRIPLET]
)
-@@ -1226,6 +1353,10 @@
+@@ -1227,6 +1354,10 @@
[x86_64-*-freebsd*/clang], [PY_SUPPORT_TIER=3], dnl FreeBSD on AMD64
[aarch64-apple-ios*-simulator/clang], [PY_SUPPORT_TIER=3], dnl iOS Simulator on arm64
[aarch64-apple-ios*/clang], [PY_SUPPORT_TIER=3], dnl iOS on ARM64
@@ -1053,7 +1053,7 @@ index d7c3920d049..6027da5752a 100644
[aarch64-*-linux-android/clang], [PY_SUPPORT_TIER=3], dnl Android on ARM64
[x86_64-*-linux-android/clang], [PY_SUPPORT_TIER=3], dnl Android on AMD64
-@@ -1535,7 +1666,7 @@
+@@ -1536,7 +1667,7 @@
case $ac_sys_system in
Darwin)
LDLIBRARY='$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)';;
@@ -1062,7 +1062,7 @@ index d7c3920d049..6027da5752a 100644
LDLIBRARY='$(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK)';;
*)
AC_MSG_ERROR([Unknown platform for framework build]);;
-@@ -1600,7 +1731,7 @@
+@@ -1601,7 +1732,7 @@
BLDLIBRARY='-L. -lpython$(LDVERSION)'
RUNSHARED=DYLD_LIBRARY_PATH=`pwd`${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}}
;;
@@ -1071,7 +1071,7 @@ index d7c3920d049..6027da5752a 100644
LDLIBRARY='libpython$(LDVERSION).dylib'
;;
AIX*)
-@@ -3455,7 +3586,7 @@
+@@ -3456,7 +3587,7 @@
BLDSHARED="$LDSHARED"
fi
;;
@@ -1080,7 +1080,7 @@ index d7c3920d049..6027da5752a 100644
LDSHARED='$(CC) -dynamiclib -F . -framework $(PYTHONFRAMEWORK)'
LDCXXSHARED='$(CXX) -dynamiclib -F . -framework $(PYTHONFRAMEWORK)'
BLDSHARED="$LDSHARED"
-@@ -3579,7 +3710,7 @@
+@@ -3580,7 +3711,7 @@
Linux-android*) LINKFORSHARED="-pie -Xlinker -export-dynamic";;
Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
# -u libsys_s pulls in all symbols in libsys
@@ -1089,7 +1089,7 @@ index d7c3920d049..6027da5752a 100644
LINKFORSHARED="$extra_undefs -framework CoreFoundation"
# Issue #18075: the default maximum stack size (8MBytes) is too
-@@ -3603,7 +3734,7 @@
+@@ -3604,7 +3735,7 @@
LINKFORSHARED="$LINKFORSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
fi
LINKFORSHARED="$LINKFORSHARED"
@@ -1098,7 +1098,7 @@ index d7c3920d049..6027da5752a 100644
LINKFORSHARED="-Wl,-stack_size,$stack_size $LINKFORSHARED "'$(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK)'
fi
;;
-@@ -4023,7 +4154,7 @@
+@@ -4024,7 +4155,7 @@
dnl when do we need USING_APPLE_OS_LIBFFI?
ctypes_malloc_closure=yes
],
@@ -1107,7 +1107,7 @@ index d7c3920d049..6027da5752a 100644
ctypes_malloc_closure=yes
],
[sunos5], [AS_VAR_APPEND([LIBFFI_LIBS], [" -mimpure-text"])]
-@@ -5140,9 +5271,9 @@
+@@ -5133,9 +5264,9 @@
# checks for library functions
AC_CHECK_FUNCS([ \
accept4 alarm bind_textdomain_codeset chmod chown clock closefrom close_range confstr \
@@ -1119,7 +1119,7 @@ index d7c3920d049..6027da5752a 100644
gai_strerror getegid geteuid getgid getgrent getgrgid getgrgid_r \
getgrnam_r getgrouplist gethostname getitimer getloadavg getlogin \
getpeername getpgid getpid getppid getpriority _getpty \
-@@ -5150,8 +5281,7 @@
+@@ -5143,8 +5274,7 @@
getspnam getuid getwd grantpt if_nameindex initgroups kill killpg lchown linkat \
lockf lstat lutimes madvise mbrtowc memrchr mkdirat mkfifo mkfifoat \
mknod mknodat mktime mmap mremap nice openat opendir pathconf pause pipe \
@@ -1129,7 +1129,7 @@ index d7c3920d049..6027da5752a 100644
pread preadv preadv2 process_vm_readv \
pthread_cond_timedwait_relative_np pthread_condattr_setclock pthread_init \
pthread_kill pthread_getname_np pthread_setname_np \
-@@ -5160,7 +5290,7 @@
+@@ -5153,7 +5283,7 @@
sched_setparam sched_setscheduler sem_clockwait sem_getvalue sem_open \
sem_timedwait sem_unlink sendfile setegid seteuid setgid sethostname \
setitimer setlocale setpgid setpgrp setpriority setregid setresgid \
@@ -1138,7 +1138,7 @@ index d7c3920d049..6027da5752a 100644
sigfillset siginterrupt sigpending sigrelse sigtimedwait sigwait \
sigwaitinfo snprintf splice strftime strlcpy strsignal symlinkat sync \
sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile \
-@@ -5175,12 +5305,20 @@
+@@ -5168,12 +5298,20 @@
AC_CHECK_FUNCS([lchmod])
fi
@@ -1162,7 +1162,7 @@ index d7c3920d049..6027da5752a 100644
fi
AC_CHECK_DECL([dirfd],
-@@ -5434,20 +5572,22 @@
+@@ -5427,20 +5565,22 @@
])
# check for openpty, login_tty, and forkpty
@@ -1199,7 +1199,7 @@ index d7c3920d049..6027da5752a 100644
# check for long file support functions
AC_CHECK_FUNCS([fseek64 fseeko fstatvfs ftell64 ftello statvfs])
-@@ -5486,10 +5626,10 @@
+@@ -5479,10 +5619,10 @@
])
])
@@ -1212,7 +1212,7 @@ index d7c3920d049..6027da5752a 100644
then
AC_CHECK_FUNCS([clock_settime], [], [
AC_CHECK_LIB([rt], [clock_settime], [
-@@ -6240,8 +6380,8 @@
+@@ -6233,8 +6373,8 @@
LIBPYTHON="\$(BLDLIBRARY)"
fi
@@ -1223,7 +1223,7 @@ index d7c3920d049..6027da5752a 100644
MODULE_DEPS_SHARED="$MODULE_DEPS_SHARED \$(PYTHONFRAMEWORKDIR)/\$(PYTHONFRAMEWORK)"
fi
-@@ -6900,7 +7040,7 @@
+@@ -6893,7 +7033,7 @@
dnl NOTE: Inform user how to proceed with files when cross compiling.
dnl Some cross-compile builds are predictable; they won't ever
dnl have /dev/ptmx or /dev/ptc, so we can set them explicitly.
@@ -1232,7 +1232,7 @@ index d7c3920d049..6027da5752a 100644
ac_cv_file__dev_ptmx=no
ac_cv_file__dev_ptc=no
else
-@@ -7156,7 +7296,7 @@
+@@ -7187,7 +7327,7 @@
AS_CASE([$ac_sys_system],
[Emscripten], [with_ensurepip=no],
[WASI], [with_ensurepip=no],
@@ -1241,7 +1241,7 @@ index d7c3920d049..6027da5752a 100644
[with_ensurepip=upgrade]
)
])
-@@ -7567,7 +7707,7 @@
+@@ -7598,7 +7738,7 @@
[VxWorks*], [PY_STDLIB_MOD_SET_NA([_scproxy], [termios], [grp])],
dnl The _scproxy module is available on macOS
[Darwin], [],
@@ -1270,6 +1270,98 @@ index c3e261ecd9e..26ef7a95de4 100644
CFBundleSupportedPlatforms
iPhoneOS
+diff --git a/iOS/testbed/__main__.py b/iOS/testbed/__main__.py
+index b4499f5ac17..08fbe90a1c6 100644
+--- a/iOS/testbed/__main__.py
++++ b/iOS/testbed/__main__.py
+@@ -230,33 +230,69 @@
+ shutil.copytree(source, target, symlinks=True)
+ print(" done")
+
++ xc_framework_path = target / "Python.xcframework"
++ sim_framework_path = xc_framework_path / "ios-arm64_x86_64-simulator"
+ if framework is not None:
+ if framework.suffix == ".xcframework":
+ print(" Installing XCFramework...", end="", flush=True)
+- xc_framework_path = (target / "Python.xcframework").resolve()
+ if xc_framework_path.is_dir():
+ shutil.rmtree(xc_framework_path)
+ else:
+- xc_framework_path.unlink()
++ xc_framework_path.unlink(missing_ok=True)
+ xc_framework_path.symlink_to(
+ framework.relative_to(xc_framework_path.parent, walk_up=True)
+ )
+ print(" done")
+ else:
+ print(" Installing simulator framework...", end="", flush=True)
+- sim_framework_path = (
+- target / "Python.xcframework" / "ios-arm64_x86_64-simulator"
+- ).resolve()
+ if sim_framework_path.is_dir():
+ shutil.rmtree(sim_framework_path)
+ else:
+- sim_framework_path.unlink()
++ sim_framework_path.unlink(missing_ok=True)
+ sim_framework_path.symlink_to(
+ framework.relative_to(sim_framework_path.parent, walk_up=True)
+ )
+ print(" done")
+ else:
+- print(" Using pre-existing iOS framework.")
++ if (
++ xc_framework_path.is_symlink()
++ and not xc_framework_path.readlink().is_absolute()
++ ):
++ # XCFramework is a relative symlink. Rewrite the symlink relative
++ # to the new location.
++ print(" Rewriting symlink to XCframework...", end="", flush=True)
++ orig_xc_framework_path = (
++ source
++ / xc_framework_path.readlink()
++ ).resolve()
++ xc_framework_path.unlink()
++ xc_framework_path.symlink_to(
++ orig_xc_framework_path.relative_to(
++ xc_framework_path.parent, walk_up=True
++ )
++ )
++ print(" done")
++ elif (
++ sim_framework_path.is_symlink()
++ and not sim_framework_path.readlink().is_absolute()
++ ):
++ print(" Rewriting symlink to simulator framework...", end="", flush=True)
++ # Simulator framework is a relative symlink. Rewrite the symlink
++ # relative to the new location.
++ orig_sim_framework_path = (
++ source
++ / "Python.XCframework"
++ / sim_framework_path.readlink()
++ ).resolve()
++ sim_framework_path.unlink()
++ sim_framework_path.symlink_to(
++ orig_sim_framework_path.relative_to(
++ sim_framework_path.parent, walk_up=True
++ )
++ )
++ print(" done")
++ else:
++ print(" Using pre-existing iOS framework.")
+
+ for app_src in apps:
+ print(f" Installing app {app_src.name!r}...", end="", flush=True)
+@@ -372,8 +408,8 @@
+
+ if context.subcommand == "clone":
+ clone_testbed(
+- source=Path(__file__).parent,
+- target=Path(context.location),
++ source=Path(__file__).parent.resolve(),
++ target=Path(context.location).resolve(),
+ framework=Path(context.framework).resolve() if context.framework else None,
+ apps=[Path(app) for app in context.apps],
+ )
--- /dev/null
+++ b/tvOS/README.rst
@@ -0,0 +1,108 @@