Title: LLVM 22 clang-cl on Windows fails for jit builds · Issue #146210 · python/cpython · GitHub
Open Graph Title: LLVM 22 clang-cl on Windows fails for jit builds · Issue #146210 · python/cpython
X Title: LLVM 22 clang-cl on Windows fails for jit builds · Issue #146210 · python/cpython
Description: Bug report Bug description: When using https://github.com/llvm/llvm-project/releases/tag/llvmorg-22.1.1 and build.bat --experimental-jit-off -p x64 "/p:PlatformToolset=ClangCL" "/p:LLVMInstallDir=D:\dev\cpython\externals\llvm-22.1.1" "/p...
Open Graph Description: Bug report Bug description: When using https://github.com/llvm/llvm-project/releases/tag/llvmorg-22.1.1 and build.bat --experimental-jit-off -p x64 "/p:PlatformToolset=ClangCL" "/p:LLVMInstallDir=D...
X Description: Bug report Bug description: When using https://github.com/llvm/llvm-project/releases/tag/llvmorg-22.1.1 and build.bat --experimental-jit-off -p x64 "/p:PlatformToolset=ClangCL" "/p:L...
Opengraph URL: https://github.com/python/cpython/issues/146210
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"LLVM 22 clang-cl on Windows fails for jit builds","articleBody":"# Bug report\n\n### Bug description:\n\nWhen using https://github.com/llvm/llvm-project/releases/tag/llvmorg-22.1.1 and\n```\nbuild.bat --experimental-jit-off -p x64 \"/p:PlatformToolset=ClangCL\" \"/p:LLVMInstallDir=D:\\dev\\cpython\\externals\\llvm-22.1.1\" \"/p:LLVMToolsVersion=22\"\n```\nto build the interpreter, building the stencils fails:\n```\nC:\\Program Files\\Microsoft Visual Studio\\18\\Professional\\VC\\Tools\\MSVC\\14.50.35717\\include\\vcruntime.h(399,51): error G58EA42A4: unknown type name 'uintptr_t'; did you mean 'intptr_t'? [D:\\dev\\cpython\\PCbuild\\pythoncore.vcxproj]\nC:\\Program Files\\Microsoft Visual Studio\\18\\Professional\\VC\\Tools\\MSVC\\14.50.35717\\include\\vcruntime.h(400,67): error G58EA42A4: unknown type name 'uintptr_t'; did you mean 'intptr_t'? [D:\\dev\\cpython\\PCbuild\\pythoncore.vcxproj]\nC:\\Program Files\\Microsoft Visual Studio\\18\\Professional\\VC\\Tools\\MSVC\\14.50.35717\\include\\vcruntime.h(404,8): error G58EA42A4: unknown type name 'uintptr_t'; did you mean 'intptr_t'? [D:\\dev\\cpython\\PCbuild\\pythoncore.vcxproj]\nC:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.26100.0\\ucrt\\corecrt.h(380,16): error G58EA42A4: unknown type name 'uintptr_t'; did you mean 'intptr_t'? [D:\\dev\\cpython\\PCbuild\\pythoncore.vcxproj]\nC:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.26100.0\\ucrt\\corecrt_wstdio.h(277,49): error G58EA42A4: unknown type name 'va_list' [D:\\dev\\cpython\\PCbuild\\pythoncore.vcxproj]\nC:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.26100.0\\ucrt\\corecrt_wstdio.h(286,49): error G58EA42A4: unknown type name 'va_list' [D:\\dev\\cpython\\PCbuild\\pythoncore.vcxproj]\nC:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.26100.0\\ucrt\\corecrt_wstdio.h(295,49): error G58EA42A4: unknown type name 'va_list' [D:\\dev\\cpython\\PCbuild\\pythoncore.vcxproj]\nC:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.26100.0\\ucrt\\corecrt_wstdio.h(303,49): error G58EA42A4: unknown type name 'va_list' [D:\\dev\\cpython\\PCbuild\\pythoncore.vcxproj]\nC:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.26100.0\\ucrt\\corecrt_wstdio.h(317,39): error G58EA42A4: unknown type name 'va_list' [D:\\dev\\cpython\\PCbuild\\pythoncore.vcxproj]\nC:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.26100.0\\ucrt\\corecrt_wstdio.h(332,49): error G58EA42A4: unknown type name 'va_list' [D:\\dev\\cpython\\PCbuild\\pythoncore.vcxproj]\nC:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.26100.0\\ucrt\\corecrt_wstdio.h(348,43): error G58EA42A4: unknown type name 'va_list' [D:\\dev\\cpython\\PCbuild\\pythoncore.vcxproj]\nC:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.26100.0\\ucrt\\corecrt_wstdio.h(365,49): error G58EA42A4: unknown type name 'va_list' [D:\\dev\\cpython\\PCbuild\\pythoncore.vcxproj]\nC:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.26100.0\\ucrt\\corecrt_wstdio.h(379,39): error G58EA42A4: unknown type name 'va_list' [D:\\dev\\cpython\\PCbuild\\pythoncore.vcxproj]\nC:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.26100.0\\ucrt\\corecrt_wstdio.h(393,49): error G58EA42A4: unknown type name 'va_list' [D:\\dev\\cpython\\PCbuild\\pythoncore.vcxproj]\nC:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.26100.0\\ucrt\\corecrt_wstdio.h(406,39): error G58EA42A4: unknown type name 'va_list' [D:\\dev\\cpython\\PCbuild\\pythoncore.vcxproj]\nC:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.26100.0\\ucrt\\corecrt_wstdio.h(420,49): error G58EA42A4: unknown type name 'va_list' [D:\\dev\\cpython\\PCbuild\\pythoncore.vcxproj]\nC:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.26100.0\\ucrt\\corecrt_wstdio.h(435,43): error G58EA42A4: unknown type name 'va_list' [D:\\dev\\cpython\\PCbuild\\pythoncore.vcxproj]\nC:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.26100.0\\ucrt\\corecrt_wstdio.h(451,49): error G58EA42A4: unknown type name 'va_list' [D:\\dev\\cpython\\PCbuild\\pythoncore.vcxproj]\nC:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.26100.0\\ucrt\\corecrt_wstdio.h(464,39): error G58EA42A4: unknown type name 'va_list' [D:\\dev\\cpython\\PCbuild\\pythoncore.vcxproj]\nEXEC : fatal error : too many errors emitted, stopping now [-ferror-limit=] [D:\\dev\\cpython\\PCbuild\\pythoncore.vcxproj]\n```\n\nThis is because during building the interpreter, the respective include path of clang is [smuggled](https://github.com/python/cpython/pull/138452#issuecomment-3604153373) into the `INCLUDE` environment variable[^1]:\n```\nINCLUDE=D:\\dev\\cpython\\externals\\llvm-22.1.1\\llvm-21.1.4.0\\lib\\clang\\22\\include;\u003cother include paths>\n```\nand the clang\nhttps://github.com/python/cpython/blob/2f4eb34bd23d57d38f81da561e889c60fca244cd/Tools/jit/_llvm.py#L13-L14\nused to build the jit stencils picks it up. Since these are two different versions, the hiccup is no surprise (but that it manifests in errors in `vcruntime` and `ucrt` is).\n\nInstead of tying the two LLVM versions together like discussed in https://github.com/python/cpython/pull/138452, I now rather think it would be better to just empty[^2] the `INCLUDE` variable when running `Tools\\jit\\build.py`. Either by adding `EnvironmentVariables=\"INCLUDE=\"` to\nhttps://github.com/python/cpython/blob/9f9faa2d1a31e6d1d6271efa834b955f4acd53ee/PCbuild/regen.targets#L132\nor by adapting `Tools\\jit\\build.py`.\n\n@zooba, @Fidget-Spinner, @savannahostrowski: WDYT? I'd happily create a PR if this seems the correct approach to you.\n\n[^1]: I think `MSBuild support for LLVM (clang-cl) toolset does this\n[^2]: I've tested locally that this fixes building the jit stencils.\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nWindows\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-146338\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/chris-eibl","@type":"Person","name":"chris-eibl"},"datePublished":"2026-03-20T14:03:35Z","url":"https://github.com/python/cpython/issues/146210"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:94496e24-4d40-b19e-655b-50fca04f75e5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8D44:EA06E:3EB1FB0:4F9E995:6B01F930 |
| html-safe-nonce | cc3082772b980852ad145df07e89d4fac61ebe5e072721cf311a0bddad7f7544 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RDQ0OkVBMDZFOjNFQjFGQjA6NEY5RTk5NTo2QjAxRjkzMCIsInZpc2l0b3JfaWQiOiI3ODc2MjM4NTIxMDA5MzA1OTA0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 47ec17d35f4b05579c2d6b0d943982bda2ccfbe7bc95d42965bff7b415be1d76 |
| hovercard-subject-tag | issue:4108071232 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/146210/issue_layout |
| twitter:image | https://opengraph.githubassets.com/61145589c472b8a890cf7a8138ae18dcbd785df9aa7bec5e9f4858fd06d0cd2d/python/cpython/issues/146210 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/61145589c472b8a890cf7a8138ae18dcbd785df9aa7bec5e9f4858fd06d0cd2d/python/cpython/issues/146210 |
| og:image:alt | Bug report Bug description: When using https://github.com/llvm/llvm-project/releases/tag/llvmorg-22.1.1 and build.bat --experimental-jit-off -p x64 "/p:PlatformToolset=ClangCL" "/p:LLVMInstallDir=D... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | chris-eibl |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width