From 29cc560887565b674f74d2ba46e74c96b4c95194 Mon Sep 17 00:00:00 2001
From: Mark Mentovai <mark@mentovai.com>
Date: Mon, 13 Oct 2025 12:58:54 -0400
Subject: [PATCH] Get LLVM from MacPorts for JIT builds

---
 Tools/jit/_llvm.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git Tools/jit/_llvm.py Tools/jit/_llvm.py
index f09a8404871b..16d08dc854dd 100644
--- Tools/jit/_llvm.py
+++ Tools/jit/_llvm.py
@@ -69,6 +69,10 @@ async def _get_brew_llvm_prefix(*, echo: bool = False) -> str | None:
 
 @_async_cache
 async def _find_tool(tool: str, *, echo: bool = False) -> str | None:
+    # MacPorts-installed executables:
+    path = f"{tool}-mp-{_LLVM_VERSION}"
+    if await _check_tool_version(path, echo=echo):
+        return path
     # Unversioned executables:
     path = tool
     if await _check_tool_version(path, echo=echo):
-- 
2.51.0

