Windows support
LLGo supports Windows natively: APIs declared with WINAPI/__stdcall are bound through the stdcall. namespace (only 386 has this distinct calling convention — amd64/arm64 use a unified native C ABI), and callbacks must be direct function references rather than capturing closures. Releases ship as four integrated archives split by architecture and toolchain (MSVC/MinGW for amd64/arm64), each bundling its own LLVM and C++ runtime dependencies; you only need to supply the matching native SDK/CRT and Clang environment (Visual Studio's C++ tooling for MSVC, or MSYS2 CLANG64/CLANGARM64 for MinGW).
Windows API
On Windows, bind APIs declared with WINAPI or __stdcall through the stdcall. namespace. The convention is distinct on 386; Windows amd64 and arm64 use their unified native C ABI. An explicitly decorated 386 name such as _MessageBoxW@16 is also accepted and is normalized to MessageBoxW on 64-bit targets.
//go:linkname MessageBoxW stdcall.MessageBoxW
func MessageBoxW(hwnd uintptr, text, caption *uint16, flags uint32) int32
//llgo:type stdcall
type Callback func(context uintptr) uintptrstdcall. declarations and //llgo:type stdcall apply only to non-variadic function types. A native callback is one function pointer, so a Go callback must be a direct function reference; pass state through an explicit context pointer rather than a capturing closure.
MSVC vs. MinGW
The release workflow builds four integrated Windows archives: llgo<VERSION>.windows-{amd64,arm64}-{msvc,mingw}.tar.gz. Check the release assets for availability in each version. Add the extracted bin directory to PATH; the archives keep the same runtime, targets, and crosscompile/clang layout as Unix releases. The MSVC compiler links LLVM statically; MinGW archives include the native LLVM and C++ DLL dependencies beside llgo.exe.
Use the archive matching your native architecture and toolchain profile. Native programs still need the corresponding SDK/CRT, Clang, and dependencies described below: Visual Studio's C++ developer environment for MSVC, or MSYS2 CLANG64 (amd64) / CLANGARM64 (arm64) for MinGW. The bundled ESP Clang remains the upstream x64 Windows payload, including in ARM64 archives, and runs through Windows' x64 emulation there; llgo.exe itself is native ARM64 in those archives.
The recommended GNU-hosted setup is an MSYS2 CLANG64 shell. Install the LLVM 22 stack and LLGo's native dependencies, then provide the versioned pkg-config metadata used by the Go/C++ bindings:
pacman -S --needed \
mingw-w64-clang-x86_64-{clang,llvm,llvm-tools,lld,lldb,compiler-rt,libc++,libunwind} \
mingw-w64-clang-x86_64-{gc,libffi,libuv,openssl,cjson,sqlite3,zlib,pkgconf}
test "$(llvm-config --version | cut -d. -f1)" = 22
pc_dir="$MINGW_PREFIX/lib/pkgconfig"
mkdir -p "$pc_dir"
printf '%s\n' \
'Name: LLVM 22' \
'Description: LLVM 22 host compiler and linker flags' \
"Version: $(llvm-config --version)" \
"Cflags: $(llvm-config --cflags)" \
"Libs: $(llvm-config --ldflags --libs all --system-libs)" \
> "$pc_dir/llvm-22.pc"The native MSVC CI profile uses LLVM's official 22.1.8 development archive for headers, libraries, Clang, LLD, and all code-generation backends. That archive does not contain LLDB, so the profile also extracts LLDB from the matching official win64 or woa64 installer. LLVM 22 has no official Win32 installer; the Windows 386 lane uses the LLVM 22.1.8-based llvm-mingw 20260616 builtins and qualifies the official x64 LLDB under WoW64. The complete pinned setup, checksums, and generated llvm-22.pc are in .github/actions/setup-deps/action.yml.
What's Changed
- ci: consolidate Go compatibility jobs by @cpunion in #2449
- test: avoid scheduler races in context waits by @cpunion in #2451
- runtime: remove the native libuv dependency by @cpunion in #2452
- mod: github.com/xgo-dev/plan9asm v0.5.1 by @xushiwei in #2453
- lto: refine interface method type IDs by @zhouguangyuan0718 in #2445
- test: separate behavior and command compatibility checks by @cpunion in #2450
- runtime: register foreign C export threads with the collector by @cpunion in #2461
- runtime: hide weak keys from conservative GC by @zhouguangyuan0718 in #2460
- runtime: ignore SIGPIPE from ordinary writes by @zhouguangyuan0718 in #2459
- reflect: preserve function type identity in calls by @zhouguangyuan0718 in #2458
- test: consolidate demo coverage by @cpunion in #2442
- runtime: preserve pending Unix signals under saturation by @cpunion in #2456
- runtime: serialize concurrent finalizer queue access by @cpunion in #2462
- windows: qualify ARM64 and 386 MSVC targets (R10) by @cpunion in #2454
- windows: qualify remaining GNU/MinGW architectures (R11; depends on #2454) by @cpunion in #2463
- windows: qualify debuggers and host shells (R12; depends on #2463) by @cpunion in #2465
- ci: simplify and accelerate workflows by @cpunion in #2467
- runtime: keep SIGPROF handler active during signal updates by @cpunion in #2466
- [WASM R0] build: define ecosystem ABI profiles by @cpunion in #2471
- build: remove legacy ABI modes by @cpunion in #2468
- mod: github.com/xgo-dev/plan9asm v0.5.2 by @xushiwei in #2477
- ci: cache LLGo toolchains and remove duplicate coverage jobs by @cpunion in #2474
- test: share package builds before parallel test runs by @cpunion in #2234
- runtime: avoid reentrant finalizer callback deadlocks by @cpunion in #2481
- build: make LLGoFiles safe across compiler processes by @cpunion in #2475
- [WASM R1] runtime: add single-worker blocking and timers by @cpunion in #2472
- ci: harden Windows tests and release sysroot handoff by @cpunion in #2484
- doc: Add LLGoFiles proposal for C/C++ integration (#2483) by @xushiwei in #2486
- runtime: preserve closure values in map buckets by @cpunion in #2489
- fix(ssa): preserve nonnull closure environments by @zhouguangyuan0718 in #2496
- build: pipeline multi-package tests through a DAG by @cpunion in #2482
- ssa: avoid materializing large struct comparisons by @cpunion in #2498
- ci: use Qiniu runners for Linux jobs by @MeteorsLiu in #2476
- ci: replace Debian 11 release sysroots with Debian 12 by @cpunion in #2504
- cabi: prove parameter storage reuse by @zhouguangyuan0718 in #2455
- build: honor test -c for named targets by @cpunion in #2488
- test: stabilize AfterFunc reset coverage by @cpunion in #2500
- chore: upgrade default LLVM toolchain to 22 by @zhouguangyuan0718 in #2470
- [WASM R2.1] runtime: complete linear GC object lifecycles by @cpunion in #2492
- [WASM R2] runtime: add non-moving GC roots and safepoints by @cpunion in #2487
- ci: release Windows amd64 and arm64 MSVC and MinGW bundles by @zhouguangyuan0718 in #2509
- ci: retry MSYS2 package transactions by @cpunion in #2499
- runtime: fix Windows CPU profiler frame-pointer capture by @cpunion in #2506
- runtime: use CRT-aware BDWGC threads on Windows by @cpunion in #2512
Full Changelog: v1.0.1...v1.0.2