c: support Windows MSVC interop - #26
Draft
cpunion wants to merge 26 commits into
Draft
Conversation
Contributor
Author
|
Validation update:
|
Contributor
Author
|
LLGo execution coverage is now automated on both host platforms: Both jobs build LLGo v1.0.0 with LLVM 19 and run all four Windows 11 ARM64 has also passed the same tests locally with the staged R8 integration. I additionally built and tested the latest merged LLGo Windows commit ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add the Windows/MSVC host bindings needed by LLGo while preserving the existing POSIX C ABI on non-Windows hosts.
The
pthread_onceboundary remains a direct C mapping:Accordingly,
Once.Doaccepts a C-ABIOnceFunc func()on every host. Capturing Go closures use the separateOnce.DoFuncadapter: Go retains the closure object, while the native layer sees only a fixed callback and an opaque context pointer. The C layer never depends on LLGo's{function, environment}closure representation. The adapter covers concurrent callers and nested calls without changing the raw pthread API.Validation
go test ./...on macOS ARM64llgo test -v ./c/pthread/synccoverage for:DoFunccallsThe latest merged LLGo Windows foundation (R5) builds on Windows but cannot yet run
llgo test: compiling the standard-libraryinternal/fuzzpackage fails LLVM IR verification. Windows CI therefore waits for the remainingllgo testsupport to merge; the same tests already pass locally with the staged R8 integration.The corresponding LLGo integration remains staged in xgo-dev/llgo#2425. This work is part of the Windows support proposal.