diff --git a/cpython-unix/build-cpython.sh b/cpython-unix/build-cpython.sh index 132d24a40..f05c60223 100755 --- a/cpython-unix/build-cpython.sh +++ b/cpython-unix/build-cpython.sh @@ -649,6 +649,14 @@ if [[ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_13}" && "${TARGET_TRIPLE}" == x86_64* PROFILE_TASK="${PROFILE_TASK} --ignore test.test_bytes.BytesTest.test_from_format" fi +# LLVM 23's BOLT instrumentation exhausts the stack in these recursion tests. +if [[ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_14}" && -n "${BOLT_CAPABLE}" && "${LLVM_VERSION}" = 23 && "${TARGET_TRIPLE}" == x86_64* ]]; then + PROFILE_TASK="${PROFILE_TASK} --ignore test.test_json.test_recursion.TestCRecursion.test_endless_recursion" + PROFILE_TASK="${PROFILE_TASK} --ignore test.test_functools.TestLRUC.test_lru_recursion" + PROFILE_TASK="${PROFILE_TASK} --ignore test.test_functools.*.test_recursive_pickle" + PROFILE_TASK="${PROFILE_TASK} --ignore test.test_xml_etree_c.BadElementTest.test_deeply_nested_deepcopy" +fi + # We use ndbm on macOS and BerkeleyDB elsewhere. if [[ "${PYBUILD_PLATFORM}" = macos* ]]; then CONFIGURE_FLAGS="${CONFIGURE_FLAGS} --with-dbmliborder=ndbm" diff --git a/cpython-unix/build-tk.sh b/cpython-unix/build-tk.sh index c60aab599..5dae32922 100755 --- a/cpython-unix/build-tk.sh +++ b/cpython-unix/build-tk.sh @@ -26,6 +26,13 @@ LDFLAGS="${EXTRA_TARGET_LDFLAGS}" if [[ "${PYBUILD_PLATFORM}" = macos* ]]; then CFLAGS="${CFLAGS} -I${TOOLS_PATH}/deps/include -Wno-availability" CFLAGS="${CFLAGS} -Wno-deprecated-declarations -Wno-unknown-attributes -Wno-typedef-redefinition" + # Clang 23 emits Objective-C class selector stubs that ld64.lld cannot link. + # Probe the flag because older macOS toolchains do not recognize it. + # lld from LLVM 23 does not yet support theses stubs + # https://github.com/llvm/llvm-project/pull/219744 + if "${CC}" -fno-objc-msgsend-class-selector-stubs -x objective-c -fsyntax-only /dev/null >/dev/null 2>&1; then + CFLAGS="${CFLAGS} -fno-objc-msgsend-class-selector-stubs" + fi LDFLAGS="${LDFLAGS} -L${TOOLS_PATH}/deps/lib" EXTRA_CONFIGURE_FLAGS="--enable-aqua=yes --without-x" else diff --git a/cpython-unix/patch-jit-llvm-version-3.13.patch b/cpython-unix/patch-jit-llvm-version-3.13.patch index f980855d7..5b484d949 100644 --- a/cpython-unix/patch-jit-llvm-version-3.13.patch +++ b/cpython-unix/patch-jit-llvm-version-3.13.patch @@ -7,7 +7,7 @@ index b68da1b6be1..cf04f83539e 100644 import typing -_LLVM_VERSION = 18 -+_LLVM_VERSION = 22 ++_LLVM_VERSION = int(os.environ.get("LLVM_VERSION", "18")) _LLVM_VERSION_PATTERN = re.compile( rf"(? str: if machine == "arm64": return "macos_arm64" elif machine == "x86_64": - return "macos_x86_64" + raise Exception( + "macOS builds require an Apple Silicon host running native arm64 Python" + ) else: raise Exception(f"unhanded macOS machine type: {machine}") elif sys.platform == "win32": @@ -75,8 +77,6 @@ def default_target_triple() -> str: return "aarch64-unknown-linux-gnu" elif host == "macos_arm64": return "aarch64-apple-darwin" - elif host == "macos_x86_64": - return "x86_64-apple-darwin" elif host == "windows_x86": return "i686-pc-windows-msvc" elif host == "windows_x86_64": @@ -506,8 +506,6 @@ def clang_toolchain(host_platform: str, target_triple: str) -> str: return "llvm-aarch64-linux" elif host_platform == "macos_arm64": return "llvm-aarch64-macos" - elif host_platform == "macos_x86_64": - return "llvm-x86_64-macos" else: raise Exception("unhandled host platform") diff --git a/scripts/update_downloads.py b/scripts/update_downloads.py index 1708e521a..814ee4972 100644 --- a/scripts/update_downloads.py +++ b/scripts/update_downloads.py @@ -417,7 +417,6 @@ def xorg_policy(category: str, name: str, extension: str = "tar.gz") -> Policy: "llvm-aarch64-linux": "toolchain bootstrap requires coordinated updates", "llvm-x86_64-linux": "toolchain bootstrap requires coordinated updates", "llvm-aarch64-macos": "toolchain bootstrap requires coordinated updates", - "llvm-x86_64-macos": "toolchain bootstrap requires coordinated updates", "musl": "intentionally pinned build toolchain", "musl-static": "intentionally pinned build toolchain", "openssl-1.1": "end-of-life release series",