diff --git a/Makefile b/Makefile
index b0b655cb..ee938e14 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.10.19
+PYTHON_VERSION=3.10.20
PYTHON_PKG_VERSION=3.10.11
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+")
diff --git a/patch/Python/Python.patch b/patch/Python/Python.patch
index 770d78f1..def71232 100644
--- a/patch/Python/Python.patch
+++ b/patch/Python/Python.patch
@@ -1,3 +1,6 @@
+diff --git a/.ruff.toml b/.ruff.toml
+new file mode 100644
+index 00000000000..1c015fa8841
--- /dev/null
+++ b/.ruff.toml
@@ -0,0 +1,12 @@
@@ -13,6 +16,9 @@
+# To override this, use ``fix = false`` in a subdirectory's config file
+# or ``--no-fix`` on the command line.
+fix = true
+diff --git a/Apple/.ruff.toml b/Apple/.ruff.toml
+new file mode 100644
+index 00000000000..f9098e0f5ce
--- /dev/null
+++ b/Apple/.ruff.toml
@@ -0,0 +1,22 @@
@@ -38,9 +44,12 @@
+ "W", # pycodestyle
+ "YTT", # flake8-2020
+]
+diff --git a/Apple/__main__.py b/Apple/__main__.py
+new file mode 100644
+index 00000000000..9fcb464a273
--- /dev/null
+++ b/Apple/__main__.py
-@@ -0,0 +1,1108 @@
+@@ -0,0 +1,1147 @@
+#!/usr/bin/env python3
+##########################################################################
+# Apple XCframework build script
@@ -255,8 +264,11 @@
+ return triples
+
+
-+def clean(context: argparse.Namespace, target: str = "all") -> None:
++def clean(context: argparse.Namespace, target: str | None = None) -> None:
+ """The implementation of the "clean" command."""
++ if target is None:
++ target = context.host
++
+ # If we're explicitly targeting the build, there's no platform or
+ # distribution artefacts. If we're cleaning tests, we keep all built
+ # artefacts. Otherwise, the built artefacts must be dirty, so we remove
@@ -398,7 +410,7 @@
+ for name_ver in [
+ "BZip2-1.0.8-2",
+ "libFFI-3.4.7-2",
-+ "OpenSSL-3.0.18-1",
++ "OpenSSL-3.0.19-1",
+ "XZ-5.6.4-2",
+ "mpdecimal-4.0.0-2",
+ "zstd-1.5.7-1",
@@ -459,7 +471,12 @@
+ with group(f"Downloading dependencies ({host})"):
+ if not prefix_dir.exists():
+ prefix_dir.mkdir()
-+ unpack_deps(context.platform, host, prefix_dir, context.cache_dir)
++ cache_dir = (
++ Path(context.cache_dir).resolve()
++ if context.cache_dir
++ else CROSS_BUILD_DIR / "downloads"
++ )
++ unpack_deps(context.platform, host, prefix_dir, cache_dir)
+ else:
+ print("Dependencies already installed")
+
@@ -844,7 +861,7 @@
+ ]:
+ step(context, host=step_host)
+
-+ if host in {"all", "hosts"}:
++ if host == "all":
+ package(context)
+
+
@@ -980,7 +997,7 @@
+ configure_build = subcommands.add_parser(
+ "configure-build", help="Run `configure` for the build Python"
+ )
-+ subcommands.add_parser(
++ make_build = subcommands.add_parser(
+ "make-build", help="Run `make` for the build Python"
+ )
+ configure_host = subcommands.add_parser(
@@ -1036,6 +1053,31 @@
+ ),
+ )
+
++ # --cross-build-dir argument
++ for cmd in [
++ clean,
++ configure_build,
++ make_build,
++ configure_host,
++ make_host,
++ build,
++ package,
++ test,
++ ci,
++ ]:
++ cmd.add_argument(
++ "--cross-build-dir",
++ action="store",
++ default=os.environ.get("CROSS_BUILD_DIR"),
++ dest="cross_build_dir",
++ type=Path,
++ help=(
++ "Path to the cross-build directory "
++ f"(default: {CROSS_BUILD_DIR}). Can also be set "
++ "with the CROSS_BUILD_DIR environment variable."
++ ),
++ )
++
+ # --clean option
+ for cmd in [configure_build, configure_host, build, package, test, ci]:
+ cmd.add_argument(
@@ -1050,7 +1092,7 @@
+ for cmd in [configure_host, build, ci]:
+ cmd.add_argument(
+ "--cache-dir",
-+ default="./cross-build/downloads",
++ default=os.environ.get("CACHE_DIR"),
+ help="The directory to store cached downloads.",
+ )
+
@@ -1117,6 +1159,12 @@
+
+ # Process command line arguments
+ context = parse_args()
++
++ # Set the CROSS_BUILD_DIR if an argument was provided
++ if context.cross_build_dir:
++ global CROSS_BUILD_DIR
++ CROSS_BUILD_DIR = context.cross_build_dir.resolve()
++
+ dispatch: dict[str, Callable] = {
+ "clean": clean,
+ "configure-build": configure_build_python,
@@ -1149,6 +1197,9 @@
+ stream.reconfigure(line_buffering=True)
+
+ main()
+diff --git a/Apple/iOS/README.md b/Apple/iOS/README.md
+new file mode 100644
+index 00000000000..7ee257b5d64
--- /dev/null
+++ b/Apple/iOS/README.md
@@ -0,0 +1,339 @@
@@ -1491,6 +1542,9 @@
+(this will likely be your own name), and plug in a physical device to your
+macOS machine with a USB cable. You should then be able to select your physical
+device from the list of targets in the pulldown in the Xcode titlebar.
+diff --git a/Apple/iOS/Resources/Info.plist.in b/Apple/iOS/Resources/Info.plist.in
+new file mode 100644
+index 00000000000..26ef7a95de4
--- /dev/null
+++ b/Apple/iOS/Resources/Info.plist.in
@@ -0,0 +1,34 @@
@@ -1528,81 +1582,129 @@
+ @IPHONEOS_DEPLOYMENT_TARGET@
+
+
+diff --git a/Apple/iOS/Resources/bin/arm64-apple-ios-ar b/Apple/iOS/Resources/bin/arm64-apple-ios-ar
+new file mode 100755
+index 00000000000..3cf3eb21874
--- /dev/null
+++ b/Apple/iOS/Resources/bin/arm64-apple-ios-ar
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk iphoneos${IOS_SDK_VERSION} ar "$@"
+diff --git a/Apple/iOS/Resources/bin/arm64-apple-ios-clang b/Apple/iOS/Resources/bin/arm64-apple-ios-clang
+new file mode 100755
+index 00000000000..f50d5b5142f
--- /dev/null
+++ b/Apple/iOS/Resources/bin/arm64-apple-ios-clang
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk iphoneos${IOS_SDK_VERSION} clang -target arm64-apple-ios${IPHONEOS_DEPLOYMENT_TARGET} "$@"
+diff --git a/Apple/iOS/Resources/bin/arm64-apple-ios-clang++ b/Apple/iOS/Resources/bin/arm64-apple-ios-clang++
+new file mode 100755
+index 00000000000..0794731d7dc
--- /dev/null
+++ b/Apple/iOS/Resources/bin/arm64-apple-ios-clang++
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk iphoneos${IOS_SDK_VERSION} clang++ -target arm64-apple-ios${IPHONEOS_DEPLOYMENT_TARGET} "$@"
+diff --git a/Apple/iOS/Resources/bin/arm64-apple-ios-cpp b/Apple/iOS/Resources/bin/arm64-apple-ios-cpp
+new file mode 100755
+index 00000000000..24fa1506bab
--- /dev/null
+++ b/Apple/iOS/Resources/bin/arm64-apple-ios-cpp
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk iphoneos${IOS_SDK_VERSION} clang -target arm64-apple-ios${IPHONEOS_DEPLOYMENT_TARGET} -E "$@"
+diff --git a/Apple/iOS/Resources/bin/arm64-apple-ios-simulator-ar b/Apple/iOS/Resources/bin/arm64-apple-ios-simulator-ar
+new file mode 100755
+index 00000000000..b836b6db902
--- /dev/null
+++ b/Apple/iOS/Resources/bin/arm64-apple-ios-simulator-ar
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk iphonesimulator${IOS_SDK_VERSION} ar "$@"
+diff --git a/Apple/iOS/Resources/bin/arm64-apple-ios-simulator-clang b/Apple/iOS/Resources/bin/arm64-apple-ios-simulator-clang
+new file mode 100755
+index 00000000000..4891a00876e
--- /dev/null
+++ b/Apple/iOS/Resources/bin/arm64-apple-ios-simulator-clang
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk iphonesimulator${IOS_SDK_VERSION} clang -target arm64-apple-ios${IPHONEOS_DEPLOYMENT_TARGET}-simulator "$@"
+diff --git a/Apple/iOS/Resources/bin/arm64-apple-ios-simulator-clang++ b/Apple/iOS/Resources/bin/arm64-apple-ios-simulator-clang++
+new file mode 100755
+index 00000000000..58b2a5f6f18
--- /dev/null
+++ b/Apple/iOS/Resources/bin/arm64-apple-ios-simulator-clang++
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk iphonesimulator${IOS_SDK_VERSION} clang++ -target arm64-apple-ios${IPHONEOS_DEPLOYMENT_TARGET}-simulator "$@"
+diff --git a/Apple/iOS/Resources/bin/arm64-apple-ios-simulator-cpp b/Apple/iOS/Resources/bin/arm64-apple-ios-simulator-cpp
+new file mode 100755
+index 00000000000..c9df94e8b7c
--- /dev/null
+++ b/Apple/iOS/Resources/bin/arm64-apple-ios-simulator-cpp
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk iphonesimulator${IOS_SDK_VERSION} clang -target arm64-apple-ios${IPHONEOS_DEPLOYMENT_TARGET}-simulator -E "$@"
+diff --git a/Apple/iOS/Resources/bin/arm64-apple-ios-simulator-strip b/Apple/iOS/Resources/bin/arm64-apple-ios-simulator-strip
+new file mode 100755
+index 00000000000..fd59d309b73
--- /dev/null
+++ b/Apple/iOS/Resources/bin/arm64-apple-ios-simulator-strip
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk iphonesimulator${IOS_SDK_VERSION} strip -arch arm64 "$@"
+diff --git a/Apple/iOS/Resources/bin/arm64-apple-ios-strip b/Apple/iOS/Resources/bin/arm64-apple-ios-strip
+new file mode 100755
+index 00000000000..75e823a3d02
--- /dev/null
+++ b/Apple/iOS/Resources/bin/arm64-apple-ios-strip
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk iphoneos${IOS_SDK_VERSION} strip -arch arm64 "$@"
+diff --git a/Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-ar b/Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-ar
+new file mode 100755
+index 00000000000..b836b6db902
--- /dev/null
+++ b/Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-ar
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk iphonesimulator${IOS_SDK_VERSION} ar "$@"
+diff --git a/Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-clang b/Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-clang
+new file mode 100755
+index 00000000000..f4739a7b945
--- /dev/null
+++ b/Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-clang
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk iphonesimulator${IOS_SDK_VERSION} clang -target x86_64-apple-ios${IPHONEOS_DEPLOYMENT_TARGET}-simulator "$@"
+diff --git a/Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-clang++ b/Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-clang++
+new file mode 100755
+index 00000000000..c348ae4c103
--- /dev/null
+++ b/Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-clang++
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk iphonesimulator${IOS_SDK_VERSION} clang++ -target x86_64-apple-ios${IPHONEOS_DEPLOYMENT_TARGET}-simulator "$@"
+diff --git a/Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-cpp b/Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-cpp
+new file mode 100755
+index 00000000000..6d7f8084c9f
--- /dev/null
+++ b/Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-cpp
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk iphonesimulator${IOS_SDK_VERSION} clang -target x86_64-apple-ios${IPHONEOS_DEPLOYMENT_TARGET}-simulator -E "$@"
+diff --git a/Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-strip b/Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-strip
+new file mode 100755
+index 00000000000..c5cfb289291
--- /dev/null
+++ b/Apple/iOS/Resources/bin/x86_64-apple-ios-simulator-strip
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk iphonesimulator${IOS_SDK_VERSION} strip -arch x86_64 "$@"
+diff --git a/Apple/iOS/Resources/pyconfig.h b/Apple/iOS/Resources/pyconfig.h
+new file mode 100644
+index 00000000000..4acff2c6051
--- /dev/null
+++ b/Apple/iOS/Resources/pyconfig.h
@@ -0,0 +1,7 @@
@@ -1613,6 +1715,9 @@
+#ifdef __x86_64__
+#include "pyconfig-x86_64.h"
+#endif
+diff --git a/Apple/testbed/Python.xcframework/Info.plist b/Apple/testbed/Python.xcframework/Info.plist
+new file mode 100644
+index 00000000000..f90105a6d70
--- /dev/null
+++ b/Apple/testbed/Python.xcframework/Info.plist
@@ -0,0 +1,106 @@
@@ -1722,6 +1827,9 @@
+ 1.0
+
+
+diff --git a/Apple/testbed/Python.xcframework/build/iOS-dylib-Info-template.plist b/Apple/testbed/Python.xcframework/build/iOS-dylib-Info-template.plist
+new file mode 100644
+index 00000000000..d6caa01c1e4
--- /dev/null
+++ b/Apple/testbed/Python.xcframework/build/iOS-dylib-Info-template.plist
@@ -0,0 +1,26 @@
@@ -1751,6 +1859,9 @@
+ 1
+
+
+diff --git a/Apple/testbed/Python.xcframework/build/tvOS-dylib-Info-template.plist b/Apple/testbed/Python.xcframework/build/tvOS-dylib-Info-template.plist
+new file mode 100644
+index 00000000000..a20d476fa7b
--- /dev/null
+++ b/Apple/testbed/Python.xcframework/build/tvOS-dylib-Info-template.plist
@@ -0,0 +1,26 @@
@@ -1780,6 +1891,9 @@
+ 1
+
+
+diff --git a/Apple/testbed/Python.xcframework/build/utils.sh b/Apple/testbed/Python.xcframework/build/utils.sh
+new file mode 100755
+index 00000000000..2c3c8008512
--- /dev/null
+++ b/Apple/testbed/Python.xcframework/build/utils.sh
@@ -0,0 +1,174 @@
@@ -1850,11 +1964,11 @@
+ # If the XCframework has a shared lib folder, then it's a full framework.
+ # Copy both the common and slice-specific part of the lib directory.
+ # Otherwise, it's a single-arch framework; use the "full" lib folder.
++ # Don't include any libpython symlink; that can't be included at runtime
+ if [ -d "$PROJECT_DIR/$PYTHON_XCFRAMEWORK_PATH/lib" ]; then
-+ rsync -au --delete "$PROJECT_DIR/$PYTHON_XCFRAMEWORK_PATH/lib/" "$CODESIGNING_FOLDER_PATH/python/lib/"
-+ rsync -au "$PROJECT_DIR/$PYTHON_XCFRAMEWORK_PATH/$SLICE_FOLDER/lib-$ARCHS/" "$CODESIGNING_FOLDER_PATH/python/lib/"
++ rsync -au --delete "$PROJECT_DIR/$PYTHON_XCFRAMEWORK_PATH/lib/" "$CODESIGNING_FOLDER_PATH/python/lib/" --exclude 'libpython*.dylib'
++ rsync -au "$PROJECT_DIR/$PYTHON_XCFRAMEWORK_PATH/$SLICE_FOLDER/lib-$ARCHS/" "$CODESIGNING_FOLDER_PATH/python/lib/" --exclude 'libpython*.dylib'
+ else
-+ # A single-arch framework will have a libpython symlink; that can't be included at runtime
+ rsync -au --delete "$PROJECT_DIR/$PYTHON_XCFRAMEWORK_PATH/$SLICE_FOLDER/lib/" "$CODESIGNING_FOLDER_PATH/python/lib/" --exclude 'libpython*.dylib'
+ fi
+}
@@ -1948,7 +2062,7 @@
+ shift
+
+ install_stdlib $PYTHON_XCFRAMEWORK_PATH
-+ PYTHON_VER=$(ls -1 "$CODESIGNING_FOLDER_PATH/python/lib")
++ PYTHON_VER=$(ls -1 "$CODESIGNING_FOLDER_PATH/python/lib" | grep -E "^python3\.\d+$")
+ echo "Install Python $PYTHON_VER standard library extension modules..."
+ process_dylibs $PYTHON_XCFRAMEWORK_PATH python/lib/$PYTHON_VER/lib-dynload
+
@@ -1957,6 +2071,9 @@
+ process_dylibs $PYTHON_XCFRAMEWORK_PATH $package_path
+ done
+}
+diff --git a/Apple/testbed/Python.xcframework/build/watchOS-dylib-Info-template.plist b/Apple/testbed/Python.xcframework/build/watchOS-dylib-Info-template.plist
+new file mode 100644
+index 00000000000..6f8c0bc2095
--- /dev/null
+++ b/Apple/testbed/Python.xcframework/build/watchOS-dylib-Info-template.plist
@@ -0,0 +1,26 @@
@@ -1986,6 +2103,9 @@
+ 1
+
+
+diff --git a/Apple/testbed/Python.xcframework/ios-arm64/README b/Apple/testbed/Python.xcframework/ios-arm64/README
+new file mode 100644
+index 00000000000..c1b076d12cd
--- /dev/null
+++ b/Apple/testbed/Python.xcframework/ios-arm64/README
@@ -0,0 +1,4 @@
@@ -1993,6 +2113,9 @@
+
+It should be used as a target for `--enable-framework` when compiling an iOS on-device
+build for testing purposes.
+diff --git a/Apple/testbed/Python.xcframework/ios-arm64_x86_64-simulator/README b/Apple/testbed/Python.xcframework/ios-arm64_x86_64-simulator/README
+new file mode 100644
+index 00000000000..ae334e5d769
--- /dev/null
+++ b/Apple/testbed/Python.xcframework/ios-arm64_x86_64-simulator/README
@@ -0,0 +1,4 @@
@@ -2000,6 +2123,9 @@
+
+It should be used as a target for `--enable-framework` when compiling an iOS simulator
+build for testing purposes (either x86_64 or ARM64).
+diff --git a/Apple/testbed/Python.xcframework/tvos-arm64/README b/Apple/testbed/Python.xcframework/tvos-arm64/README
+new file mode 100644
+index 00000000000..ebd648d04bd
--- /dev/null
+++ b/Apple/testbed/Python.xcframework/tvos-arm64/README
@@ -0,0 +1,4 @@
@@ -2007,6 +2133,9 @@
+
+It should be used as a target for `--enable-framework` when compiling a tvOS
+on-device build for testing purposes.
+diff --git a/Apple/testbed/Python.xcframework/tvos-arm64_x86_64-simulator/README b/Apple/testbed/Python.xcframework/tvos-arm64_x86_64-simulator/README
+new file mode 100644
+index 00000000000..f8163468d8c
--- /dev/null
+++ b/Apple/testbed/Python.xcframework/tvos-arm64_x86_64-simulator/README
@@ -0,0 +1,4 @@
@@ -2014,6 +2143,9 @@
+
+It should be used as a target for `--enable-framework` when compiling a tvOS
+simulator build for testing purposes (either x86_64 or ARM64).
+diff --git a/Apple/testbed/Python.xcframework/watchos-arm64_32/README b/Apple/testbed/Python.xcframework/watchos-arm64_32/README
+new file mode 100644
+index 00000000000..696af231df3
--- /dev/null
+++ b/Apple/testbed/Python.xcframework/watchos-arm64_32/README
@@ -0,0 +1,4 @@
@@ -2021,6 +2153,9 @@
+
+It should be used as a target for `--enable-framework` when compiling a watchOS on-device
+build for testing purposes.
+diff --git a/Apple/testbed/Python.xcframework/watchos-arm64_x86_64-simulator/README b/Apple/testbed/Python.xcframework/watchos-arm64_x86_64-simulator/README
+new file mode 100644
+index 00000000000..d38e1e98276
--- /dev/null
+++ b/Apple/testbed/Python.xcframework/watchos-arm64_x86_64-simulator/README
@@ -0,0 +1,4 @@
@@ -2028,6 +2163,9 @@
+
+It should be used as a target for `--enable-framework` when compiling a watchOS
+simulator build for testing purposes (either x86_64 or ARM64).
+diff --git a/Apple/testbed/Testbed.lldbinit b/Apple/testbed/Testbed.lldbinit
+new file mode 100644
+index 00000000000..4cf00dd0f9d
--- /dev/null
+++ b/Apple/testbed/Testbed.lldbinit
@@ -0,0 +1,4 @@
@@ -2035,6 +2173,9 @@
+process handle SIGUSR1 -n true -p true -s false
+process handle SIGUSR2 -n true -p true -s false
+process handle SIGXFSZ -n true -p true -s false
+diff --git a/Apple/testbed/TestbedTests/TestbedTests.m b/Apple/testbed/TestbedTests/TestbedTests.m
+new file mode 100644
+index 00000000000..cc0d9224042
--- /dev/null
+++ b/Apple/testbed/TestbedTests/TestbedTests.m
@@ -0,0 +1,198 @@
@@ -2236,6 +2377,9 @@
+
+
+@end
+diff --git a/Apple/testbed/__main__.py b/Apple/testbed/__main__.py
+new file mode 100644
+index 00000000000..7872ecba271
--- /dev/null
+++ b/Apple/testbed/__main__.py
@@ -0,0 +1,472 @@
@@ -2266,7 +2410,7 @@
+LOG_PREFIX_REGEX = re.compile(
+ r"^\d{4}-\d{2}-\d{2}" # YYYY-MM-DD
+ r"\s+\d+:\d{2}:\d{2}\.\d+\+\d{4}" # HH:MM:SS.ssssss+ZZZZ
-+ r"\s+.*Testbed\[\d+:\w+\]" # Process/thread ID
++ r"\s+.*Testbed\[\d+:\w+\] " # Process/thread ID
+)
+
+
@@ -2711,6 +2855,9 @@
+ for stream in [sys.stdout, sys.stderr]:
+ stream.reconfigure(line_buffering=True)
+ main()
+diff --git a/Apple/testbed/iOSTestbed.xcodeproj/project.pbxproj b/Apple/testbed/iOSTestbed.xcodeproj/project.pbxproj
+new file mode 100644
+index 00000000000..f8835a3bc58
--- /dev/null
+++ b/Apple/testbed/iOSTestbed.xcodeproj/project.pbxproj
@@ -0,0 +1,557 @@
@@ -3271,6 +3418,9 @@
+ };
+ rootObject = 607A660A2B0EFA380010BFC8 /* Project object */;
+}
+diff --git a/Apple/testbed/iOSTestbed.xcodeproj/xcshareddata/xcschemes/iOSTestbed.xcscheme b/Apple/testbed/iOSTestbed.xcodeproj/xcshareddata/xcschemes/iOSTestbed.xcscheme
+new file mode 100644
+index 00000000000..3c330a4152b
--- /dev/null
+++ b/Apple/testbed/iOSTestbed.xcodeproj/xcshareddata/xcschemes/iOSTestbed.xcscheme
@@ -0,0 +1,97 @@
@@ -3371,6 +3521,9 @@
+ revealArchiveInOrganizer = "YES">
+
+
+diff --git a/Apple/testbed/iOSTestbed.xctestplan b/Apple/testbed/iOSTestbed.xctestplan
+new file mode 100644
+index 00000000000..0c4ab9eb2ba
--- /dev/null
+++ b/Apple/testbed/iOSTestbed.xctestplan
@@ -0,0 +1,46 @@
@@ -3420,6 +3573,9 @@
+ ],
+ "version" : 1
+}
+diff --git a/Apple/testbed/iOSTestbed/AppDelegate.h b/Apple/testbed/iOSTestbed/AppDelegate.h
+new file mode 100644
+index 00000000000..f695b3b5efc
--- /dev/null
+++ b/Apple/testbed/iOSTestbed/AppDelegate.h
@@ -0,0 +1,11 @@
@@ -3434,6 +3590,9 @@
+
+
+@end
+diff --git a/Apple/testbed/iOSTestbed/AppDelegate.m b/Apple/testbed/iOSTestbed/AppDelegate.m
+new file mode 100644
+index 00000000000..e5085399d0c
--- /dev/null
+++ b/Apple/testbed/iOSTestbed/AppDelegate.m
@@ -0,0 +1,19 @@
@@ -3456,6 +3615,9 @@
+}
+
+@end
+diff --git a/Apple/testbed/iOSTestbed/Assets.xcassets/AccentColor.colorset/Contents.json b/Apple/testbed/iOSTestbed/Assets.xcassets/AccentColor.colorset/Contents.json
+new file mode 100644
+index 00000000000..eb878970081
--- /dev/null
+++ b/Apple/testbed/iOSTestbed/Assets.xcassets/AccentColor.colorset/Contents.json
@@ -0,0 +1,11 @@
@@ -3470,6 +3632,9 @@
+ "version" : 1
+ }
+}
+diff --git a/Apple/testbed/iOSTestbed/Assets.xcassets/AppIcon.appiconset/Contents.json b/Apple/testbed/iOSTestbed/Assets.xcassets/AppIcon.appiconset/Contents.json
+new file mode 100644
+index 00000000000..13613e3ee1a
--- /dev/null
+++ b/Apple/testbed/iOSTestbed/Assets.xcassets/AppIcon.appiconset/Contents.json
@@ -0,0 +1,13 @@
@@ -3486,6 +3651,9 @@
+ "version" : 1
+ }
+}
+diff --git a/Apple/testbed/iOSTestbed/Assets.xcassets/Contents.json b/Apple/testbed/iOSTestbed/Assets.xcassets/Contents.json
+new file mode 100644
+index 00000000000..73c00596a7f
--- /dev/null
+++ b/Apple/testbed/iOSTestbed/Assets.xcassets/Contents.json
@@ -0,0 +1,6 @@
@@ -3495,6 +3663,9 @@
+ "version" : 1
+ }
+}
+diff --git a/Apple/testbed/iOSTestbed/Base.lproj/LaunchScreen.storyboard b/Apple/testbed/iOSTestbed/Base.lproj/LaunchScreen.storyboard
+new file mode 100644
+index 00000000000..5daafe73a86
--- /dev/null
+++ b/Apple/testbed/iOSTestbed/Base.lproj/LaunchScreen.storyboard
@@ -0,0 +1,9 @@
@@ -3507,6 +3678,9 @@
+
+
+
+diff --git a/Apple/testbed/iOSTestbed/app/README b/Apple/testbed/iOSTestbed/app/README
+new file mode 100644
+index 00000000000..46c0e8e2a29
--- /dev/null
+++ b/Apple/testbed/iOSTestbed/app/README
@@ -0,0 +1,7 @@
@@ -3517,6 +3691,9 @@
+
+When the test suite runs, this folder will be on the PYTHONPATH, and will be the
+working directory for the test suite.
+diff --git a/Apple/testbed/iOSTestbed/app_packages/README b/Apple/testbed/iOSTestbed/app_packages/README
+new file mode 100644
+index 00000000000..02c2beccfbd
--- /dev/null
+++ b/Apple/testbed/iOSTestbed/app_packages/README
@@ -0,0 +1,7 @@
@@ -3527,6 +3704,9 @@
+Framework form.
+
+When the test suite runs, this folder will be on the PYTHONPATH.
+diff --git a/Apple/testbed/iOSTestbed/iOSTestbed-Info.plist b/Apple/testbed/iOSTestbed/iOSTestbed-Info.plist
+new file mode 100644
+index 00000000000..fea45e1fad6
--- /dev/null
+++ b/Apple/testbed/iOSTestbed/iOSTestbed-Info.plist
@@ -0,0 +1,52 @@
@@ -3582,6 +3762,9 @@
+
+
+
+diff --git a/Apple/testbed/iOSTestbed/main.m b/Apple/testbed/iOSTestbed/main.m
+new file mode 100644
+index 00000000000..e32bd78c9b4
--- /dev/null
+++ b/Apple/testbed/iOSTestbed/main.m
@@ -0,0 +1,16 @@
@@ -3601,6 +3784,9 @@
+ return UIApplicationMain(argc, argv, nil, appDelegateClassName);
+ }
+}
+diff --git a/Apple/testbed/tvOSTestbed.xcodeproj/project.pbxproj b/Apple/testbed/tvOSTestbed.xcodeproj/project.pbxproj
+new file mode 100644
+index 00000000000..85e7047dfb7
--- /dev/null
+++ b/Apple/testbed/tvOSTestbed.xcodeproj/project.pbxproj
@@ -0,0 +1,506 @@
@@ -4110,6 +4296,9 @@
+ };
+ rootObject = EE989E462DCD6E780036B268 /* Project object */;
+}
+diff --git a/Apple/testbed/tvOSTestbed.xcodeproj/xcshareddata/xcschemes/tvOSTestbed.xcscheme b/Apple/testbed/tvOSTestbed.xcodeproj/xcshareddata/xcschemes/tvOSTestbed.xcscheme
+new file mode 100644
+index 00000000000..c3f3f894a1f
--- /dev/null
+++ b/Apple/testbed/tvOSTestbed.xcodeproj/xcshareddata/xcschemes/tvOSTestbed.xcscheme
@@ -0,0 +1,97 @@
@@ -4210,6 +4399,9 @@
+ revealArchiveInOrganizer = "YES">
+
+
+diff --git a/Apple/testbed/tvOSTestbed.xctestplan b/Apple/testbed/tvOSTestbed.xctestplan
+new file mode 100644
+index 00000000000..f996facc178
--- /dev/null
+++ b/Apple/testbed/tvOSTestbed.xctestplan
@@ -0,0 +1,46 @@
@@ -4260,6 +4452,9 @@
+ "version" : 1
+}
\ No newline at end of file
+diff --git a/Apple/testbed/tvOSTestbed/AppDelegate.h b/Apple/testbed/tvOSTestbed/AppDelegate.h
+new file mode 100644
+index 00000000000..112c9ed64b8
--- /dev/null
+++ b/Apple/testbed/tvOSTestbed/AppDelegate.h
@@ -0,0 +1,11 @@
@@ -4274,6 +4469,9 @@
+
+
+@end
+diff --git a/Apple/testbed/tvOSTestbed/AppDelegate.m b/Apple/testbed/tvOSTestbed/AppDelegate.m
+new file mode 100644
+index 00000000000..bd91fb2d7d6
--- /dev/null
+++ b/Apple/testbed/tvOSTestbed/AppDelegate.m
@@ -0,0 +1,19 @@
@@ -4296,6 +4494,9 @@
+}
+
+@end
+diff --git a/Apple/testbed/tvOSTestbed/Base.lproj/LaunchScreen.storyboard b/Apple/testbed/tvOSTestbed/Base.lproj/LaunchScreen.storyboard
+new file mode 100644
+index 00000000000..660ba53de4f
--- /dev/null
+++ b/Apple/testbed/tvOSTestbed/Base.lproj/LaunchScreen.storyboard
@@ -0,0 +1,24 @@
@@ -4323,6 +4524,9 @@
+
+
+
+diff --git a/Apple/testbed/tvOSTestbed/app/README b/Apple/testbed/tvOSTestbed/app/README
+new file mode 100644
+index 00000000000..46c0e8e2a29
--- /dev/null
+++ b/Apple/testbed/tvOSTestbed/app/README
@@ -0,0 +1,7 @@
@@ -4333,6 +4537,9 @@
+
+When the test suite runs, this folder will be on the PYTHONPATH, and will be the
+working directory for the test suite.
+diff --git a/Apple/testbed/tvOSTestbed/app_packages/README b/Apple/testbed/tvOSTestbed/app_packages/README
+new file mode 100644
+index 00000000000..02c2beccfbd
--- /dev/null
+++ b/Apple/testbed/tvOSTestbed/app_packages/README
@@ -0,0 +1,7 @@
@@ -4343,6 +4550,9 @@
+Framework form.
+
+When the test suite runs, this folder will be on the PYTHONPATH.
+diff --git a/Apple/testbed/tvOSTestbed/main.m b/Apple/testbed/tvOSTestbed/main.m
+new file mode 100644
+index 00000000000..d5808fbb933
--- /dev/null
+++ b/Apple/testbed/tvOSTestbed/main.m
@@ -0,0 +1,16 @@
@@ -4362,6 +4572,9 @@
+ return UIApplicationMain(argc, argv, nil, appDelegateClassName);
+ }
+}
+diff --git a/Apple/testbed/tvOSTestbed/tvOSTestbed-Info.plist b/Apple/testbed/tvOSTestbed/tvOSTestbed-Info.plist
+new file mode 100644
+index 00000000000..f08f6098999
--- /dev/null
+++ b/Apple/testbed/tvOSTestbed/tvOSTestbed-Info.plist
@@ -0,0 +1,52 @@
@@ -4417,6 +4630,9 @@
+
+
+
+diff --git a/Apple/tvOS/README.rst b/Apple/tvOS/README.rst
+new file mode 100644
+index 00000000000..1f793252caf
--- /dev/null
+++ b/Apple/tvOS/README.rst
@@ -0,0 +1,108 @@
@@ -4528,6 +4744,9 @@
+
+Using a framework-based Python on tvOS
+======================================
+diff --git a/Apple/tvOS/Resources/Info.plist.in b/Apple/tvOS/Resources/Info.plist.in
+new file mode 100644
+index 00000000000..ab3050804b8
--- /dev/null
+++ b/Apple/tvOS/Resources/Info.plist.in
@@ -0,0 +1,34 @@
@@ -4565,81 +4784,129 @@
+ @TVOS_DEPLOYMENT_TARGET@
+
+
+diff --git a/Apple/tvOS/Resources/bin/arm64-apple-tvos-ar b/Apple/tvOS/Resources/bin/arm64-apple-tvos-ar
+new file mode 100755
+index 00000000000..e302748a13c
--- /dev/null
+++ b/Apple/tvOS/Resources/bin/arm64-apple-tvos-ar
@@ -0,0 +1,2 @@
+#!/bin/bash
+xcrun --sdk appletvos${TVOS_SDK_VERSION} ar "$@"
+diff --git a/Apple/tvOS/Resources/bin/arm64-apple-tvos-clang b/Apple/tvOS/Resources/bin/arm64-apple-tvos-clang
+new file mode 100755
+index 00000000000..7fb6d3d901c
--- /dev/null
+++ b/Apple/tvOS/Resources/bin/arm64-apple-tvos-clang
@@ -0,0 +1,2 @@
+#!/bin/bash
+xcrun --sdk appletvos${TVOS_SDK_VERSION} clang -target arm64-apple-tvos${TVOS_DEPLOYMENT_TARGET} "$@"
+diff --git a/Apple/tvOS/Resources/bin/arm64-apple-tvos-clang++ b/Apple/tvOS/Resources/bin/arm64-apple-tvos-clang++
+new file mode 100755
+index 00000000000..33bfb1367c3
--- /dev/null
+++ b/Apple/tvOS/Resources/bin/arm64-apple-tvos-clang++
@@ -0,0 +1,2 @@
+#!/bin/bash
+xcrun --sdk appletvos${TVOS_SDK_VERSION} clang++ -target arm64-apple-tvos${TVOS_DEPLOYMENT_TARGET} "$@"
+diff --git a/Apple/tvOS/Resources/bin/arm64-apple-tvos-cpp b/Apple/tvOS/Resources/bin/arm64-apple-tvos-cpp
+new file mode 100755
+index 00000000000..641c1bc8d18
--- /dev/null
+++ b/Apple/tvOS/Resources/bin/arm64-apple-tvos-cpp
@@ -0,0 +1,2 @@
+#!/bin/bash
+xcrun --sdk appletvos${TVOS_SDK_VERSION} clang -target arm64-apple-tvos${TVOS_DEPLOYMENT_TARGET} -E "$@"
+diff --git a/Apple/tvOS/Resources/bin/arm64-apple-tvos-simulator-ar b/Apple/tvOS/Resources/bin/arm64-apple-tvos-simulator-ar
+new file mode 100755
+index 00000000000..87ef5015aae
--- /dev/null
+++ b/Apple/tvOS/Resources/bin/arm64-apple-tvos-simulator-ar
@@ -0,0 +1,2 @@
+#!/bin/bash
+xcrun --sdk appletvsimulator${TVOS_SDK_VERSION} ar "$@"
+diff --git a/Apple/tvOS/Resources/bin/arm64-apple-tvos-simulator-clang b/Apple/tvOS/Resources/bin/arm64-apple-tvos-simulator-clang
+new file mode 100755
+index 00000000000..c8719cb0318
--- /dev/null
+++ b/Apple/tvOS/Resources/bin/arm64-apple-tvos-simulator-clang
@@ -0,0 +1,2 @@
+#!/bin/bash
+xcrun --sdk appletvsimulator${TVOS_SDK_VERSION} clang -target arm64-apple-tvos${TVOS_DEPLOYMENT_TARGET}-simulator "$@"
+diff --git a/Apple/tvOS/Resources/bin/arm64-apple-tvos-simulator-clang++ b/Apple/tvOS/Resources/bin/arm64-apple-tvos-simulator-clang++
+new file mode 100755
+index 00000000000..e3f0e720f7f
--- /dev/null
+++ b/Apple/tvOS/Resources/bin/arm64-apple-tvos-simulator-clang++
@@ -0,0 +1,2 @@
+#!/bin/bash
+xcrun --sdk appletvsimulator${TVOS_SDK_VERSION} clang++ -target arm64-apple-tvos${TVOS_DEPLOYMENT_TARGET}-simulator "$@"
+diff --git a/Apple/tvOS/Resources/bin/arm64-apple-tvos-simulator-cpp b/Apple/tvOS/Resources/bin/arm64-apple-tvos-simulator-cpp
+new file mode 100755
+index 00000000000..f9a37b72a61
--- /dev/null
+++ b/Apple/tvOS/Resources/bin/arm64-apple-tvos-simulator-cpp
@@ -0,0 +1,2 @@
+#!/bin/bash
+xcrun --sdk appletvsimulator${TVOS_SDK_VERSION} clang -target arm64-apple-tvos${TVOS_DEPLOYMENT_TARGET}-simulator -E "$@"
+diff --git a/Apple/tvOS/Resources/bin/arm64-apple-tvos-simulator-strip b/Apple/tvOS/Resources/bin/arm64-apple-tvos-simulator-strip
+new file mode 100755
+index 00000000000..a8cce95233e
--- /dev/null
+++ b/Apple/tvOS/Resources/bin/arm64-apple-tvos-simulator-strip
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk appletvsimulator${TVOS_SDK_VERSION} strip -arch arm64 "$@"
+diff --git a/Apple/tvOS/Resources/bin/arm64-apple-tvos-strip b/Apple/tvOS/Resources/bin/arm64-apple-tvos-strip
+new file mode 100755
+index 00000000000..ee1d2b95ff1
--- /dev/null
+++ b/Apple/tvOS/Resources/bin/arm64-apple-tvos-strip
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk iphoneos${TVOS_SDK_VERSION} strip -arch arm64 "$@"
+diff --git a/Apple/tvOS/Resources/bin/x86_64-apple-tvos-simulator-ar b/Apple/tvOS/Resources/bin/x86_64-apple-tvos-simulator-ar
+new file mode 100755
+index 00000000000..87ef5015aae
--- /dev/null
+++ b/Apple/tvOS/Resources/bin/x86_64-apple-tvos-simulator-ar
@@ -0,0 +1,2 @@
+#!/bin/bash
+xcrun --sdk appletvsimulator${TVOS_SDK_VERSION} ar "$@"
+diff --git a/Apple/tvOS/Resources/bin/x86_64-apple-tvos-simulator-clang b/Apple/tvOS/Resources/bin/x86_64-apple-tvos-simulator-clang
+new file mode 100755
+index 00000000000..ea0cc26cbd9
--- /dev/null
+++ b/Apple/tvOS/Resources/bin/x86_64-apple-tvos-simulator-clang
@@ -0,0 +1,2 @@
+#!/bin/bash
+xcrun --sdk appletvsimulator${TVOS_SDK_VERSION} clang -target x86_64-apple-tvos${TVOS_DEPLOYMENT_TARGET}-simulator "$@"
+diff --git a/Apple/tvOS/Resources/bin/x86_64-apple-tvos-simulator-clang++ b/Apple/tvOS/Resources/bin/x86_64-apple-tvos-simulator-clang++
+new file mode 100755
+index 00000000000..f18f3603169
--- /dev/null
+++ b/Apple/tvOS/Resources/bin/x86_64-apple-tvos-simulator-clang++
@@ -0,0 +1,2 @@
+#!/bin/bash
+xcrun --sdk appletvsimulator${TVOS_SDK_VERSION} clang++ -target x86_64-apple-tvos${TVOS_DEPLOYMENT_TARGET}-simulator "$@"
+diff --git a/Apple/tvOS/Resources/bin/x86_64-apple-tvos-simulator-cpp b/Apple/tvOS/Resources/bin/x86_64-apple-tvos-simulator-cpp
+new file mode 100755
+index 00000000000..b98054d1ce2
--- /dev/null
+++ b/Apple/tvOS/Resources/bin/x86_64-apple-tvos-simulator-cpp
@@ -0,0 +1,2 @@
+#!/bin/bash
+xcrun --sdk appletvsimulator${TVOS_SDK_VERSION} clang -target x86_64-apple-tvos${TVOS_DEPLOYMENT_TARGET}-simulator -E "$@"
+diff --git a/Apple/tvOS/Resources/bin/x86_64-apple-tvos-simulator-strip b/Apple/tvOS/Resources/bin/x86_64-apple-tvos-simulator-strip
+new file mode 100755
+index 00000000000..f6a884b4aef
--- /dev/null
+++ b/Apple/tvOS/Resources/bin/x86_64-apple-tvos-simulator-strip
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk appletvsimulator${TVOS_SDK_VERSION} strip -arch x86_64 "$@"
+diff --git a/Apple/tvOS/Resources/pyconfig.h b/Apple/tvOS/Resources/pyconfig.h
+new file mode 100644
+index 00000000000..4acff2c6051
--- /dev/null
+++ b/Apple/tvOS/Resources/pyconfig.h
@@ -0,0 +1,7 @@
@@ -4650,6 +4917,9 @@
+#ifdef __x86_64__
+#include "pyconfig-x86_64.h"
+#endif
+diff --git a/Apple/watchOS/README.rst b/Apple/watchOS/README.rst
+new file mode 100644
+index 00000000000..35221478452
--- /dev/null
+++ b/Apple/watchOS/README.rst
@@ -0,0 +1,108 @@
@@ -4761,6 +5031,9 @@
+
+Using a framework-based Python on watchOS
+======================================
+diff --git a/Apple/watchOS/Resources/Info.plist.in b/Apple/watchOS/Resources/Info.plist.in
+new file mode 100644
+index 00000000000..e83ddfd2a43
--- /dev/null
+++ b/Apple/watchOS/Resources/Info.plist.in
@@ -0,0 +1,34 @@
@@ -4798,81 +5071,129 @@
+ @WATCHOS_DEPLOYMENT_TARGET@
+
+
+diff --git a/Apple/watchOS/Resources/bin/arm64-apple-watchos-simulator-ar b/Apple/watchOS/Resources/bin/arm64-apple-watchos-simulator-ar
+new file mode 100755
+index 00000000000..dda2b211bd5
--- /dev/null
+++ b/Apple/watchOS/Resources/bin/arm64-apple-watchos-simulator-ar
@@ -0,0 +1,2 @@
+#!/bin/bash
+xcrun --sdk watchsimulator${WATCHOS_SDK_VERSION} ar "$@"
+diff --git a/Apple/watchOS/Resources/bin/arm64-apple-watchos-simulator-clang b/Apple/watchOS/Resources/bin/arm64-apple-watchos-simulator-clang
+new file mode 100755
+index 00000000000..fe834d3efe4
--- /dev/null
+++ b/Apple/watchOS/Resources/bin/arm64-apple-watchos-simulator-clang
@@ -0,0 +1,2 @@
+#!/bin/bash
+xcrun --sdk watchsimulator${WATCHOS_SDK_VERSION} clang -target arm64-apple-watchos${WATCHOS_DEPLOYMENT_TARGET}-simulator "$@"
+diff --git a/Apple/watchOS/Resources/bin/arm64-apple-watchos-simulator-clang++ b/Apple/watchOS/Resources/bin/arm64-apple-watchos-simulator-clang++
+new file mode 100755
+index 00000000000..757f3a26d8f
--- /dev/null
+++ b/Apple/watchOS/Resources/bin/arm64-apple-watchos-simulator-clang++
@@ -0,0 +1,2 @@
+#!/bin/bash
+xcrun --sdk watchsimulator${WATCHOS_SDK_VERSION} clang++ -target arm64-apple-watchos${WATCHOS_DEPLOYMENT_TARGET}-simulator "$@"
+diff --git a/Apple/watchOS/Resources/bin/arm64-apple-watchos-simulator-cpp b/Apple/watchOS/Resources/bin/arm64-apple-watchos-simulator-cpp
+new file mode 100755
+index 00000000000..fdb57d9e010
--- /dev/null
+++ b/Apple/watchOS/Resources/bin/arm64-apple-watchos-simulator-cpp
@@ -0,0 +1,2 @@
+#!/bin/bash
+xcrun --sdk watchsimulator clang -target arm64-apple-watchos${WATCHOS_DEPLOYMENT_TARGET}-simulator -E "$@"
+diff --git a/Apple/watchOS/Resources/bin/arm64-apple-watchos-simulator-strip b/Apple/watchOS/Resources/bin/arm64-apple-watchos-simulator-strip
+new file mode 100755
+index 00000000000..e28e3f7597a
--- /dev/null
+++ b/Apple/watchOS/Resources/bin/arm64-apple-watchos-simulator-strip
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk watchsimulator${WATCHOS_SDK_VERSION} strip -arch arm64 "$@"
+diff --git a/Apple/watchOS/Resources/bin/arm64-apple-watchos-strip b/Apple/watchOS/Resources/bin/arm64-apple-watchos-strip
+new file mode 100755
+index 00000000000..efe5a1260ad
--- /dev/null
+++ b/Apple/watchOS/Resources/bin/arm64-apple-watchos-strip
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk watchos${WATCHOS_SDK_VERSION} strip -arch arm64 "$@"
+diff --git a/Apple/watchOS/Resources/bin/arm64_32-apple-watchos-ar b/Apple/watchOS/Resources/bin/arm64_32-apple-watchos-ar
+new file mode 100755
+index 00000000000..029f9a32073
--- /dev/null
+++ b/Apple/watchOS/Resources/bin/arm64_32-apple-watchos-ar
@@ -0,0 +1,2 @@
+#!/bin/bash
+xcrun --sdk watchos${WATCHOS_SDK_VERSION} ar "$@"
+diff --git a/Apple/watchOS/Resources/bin/arm64_32-apple-watchos-clang b/Apple/watchOS/Resources/bin/arm64_32-apple-watchos-clang
+new file mode 100755
+index 00000000000..285036d4010
--- /dev/null
+++ b/Apple/watchOS/Resources/bin/arm64_32-apple-watchos-clang
@@ -0,0 +1,2 @@
+#!/bin/bash
+xcrun --sdk watchos${WATCHOS_SDK_VERSION} clang -target arm64_32-apple-watchos${WATCHOS_DEPLOYMENT_TARGET} "$@"
+diff --git a/Apple/watchOS/Resources/bin/arm64_32-apple-watchos-clang++ b/Apple/watchOS/Resources/bin/arm64_32-apple-watchos-clang++
+new file mode 100755
+index 00000000000..c8f60ebec51
--- /dev/null
+++ b/Apple/watchOS/Resources/bin/arm64_32-apple-watchos-clang++
@@ -0,0 +1,2 @@
+#!/bin/bash
+xcrun --sdk watchos${WATCHOS_SDK_VERSION} clang++ -target arm64_32-apple-watchos${WATCHOS_DEPLOYMENT_TARGET} "$@"
+diff --git a/Apple/watchOS/Resources/bin/arm64_32-apple-watchos-cpp b/Apple/watchOS/Resources/bin/arm64_32-apple-watchos-cpp
+new file mode 100755
+index 00000000000..b411fc25aa4
--- /dev/null
+++ b/Apple/watchOS/Resources/bin/arm64_32-apple-watchos-cpp
@@ -0,0 +1,2 @@
+#!/bin/bash
+xcrun --sdk watchos${WATCHOS_SDK_VERSION} clang -target arm64_32-apple-watchos${WATCHOS_DEPLOYMENT_TARGET} -E "$@"
+diff --git a/Apple/watchOS/Resources/bin/x86_64-apple-watchos-simulator-ar b/Apple/watchOS/Resources/bin/x86_64-apple-watchos-simulator-ar
+new file mode 100755
+index 00000000000..dda2b211bd5
--- /dev/null
+++ b/Apple/watchOS/Resources/bin/x86_64-apple-watchos-simulator-ar
@@ -0,0 +1,2 @@
+#!/bin/bash
+xcrun --sdk watchsimulator${WATCHOS_SDK_VERSION} ar "$@"
+diff --git a/Apple/watchOS/Resources/bin/x86_64-apple-watchos-simulator-clang b/Apple/watchOS/Resources/bin/x86_64-apple-watchos-simulator-clang
+new file mode 100755
+index 00000000000..4776b9b5348
--- /dev/null
+++ b/Apple/watchOS/Resources/bin/x86_64-apple-watchos-simulator-clang
@@ -0,0 +1,2 @@
+#!/bin/bash
+xcrun --sdk watchsimulator${WATCHOS_SDK_VERSION} clang -target x86_64-apple-watchos${WATCHOS_DEPLOYMENT_TARGET}-simulator "$@"
+diff --git a/Apple/watchOS/Resources/bin/x86_64-apple-watchos-simulator-clang++ b/Apple/watchOS/Resources/bin/x86_64-apple-watchos-simulator-clang++
+new file mode 100755
+index 00000000000..e9b0c5f4b87
--- /dev/null
+++ b/Apple/watchOS/Resources/bin/x86_64-apple-watchos-simulator-clang++
@@ -0,0 +1,2 @@
+#!/bin/bash
+xcrun --sdk watchsimulator${WATCHOS_SDK_VERSION} clang++ -target x86_64-apple-watchos${WATCHOS_DEPLOYMENT_TARGET}-simulator "$@"
+diff --git a/Apple/watchOS/Resources/bin/x86_64-apple-watchos-simulator-cpp b/Apple/watchOS/Resources/bin/x86_64-apple-watchos-simulator-cpp
+new file mode 100755
+index 00000000000..d3b821c5f7f
--- /dev/null
+++ b/Apple/watchOS/Resources/bin/x86_64-apple-watchos-simulator-cpp
@@ -0,0 +1,2 @@
+#!/bin/bash
+xcrun --sdk watchsimulator${WATCHOS_SDK_VERSION} clang -target x86_64-apple-watchos${WATCHOS_DEPLOYMENT_TARGET}-simulator -E "$@"
+diff --git a/Apple/watchOS/Resources/bin/x86_64-apple-watchos-simulator-strip b/Apple/watchOS/Resources/bin/x86_64-apple-watchos-simulator-strip
+new file mode 100755
+index 00000000000..105c78281f9
--- /dev/null
+++ b/Apple/watchOS/Resources/bin/x86_64-apple-watchos-simulator-strip
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk watchsimulator${WATCHOS_SDK_VERSION} strip -arch x86_64 "$@"
+diff --git a/Apple/watchOS/Resources/pyconfig.h b/Apple/watchOS/Resources/pyconfig.h
+new file mode 100644
+index 00000000000..f842b987b2e
--- /dev/null
+++ b/Apple/watchOS/Resources/pyconfig.h
@@ -0,0 +1,11 @@
@@ -5212,6 +5533,9 @@ index 9ae0270eaee..2bb14d88dc9 100644
Other Resources
===============
+diff --git a/Lib/_apple_support.py b/Lib/_apple_support.py
+new file mode 100644
+index 00000000000..92febdcf587
--- /dev/null
+++ b/Lib/_apple_support.py
@@ -0,0 +1,66 @@
@@ -5281,6 +5605,9 @@ index 9ae0270eaee..2bb14d88dc9 100644
+ self.log_write(self.level, b.replace(b"\x00", b"\xc0\x80"))
+
+ return len(b)
+diff --git a/Lib/_ios_support.py b/Lib/_ios_support.py
+new file mode 100644
+index 00000000000..db3fe23e45b
--- /dev/null
+++ b/Lib/_ios_support.py
@@ -0,0 +1,71 @@
@@ -6097,7 +6424,7 @@ index eef34f08121..22115948788 100644
"LDFLAGS",
"LDSHARED",
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
-index 0d3b9634f10..ff1dd87ed57 100644
+index d0492fe1914..632bc9c3f4d 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -43,7 +43,7 @@
@@ -6292,6 +6619,9 @@ index 38c499bf722..8de55306053 100644
+ """
+ return tempfile.mktemp(prefix="test_python_", suffix='.sock',
+ dir=os.path.curdir)
+diff --git a/Lib/test/test_apple.py b/Lib/test/test_apple.py
+new file mode 100644
+index 00000000000..f14db75e2f2
--- /dev/null
+++ b/Lib/test/test_apple.py
@@ -0,0 +1,155 @@
@@ -8727,13 +9057,13 @@ index 6c28b2b677c..76ea55f14ad 100644
if __name__ == "__main__":
unittest.main()
diff --git a/Lib/test/test_genericpath.py b/Lib/test/test_genericpath.py
-index 1ff7f75ad3e..116391493d4 100644
+index b0a13265c98..7d2d79ebfd4 100644
--- a/Lib/test/test_genericpath.py
+++ b/Lib/test/test_genericpath.py
-@@ -7,8 +7,9 @@
- import sys
+@@ -8,8 +8,9 @@
import unittest
import warnings
+ from test import support
-from test.support import os_helper
-from test.support import warnings_helper
+from test.support import (
@@ -8742,7 +9072,7 @@ index 1ff7f75ad3e..116391493d4 100644
from test.support.script_helper import assert_python_ok
from test.support.os_helper import FakePath
-@@ -475,12 +476,14 @@
+@@ -489,12 +490,14 @@
self.assertIsInstance(abspath(path), str)
def test_nonascii_abspath(self):
@@ -8805,7 +9135,7 @@ index f86e767ac0e..14434981e95 100644
def test_compress_stdin_outfile(self):
args = sys.executable, '-m', 'gzip'
diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py
-index 10a50fe97ec..ae51668668c 100644
+index 5eb3c82fbdb..a8d99320234 100644
--- a/Lib/test/test_httpservers.py
+++ b/Lib/test/test_httpservers.py
@@ -30,8 +30,9 @@
@@ -8847,7 +9177,7 @@ index 10a50fe97ec..ae51668668c 100644
filename = name
break
body = self.check_status_and_reason(response, HTTPStatus.OK)
-@@ -670,6 +671,7 @@
+@@ -684,6 +685,7 @@
@unittest.skipIf(hasattr(os, 'geteuid') and os.geteuid() == 0,
"This test can't be run reliably as root (issue #13308).")
@@ -9638,9 +9968,18 @@ index cac2f6177f3..50ceffc81b8 100644
# Test that command-lines get down as we expect.
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
-index 19bc8853159..e2308875a30 100644
+index 19bc8853159..9f80e779dcc 100644
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
+@@ -1,7 +1,7 @@
+ "Test posix functions"
+
+ from test import support
+-from test.support import import_helper
++from test.support import is_apple
+ from test.support import os_helper
+ from test.support import warnings_helper
+ from test.support.script_helper import assert_python_ok
@@ -555,6 +555,7 @@
@unittest.skipUnless(hasattr(posix, 'confstr'),
@@ -9686,7 +10025,7 @@ index 19bc8853159..e2308875a30 100644
- # OSX evidently just returns 15 without checking the argument.
- if sys.platform != "darwin":
+ # Apple plaforms return 15 without checking the argument.
-+ if not support.is_apple:
++ if not is_apple:
self.assertRaises(OSError, posix.sched_get_priority_min, -23)
self.assertRaises(OSError, posix.sched_get_priority_max, -23)
@@ -10186,6 +10525,44 @@ index 219c25cd2f6..d2ad941c051 100644
def test_20731(self):
sub = subprocess.Popen([sys.executable,
os.path.join(os.path.dirname(__file__),
+diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
+index 0f1397de732..f6a054ec0ee 100644
+--- a/Lib/test/test_ssl.py
++++ b/Lib/test/test_ssl.py
+@@ -4987,15 +4987,27 @@
+ return # Expect the full test setup to always work on Linux.
+ if (isinstance(err, ConnectionResetError) or
+ (isinstance(err, OSError) and err.errno == errno.EINVAL) or
+- re.search('wrong.version.number', getattr(err, "reason", ""), re.I)):
++ re.search(
++ # Matches the following error messages:
++ # '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1123)'
++ # '[SSL: RECORD_LAYER_FAILURE] record layer failure (_ssl.c:1109)'
++ # '[SSL: HTTP_REQUEST] http request (_ssl.c:1143)'
++ r'wrong.version.number|record.layer.failure|http.request',
++ str(getattr(err, "reason", "")),
++ re.IGNORECASE,
++ )
++ ):
+ # On Windows the TCP RST leads to a ConnectionResetError
+ # (ECONNRESET) which Linux doesn't appear to surface to userspace.
+ # If wrap_socket() winds up on the "if connected:" path and doing
+- # the actual wrapping... we get an SSLError from OpenSSL. Typically
+- # WRONG_VERSION_NUMBER. While appropriate, neither is the scenario
+- # we're specifically trying to test. The way this test is written
+- # is known to work on Linux. We'll skip it anywhere else that it
+- # does not present as doing so.
++ # the actual wrapping... we get an SSLError from OpenSSL. This is
++ # typically WRONG_VERSION_NUMBER. The same happens on iOS, but
++ # RECORD_LAYER_FAILURE or HTTP_REQUEST is the error.
++ #
++ # While appropriate, these scenarios aren't what we're specifically
++ # trying to test. The way this test is written is known to work on
++ # Linux. We'll skip it anywhere else that it does not present as
++ # doing so.
+ try:
+ self.skipTest(f"Could not recreate conditions on {sys.platform}:"
+ f" {err=}")
diff --git a/Lib/test/test_stat.py b/Lib/test/test_stat.py
index 2e1e2c349c8..867c4723086 100644
--- a/Lib/test/test_stat.py
@@ -10812,6 +11189,9 @@ index ec3cece48c9..34a772ab3c4 100755
def main():
import getopt
+diff --git a/Mac/Resources/app-store-compliance.patch b/Mac/Resources/app-store-compliance.patch
+new file mode 100644
+index 00000000000..2ccb22b9482
--- /dev/null
+++ b/Mac/Resources/app-store-compliance.patch
@@ -0,0 +1 @@
@@ -16620,7 +17000,7 @@ index 67540e08ed9..062e3047fb8 100644
#define TYPE_NULL '0'
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
-index b0c5da56c4f..ec53e7484fc 100644
+index b0c5da56c4f..c2c45c62ed2 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -18,7 +18,21 @@
@@ -16674,7 +17054,7 @@ index b0c5da56c4f..ec53e7484fc 100644
status = add_main_module(interp);
if (_PyStatus_EXCEPTION(status)) {
return status;
-@@ -2408,6 +2436,69 @@
+@@ -2408,6 +2436,71 @@
return res;
}
@@ -16691,7 +17071,9 @@ index b0c5da56c4f..ec53e7484fc 100644
+
+ // Pass the user-provided text through explicit %s formatting
+ // to avoid % literals being interpreted as a formatting directive.
-+ os_log_with_type(OS_LOG_DEFAULT, logtype, "%s", text);
++ // Using {public} ensures "dynamic" string messages are visible
++ // in the log without special configuration.
++ os_log_with_type(OS_LOG_DEFAULT, logtype, "%{public}s", text);
+ Py_RETURN_NONE;
+}
+
@@ -17298,7 +17680,7 @@ index d74fb6deac9..1bb6a05dc11 100755
# Local variables:
diff --git a/configure b/configure
-index 4b71c4e00f8..72f19106f3d 100755
+index 4b71c4e00f8..94e8960cd9d 100755
--- a/configure
+++ b/configure
@@ -660,6 +660,8 @@
@@ -18465,7 +18847,7 @@ index 4b71c4e00f8..72f19106f3d 100755
# checks for library functions
for ac_func in alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
- clock confstr close_range copy_file_range ctermid dup3 execv explicit_bzero \
-+ clock confstr close_range copy_file_range ctermid dup3 explicit_bzero \
++ clock confstr close_range copy_file_range ctermid explicit_bzero \
explicit_memset faccessat fchmod fchmodat fchown fchownat \
- fdwalk fexecve fdopendir fork fpathconf fstatat ftime ftruncate futimesat \
- futimens futimes gai_strerror getentropy \
@@ -18478,8 +18860,9 @@ index 4b71c4e00f8..72f19106f3d 100755
if_nameindex \
initgroups kill killpg lchown lockf linkat lstat lutimes mmap \
memrchr mbrtowc mkdirat mkfifo \
- madvise mkfifoat mknod mknodat mktime mremap nice openat pathconf pause pipe2 plock poll \
+- madvise mkfifoat mknod mknodat mktime mremap nice openat pathconf pause pipe2 plock poll \
- posix_fallocate posix_fadvise posix_spawn posix_spawnp pread preadv preadv2 \
++ madvise mkfifoat mknod mknodat mktime mremap nice openat pathconf pause plock poll \
+ posix_fallocate posix_fadvise pread preadv preadv2 \
pthread_condattr_setclock pthread_init pthread_kill pwrite pwritev pwritev2 \
readlink readlinkat readv realpath renameat \
@@ -18502,7 +18885,7 @@ index 4b71c4e00f8..72f19106f3d 100755
+# header definition prevents usage - autoconf doesn't use the headers), or
+# raise an error if used at runtime. Force these symbols off.
+if test "$ac_sys_system" != "iOS" -a "$ac_sys_system" != "tvOS" -a "$ac_sys_system" != "watchOS" ; then
-+ for ac_func in getentropy getgroups system
++ for ac_func in dup3 getentropy getgroups pipe2 system
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -18807,7 +19190,7 @@ index 4b71c4e00f8..72f19106f3d 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 ac3be3850a9..55301e3cb16 100644
+index ac3be3850a9..5f9e4a4a3e2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -71,7 +71,7 @@
@@ -19842,7 +20225,7 @@ index ac3be3850a9..55301e3cb16 100644
# checks for library functions
AC_CHECK_FUNCS(alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
- clock confstr close_range copy_file_range ctermid dup3 execv explicit_bzero \
-+ clock confstr close_range copy_file_range ctermid dup3 explicit_bzero \
++ clock confstr close_range copy_file_range ctermid explicit_bzero \
explicit_memset faccessat fchmod fchmodat fchown fchownat \
- fdwalk fexecve fdopendir fork fpathconf fstatat ftime ftruncate futimesat \
- futimens futimes gai_strerror getentropy \
@@ -19855,8 +20238,9 @@ index ac3be3850a9..55301e3cb16 100644
if_nameindex \
initgroups kill killpg lchown lockf linkat lstat lutimes mmap \
memrchr mbrtowc mkdirat mkfifo \
- madvise mkfifoat mknod mknodat mktime mremap nice openat pathconf pause pipe2 plock poll \
+- madvise mkfifoat mknod mknodat mktime mremap nice openat pathconf pause pipe2 plock poll \
- posix_fallocate posix_fadvise posix_spawn posix_spawnp pread preadv preadv2 \
++ madvise mkfifoat mknod mknodat mktime mremap nice openat pathconf pause plock poll \
+ posix_fallocate posix_fadvise pread preadv preadv2 \
pthread_condattr_setclock pthread_init pthread_kill pwrite pwritev pwritev2 \
readlink readlinkat readv realpath renameat \
@@ -19879,7 +20263,7 @@ index ac3be3850a9..55301e3cb16 100644
+# header definition prevents usage - autoconf doesn't use the headers), or
+# raise an error if used at runtime. Force these symbols off.
+if test "$ac_sys_system" != "iOS" -a "$ac_sys_system" != "tvOS" -a "$ac_sys_system" != "watchOS" ; then
-+ AC_CHECK_FUNCS([ getentropy getgroups system ])
++ AC_CHECK_FUNCS([dup3 getentropy getgroups pipe2 system ])
+fi
+
+# tvOS/watchOS have some additional methods that can be found, but not used.
@@ -20064,76 +20448,121 @@ index ac3be3850a9..55301e3cb16 100644
AS_CASE($with_ensurepip,
[yes|upgrade],[ENSUREPIP=upgrade],
[install],[ENSUREPIP=install],
+diff --git a/iOS/Resources/bin/arm64-apple-ios-ar b/iOS/Resources/bin/arm64-apple-ios-ar
+new file mode 100755
+index 00000000000..3cf3eb21874
--- /dev/null
+++ b/iOS/Resources/bin/arm64-apple-ios-ar
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk iphoneos${IOS_SDK_VERSION} ar "$@"
+diff --git a/iOS/Resources/bin/arm64-apple-ios-clang b/iOS/Resources/bin/arm64-apple-ios-clang
+new file mode 100755
+index 00000000000..f50d5b5142f
--- /dev/null
+++ b/iOS/Resources/bin/arm64-apple-ios-clang
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk iphoneos${IOS_SDK_VERSION} clang -target arm64-apple-ios${IPHONEOS_DEPLOYMENT_TARGET} "$@"
+diff --git a/iOS/Resources/bin/arm64-apple-ios-clang++ b/iOS/Resources/bin/arm64-apple-ios-clang++
+new file mode 100755
+index 00000000000..0794731d7dc
--- /dev/null
+++ b/iOS/Resources/bin/arm64-apple-ios-clang++
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk iphoneos${IOS_SDK_VERSION} clang++ -target arm64-apple-ios${IPHONEOS_DEPLOYMENT_TARGET} "$@"
+diff --git a/iOS/Resources/bin/arm64-apple-ios-cpp b/iOS/Resources/bin/arm64-apple-ios-cpp
+new file mode 100755
+index 00000000000..24fa1506bab
--- /dev/null
+++ b/iOS/Resources/bin/arm64-apple-ios-cpp
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk iphoneos${IOS_SDK_VERSION} clang -target arm64-apple-ios${IPHONEOS_DEPLOYMENT_TARGET} -E "$@"
+diff --git a/iOS/Resources/bin/arm64-apple-ios-simulator-ar b/iOS/Resources/bin/arm64-apple-ios-simulator-ar
+new file mode 100755
+index 00000000000..b836b6db902
--- /dev/null
+++ b/iOS/Resources/bin/arm64-apple-ios-simulator-ar
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk iphonesimulator${IOS_SDK_VERSION} ar "$@"
+diff --git a/iOS/Resources/bin/arm64-apple-ios-simulator-clang b/iOS/Resources/bin/arm64-apple-ios-simulator-clang
+new file mode 100755
+index 00000000000..4891a00876e
--- /dev/null
+++ b/iOS/Resources/bin/arm64-apple-ios-simulator-clang
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk iphonesimulator${IOS_SDK_VERSION} clang -target arm64-apple-ios${IPHONEOS_DEPLOYMENT_TARGET}-simulator "$@"
+diff --git a/iOS/Resources/bin/arm64-apple-ios-simulator-clang++ b/iOS/Resources/bin/arm64-apple-ios-simulator-clang++
+new file mode 100755
+index 00000000000..58b2a5f6f18
--- /dev/null
+++ b/iOS/Resources/bin/arm64-apple-ios-simulator-clang++
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk iphonesimulator${IOS_SDK_VERSION} clang++ -target arm64-apple-ios${IPHONEOS_DEPLOYMENT_TARGET}-simulator "$@"
+diff --git a/iOS/Resources/bin/arm64-apple-ios-simulator-cpp b/iOS/Resources/bin/arm64-apple-ios-simulator-cpp
+new file mode 100755
+index 00000000000..c9df94e8b7c
--- /dev/null
+++ b/iOS/Resources/bin/arm64-apple-ios-simulator-cpp
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk iphonesimulator${IOS_SDK_VERSION} clang -target arm64-apple-ios${IPHONEOS_DEPLOYMENT_TARGET}-simulator -E "$@"
+diff --git a/iOS/Resources/bin/arm64-apple-ios-simulator-strip b/iOS/Resources/bin/arm64-apple-ios-simulator-strip
+new file mode 100755
+index 00000000000..fd59d309b73
--- /dev/null
+++ b/iOS/Resources/bin/arm64-apple-ios-simulator-strip
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk iphonesimulator${IOS_SDK_VERSION} strip -arch arm64 "$@"
+diff --git a/iOS/Resources/bin/arm64-apple-ios-strip b/iOS/Resources/bin/arm64-apple-ios-strip
+new file mode 100755
+index 00000000000..75e823a3d02
--- /dev/null
+++ b/iOS/Resources/bin/arm64-apple-ios-strip
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk iphoneos${IOS_SDK_VERSION} strip -arch arm64 "$@"
+diff --git a/iOS/Resources/bin/x86_64-apple-ios-simulator-ar b/iOS/Resources/bin/x86_64-apple-ios-simulator-ar
+new file mode 100755
+index 00000000000..b836b6db902
--- /dev/null
+++ b/iOS/Resources/bin/x86_64-apple-ios-simulator-ar
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk iphonesimulator${IOS_SDK_VERSION} ar "$@"
+diff --git a/iOS/Resources/bin/x86_64-apple-ios-simulator-clang b/iOS/Resources/bin/x86_64-apple-ios-simulator-clang
+new file mode 100755
+index 00000000000..f4739a7b945
--- /dev/null
+++ b/iOS/Resources/bin/x86_64-apple-ios-simulator-clang
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk iphonesimulator${IOS_SDK_VERSION} clang -target x86_64-apple-ios${IPHONEOS_DEPLOYMENT_TARGET}-simulator "$@"
+diff --git a/iOS/Resources/bin/x86_64-apple-ios-simulator-clang++ b/iOS/Resources/bin/x86_64-apple-ios-simulator-clang++
+new file mode 100755
+index 00000000000..c348ae4c103
--- /dev/null
+++ b/iOS/Resources/bin/x86_64-apple-ios-simulator-clang++
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk iphonesimulator${IOS_SDK_VERSION} clang++ -target x86_64-apple-ios${IPHONEOS_DEPLOYMENT_TARGET}-simulator "$@"
+diff --git a/iOS/Resources/bin/x86_64-apple-ios-simulator-cpp b/iOS/Resources/bin/x86_64-apple-ios-simulator-cpp
+new file mode 100755
+index 00000000000..6d7f8084c9f
--- /dev/null
+++ b/iOS/Resources/bin/x86_64-apple-ios-simulator-cpp
@@ -0,0 +1,2 @@
+#!/bin/sh
+xcrun --sdk iphonesimulator${IOS_SDK_VERSION} clang -target x86_64-apple-ios${IPHONEOS_DEPLOYMENT_TARGET}-simulator -E "$@"
+diff --git a/iOS/Resources/bin/x86_64-apple-ios-simulator-strip b/iOS/Resources/bin/x86_64-apple-ios-simulator-strip
+new file mode 100755
+index 00000000000..c5cfb289291
--- /dev/null
+++ b/iOS/Resources/bin/x86_64-apple-ios-simulator-strip
@@ -0,0 +1,2 @@