Skip to content

cross windows metadata: mangle clang_main for the target SDK - #2471

Merged
ehartford merged 1 commit into
mainfrom
seed-winarm-clang-main
Oct 19, 2026
Merged

ehartford merged 1 commit into
mainfrom
seed-winarm-clang-main

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Follow-up to #2470. Seed cross run 39220664542 got past the C-runtime selection and failed at the final link with:

lld-link: error: <root>: undefined symbol: int __cdecl clang_main(int, char **, struct llvm::ToolContext const &)
lld-link: error: undefined symbol: with_clang_main

Root cause: both cross Windows llvm_ld.rsp generators called comp_clang_main_link_lines(..., windows_gnu_sdk=false, ...), emitting the MSVC-mangled ?clang_main@@... name. The current windows-aarch64 SDK is a windows-gnu build, so libclangMain.a carries the Itanium _Z10clang_main... symbol and the /include://alternatename: lines named a symbol that does not exist. The generators now pass the same gnu fact the native metadata derives (libclang ends with /lib/libclang.a); a Visual Studio-built libclang.lib SDK keeps the MSVC spelling.

Evidence: build.w/lib/std/build.w check under the installed compiler, the pinned seed, and the fresh release compiler; seed-driven :gate green (build store disabled for the same mixed-generation restore seen on #2470). Battery evidence will be posted before ready. #2305 remains open until the seed publishes and the native windows-aarch64 lane is green.

Seed cross run 39220664542 reached the final link and failed with undefined clang_main/with_clang_main. Both cross Windows metadata generators hardcoded the Visual Studio C++ mangling, but the current windows-aarch64 SDK is a windows-gnu build whose libclangMain.a carries the Itanium symbol. Pass the same gnu fact the native metadata derives from libclang.a; a libclang.lib SDK keeps the MSVC spelling.
@ehartford

Copy link
Copy Markdown
Contributor Author

Battery GREEN on eb256b2: battery rc=0 wall=247s, GREEN, BATTERY_DONE in out/battery/status.txt. Seed-driven :gate green before it. Marking ready and merging; the seed cross will be re-dispatched from the merged source_ref.

@ehartford
ehartford marked this pull request as ready for review October 19, 2026 16:41
@ehartford
ehartford merged commit 35afb3a into main Oct 19, 2026
@ehartford
ehartford deleted the seed-winarm-clang-main branch October 19, 2026 16:41
ehartford added a commit that referenced this pull request Oct 19, 2026
Seed cross run 39288117180 is green from main 35afb3a (#2470/#2471) against the windows-gnu SDK f137ee12. It published with-windows-aarch64.exe sha256 f27e7459c0039682e6b228e60abfbbcc750eb2a1dd61531269f08cb65380c967 to the seed-windows-aarch64 prerelease; the same bytes are promoted to the pinned nightly-20261015-local-1-efcb91c30a6a release the lanes fetch from. seed.lock and the three workflow pins (via tools/bump_seed_pins.w) now name that digest. The native windows-aarch64 lane verifies it next; #2305 closes only on that green.

Co-authored-by: Eric Hartford <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant