Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
211dde6
ci: qualify remaining Windows MinGW architectures
cpunion Aug 29, 2026
799ba63
ci: preserve the llvm-mingw runtime path
cpunion Aug 29, 2026
9859b82
ci: isolate llvm-mingw host and target metadata
cpunion Aug 29, 2026
5301f21
build: support cross-host Windows GNU toolchains
cpunion Aug 29, 2026
f04e9ba
ssa: select the MinGW setjmp intrinsic
cpunion Aug 29, 2026
28f3317
ci: qualify Windows GNU targets from Unix hosts
cpunion Aug 29, 2026
48df307
ci: reuse cross-host llvm-mingw between targets
cpunion Aug 29, 2026
24bc70d
build: construct a complete Windows toolchain input
cpunion Aug 29, 2026
1d7e48b
ci: honor an existing llvm-mingw root
cpunion Aug 29, 2026
36876d1
ci: inspect the activated MSVC target
cpunion Aug 29, 2026
3638984
ci: expose runtime patches to cross-host builds
cpunion Aug 29, 2026
0022b39
build: cover malformed native toolchain input
cpunion Aug 29, 2026
e348fa2
ci: isolate 386 benchmark host runtime
cpunion Aug 29, 2026
3e3a18b
ci: bypass command wrappers for MinGW 386 links
cpunion Aug 29, 2026
a334a33
ci: scope direct MinGW 386 drivers to benchmarks
cpunion Aug 29, 2026
bd399b8
ci: select cross-host Windows compilers explicitly
cpunion Aug 30, 2026
c0d7334
ci: isolate cross-host vcpkg compilers
cpunion Aug 30, 2026
277992b
ci: isolate cross-host Windows architectures
cpunion Aug 30, 2026
aa5c00f
ci: clarify isolated cross-host setup
cpunion Aug 30, 2026
5597198
ci: stabilize isolated Windows architecture lanes
cpunion Aug 30, 2026
1662914
ci: isolate Windows host and target architectures
cpunion Aug 30, 2026
f99453a
ci: expose demo metadata to MinGW 386
cpunion Aug 30, 2026
6b0dbba
ci: use released plan9asm in cross-host builds
cpunion Aug 30, 2026
9ce37c3
ci: inspect embedded ELF with host LLVM tools
cpunion Aug 30, 2026
62562d9
ci: harden llvm-mingw host profile checks
cpunion Aug 31, 2026
08cd7c6
test: isolate Windows recoverable fault probe
cpunion Aug 31, 2026
76e4e25
test: qualify Windows fault workaround rationale
cpunion Aug 31, 2026
14aedcd
test: isolate traced Windows fault probe
cpunion Aug 31, 2026
4e7bd85
ci: qualify Windows debuggers and host shells
cpunion Aug 30, 2026
0fc3e2d
build: preserve explicit Windows PDB linker mode
cpunion Aug 30, 2026
6e014ba
ci: qualify remaining Windows debugger profiles
cpunion Aug 30, 2026
81f5cc4
test: select O0 for Windows PDB integration
cpunion Aug 30, 2026
00d0372
debug: verify mixed Go and C callback stacks
cpunion Aug 30, 2026
5f29d25
build: preserve C source DWARF with Go debug info
cpunion Aug 30, 2026
9baf66b
debug: verify mixed callback fault stacks
cpunion Aug 30, 2026
9a7261f
ci: preserve native paths across Windows host shells
cpunion Aug 30, 2026
66553d8
ci: fix Windows cross-target debug qualification
cpunion Aug 30, 2026
0e9d1d9
debug: emit CodeView for explicit Windows PDBs
cpunion Aug 30, 2026
66c730b
test: isolate mixed LLDB stack fixtures
cpunion Aug 30, 2026
780ab6b
docs: clarify Windows PDB metadata
cpunion Aug 30, 2026
a0315ca
test: use the resolved Windows executable suffix
cpunion Aug 30, 2026
8c70684
test: retain MinGW DWARF verifier sections
cpunion Aug 30, 2026
c0abf10
test: format MinGW DWARF setup
cpunion Aug 30, 2026
396219e
debug: preserve wide Windows 386 integer values
cpunion Aug 31, 2026
7acf9ae
test: select resolved LLDB source frames
cpunion Aug 31, 2026
955f32b
test: retain Windows DWARF verifier sections
cpunion Aug 31, 2026
4930a00
ci: use LLVM 19.1.7 target-native debuggers
cpunion Aug 31, 2026
2e200c5
test: honor the default Windows ABI
cpunion Aug 31, 2026
05f672f
ci: fix Windows debugger qualification
cpunion Aug 31, 2026
dfdf8c5
ci: preserve Windows host-shell target profiles
cpunion Aug 31, 2026
0d58f72
ci: diagnose Windows host-shell load failures
cpunion Aug 31, 2026
8ddbbd8
ci: pass native paths to Windows inspection tools
cpunion Aug 31, 2026
5ce1444
ci: use native output paths from Windows host shells
cpunion Aug 31, 2026
9f0a5af
docs: clarify Windows debug option helpers
cpunion Aug 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
**/expect.txt text eol=lf
**/out.txt text eol=lf
*.ll text eol=lf
*.sh text eol=lf
_demo/go/export/libexport.h.want text eol=lf
157 changes: 148 additions & 9 deletions .github/actions/activate-windows-target/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,60 @@ inputs:
runs:
using: "composite"
steps:
- name: Record the installed host compiler when available
- name: Record and isolate the host compiler when available
if: runner.os == 'Windows'
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
# GOROOT and benchmark jobs pass their explicitly built host compiler
# by path. Shared test jobs install llgo on PATH and reuse it whenever
# a target-native test launches the compiler as a subprocess.
# GOROOT exposes its explicitly built compiler through LLGO_TEST_LLGO.
# Shared test jobs install llgo on PATH and reuse it whenever a
# target-native test launches the compiler as a subprocess.
$hostCompiler = Get-Command llgo.exe -ErrorAction SilentlyContinue
if ($null -ne $hostCompiler) {
Add-Content -Encoding utf8 $env:GITHUB_ENV "LLGO_TEST_COMPILER=$($hostCompiler.Source)"
$hostCompilerPath = if ($env:LLGO_TEST_LLGO -and (Test-Path $env:LLGO_TEST_LLGO)) {
(Resolve-Path $env:LLGO_TEST_LLGO).Path
} elseif ($null -ne $hostCompiler) {
$hostCompiler.Source
}
if ($hostCompilerPath) {
if ("${{ inputs.windows-abi }}" -eq "mingw" -and "${{ inputs.windows-arch }}" -eq "386") {
$hostBin = Join-Path $env:LLGO_MINGW_HOST_ROOT "bin"
$objdump = Join-Path $hostBin "llvm-objdump.exe"
if (-not (Test-Path $objdump)) {
throw "The MinGW host llvm-objdump is unavailable: $objdump"
}

# The x86 target DLL directories must precede the x64 host on PATH
# when generated programs run. Put the host compiler's DLL closure
# beside llgo.exe so Windows resolves it before consulting PATH.
$compilerDir = Split-Path $hostCompilerPath
$queue = [Collections.Generic.Queue[string]]::new()
$queue.Enqueue($hostCompilerPath)
$copied = @{}
while ($queue.Count -ne 0) {
$binary = $queue.Dequeue()
foreach ($line in (& $objdump -p $binary)) {
if ($line -notmatch '^\s*DLL Name:\s*(\S+)\s*$') {
continue
}
$name = $Matches[1]
if ($copied.ContainsKey($name)) {
continue
}
$source = Join-Path $hostBin $name
if (-not (Test-Path $source)) {
continue
}
$destination = Join-Path $compilerDir $name
Copy-Item -LiteralPath $source -Destination $destination -Force
$copied[$name] = $true
$queue.Enqueue($destination)
}
}
if ($copied.Count -eq 0) {
throw "No MinGW host runtime DLLs were discovered for $hostCompilerPath"
}
}
Add-Content -Encoding utf8 $env:GITHUB_ENV "LLGO_TEST_COMPILER=$hostCompilerPath"
}

- name: Activate Windows MSVC target
Expand Down Expand Up @@ -52,7 +95,103 @@ runs:
Add-Content -Encoding utf8 $env:GITHUB_ENV "LLGO_WINDOWS_TARGET_ACTIVE=1"
Add-Content -Encoding utf8 $env:GITHUB_PATH (Join-Path $env:LLGO_WINDOWS_VCPKG_ROOT "bin")

- name: Reject unsupported Windows GNU target architecture
if: runner.os == 'Windows' && inputs.windows-abi == 'mingw' && inputs.windows-arch != 'amd64'
- name: Activate Windows GNU target
if: runner.os == 'Windows' && inputs.windows-abi == 'mingw'
shell: pwsh
run: throw "Non-amd64 MinGW qualification belongs to R11"
run: |
$ErrorActionPreference = "Stop"
$goArch = "${{ inputs.windows-arch }}"
$targetArch = switch ($goArch) {
"386" { "i686" }
"amd64" { "x86_64|amd64" }
"arm64" { "aarch64" }
default { throw "Unsupported Windows GNU target architecture: $goArch" }
}
$cc = "clang"
$cxx = "clang++"

if ($goArch -eq "386") {
foreach ($name in @("LLGO_MINGW_TARGET_BIN", "LLGO_MINGW_TARGET_RUNTIME_BIN", "LLGO_MINGW_TARGET_TOOLS", "LLGO_MINGW_TARGET_TRIPLE", "LLGO_MINGW_TARGET_VCPKG_ROOT")) {
$value = [Environment]::GetEnvironmentVariable($name)
if (-not $value) {
throw "The standalone llvm-mingw target did not export $name"
}
}
$compiler = Join-Path $env:LLGO_MINGW_TARGET_BIN "i686-w64-mingw32-clang.exe"
$compilerXX = Join-Path $env:LLGO_MINGW_TARGET_BIN "i686-w64-mingw32-clang++.exe"
foreach ($path in @($compiler, $compilerXX)) {
if (-not (Test-Path $path)) {
throw "The standalone llvm-mingw target compiler was not found: $path"
}
}
$target = (& $compiler -dumpmachine).Trim()
if ($target -notmatch "^$targetArch-.*-(windows-gnu|mingw32)$") {
throw "llvm-mingw reports $target, want windows/$goArch GNU"
}
# GITHUB_PATH prepends entries in reverse write order. Keep the
# target-selecting clang/pkg-config wrappers ahead of the bundle's
# unqualified x64 host commands for all subsequent steps.
Add-Content -Encoding utf8 $env:GITHUB_PATH $env:LLGO_MINGW_TARGET_BIN
Add-Content -Encoding utf8 $env:GITHUB_PATH $env:LLGO_MINGW_TARGET_RUNTIME_BIN
Add-Content -Encoding utf8 $env:GITHUB_PATH $env:LLGO_MINGW_TARGET_TOOLS
Add-Content -Encoding utf8 $env:GITHUB_PATH (Join-Path $env:LLGO_MINGW_TARGET_VCPKG_ROOT "bin")
# Keep the wrappers for interactive shells, but let LLGo invoke the
# drivers directly. A normal runtime link can exceed cmd.exe's 8191
# character limit while remaining below LLGo's 30 KiB response-file
# threshold.
$cc = $compiler
$cxx = $compilerXX
} else {
$target = (& clang.exe -dumpmachine).Trim()
if ($target -notmatch "^$targetArch-.*-(windows-gnu|mingw32)$") {
throw "MSYS2 Clang reports $target, want windows/$goArch GNU"
}
}

Add-Content -Encoding utf8 $env:GITHUB_ENV "CC=$cc"
Add-Content -Encoding utf8 $env:GITHUB_ENV "CXX=$cxx"
Add-Content -Encoding utf8 $env:GITHUB_ENV "GOOS=windows"
Add-Content -Encoding utf8 $env:GITHUB_ENV "GOARCH=$goArch"
Add-Content -Encoding utf8 $env:GITHUB_ENV "LLGO_WINDOWS_TARGET_ACTIVE=1"

- name: Activate cross-host Windows GNU target
if: runner.os != 'Windows' && inputs.windows-abi == 'mingw'
shell: bash
run: |
set -euo pipefail
for name in \
LLGO_MINGW_TARGET_BIN \
LLGO_MINGW_TARGET_RUNTIME_BIN \
LLGO_MINGW_TARGET_TOOLS \
LLGO_MINGW_TARGET_TRIPLE \
LLGO_MINGW_TARGET_VCPKG_ROOT; do
if [[ -z "${!name:-}" ]]; then
echo "the cross-host llvm-mingw target did not export $name" >&2
exit 1
fi
done

target="$(${LLGO_MINGW_TARGET_TOOLS}/clang -dumpmachine)"
case "${{ inputs.windows-arch }}:$target" in
386:i686-*-windows-gnu|386:i686-*-mingw32) ;;
amd64:x86_64-*-windows-gnu|amd64:x86_64-*-mingw32) ;;
arm64:aarch64-*-windows-gnu|arm64:aarch64-*-mingw32) ;;
*)
echo "llvm-mingw reports $target for windows/${{ inputs.windows-arch }}" >&2
exit 1
;;
esac

# Only expose the target-selecting wrappers. The compiler locates its
# own CRT by absolute path, target DLLs cannot run on this Unix host,
# and vcpkg contributes link flags through the pkg-config wrapper.
# This prevents llvm-mingw's unqualified host tools from shadowing the
# LLVM installation used to build the LLGo compiler itself.
echo "$LLGO_MINGW_TARGET_TOOLS" >> "$GITHUB_PATH"
echo "CC=$LLGO_MINGW_TARGET_TOOLS/clang" >> "$GITHUB_ENV"
echo "CXX=$LLGO_MINGW_TARGET_TOOLS/clang++" >> "$GITHUB_ENV"
echo "PKG_CONFIG=$LLGO_MINGW_TARGET_TOOLS/pkg-config" >> "$GITHUB_ENV"
echo "CGO_ENABLED=1" >> "$GITHUB_ENV"
echo "GOOS=windows" >> "$GITHUB_ENV"
echo "GOARCH=${{ inputs.windows-arch }}" >> "$GITHUB_ENV"
echo "LLGO_WINDOWS_TARGET_ACTIVE=1" >> "$GITHUB_ENV"
48 changes: 44 additions & 4 deletions .github/actions/setup-demo-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ runs:
# LLVM 19.1.3's MSVC LLDB embeds the 3.12.7 hosted-tool-cache prefix.
# A newer 3.12 patch is ABI-compatible, but LLDB combines its embedded
# stdlib path with that installation and cannot import encodings. Keep
# the MinGW demo environment on the normal latest 3.12 patch.
# the MinGW demo environment on the normal latest 3.12 patch. This is
# the host-tools interpreter: use x64 on Windows ARM, where emulation
# retains access to wheels that upstream projects do not publish for
# native ARM64 Python. The target interpreter is installed below.
python-version: ${{ inputs.windows-abi == 'msvc' && '3.12.7' || '3.12' }}
architecture: x64
# setup-python otherwise replaces PKG_CONFIG_PATH, hiding the native
Expand All @@ -40,19 +43,30 @@ runs:
architecture: ${{ inputs.windows-arch == 'arm64' && 'arm64' || 'x86' }}
update-environment: false

- name: Set up LLDB Python 3.10 on Windows 386
if: runner.os == 'Windows' && inputs.windows-arch == '386'
id: windows_lldb_python_386
uses: actions/setup-python@v6
with:
# LLVM's official 19.1.7 Win32 LLDB links python310.dll. Keep this
# debugger runtime separate from the target Python 3.12 demo library.
python-version: "3.10"
architecture: x86
update-environment: false

- name: Set up LLDB Python 3.11 on Windows ARM64
if: runner.os == 'Windows' && inputs.windows-abi == 'msvc' && inputs.windows-arch == 'arm64'
if: runner.os == 'Windows' && inputs.windows-arch == 'arm64'
id: windows_lldb_python
uses: actions/setup-python@v6
with:
# LLVM's official 19.1.3 Windows-on-Arm LLDB links python311.dll.
# LLVM's official 19.1.7 Windows-on-Arm LLDB links python311.dll.
# 3.11.9 is the final ARM64 artifact in actions/python-versions.
python-version: "3.11.9"
architecture: arm64
update-environment: false

- name: Configure LLDB Python on Windows ARM64
if: runner.os == 'Windows' && inputs.windows-abi == 'msvc' && inputs.windows-arch == 'arm64'
if: runner.os == 'Windows' && inputs.windows-arch == 'arm64'
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
Expand All @@ -63,6 +77,18 @@ runs:
}
Add-Content -Encoding utf8 $env:GITHUB_ENV "LLGO_WINDOWS_LLDB_PYTHON_HOME=$prefix"

- name: Configure LLDB Python on Windows 386
if: runner.os == 'Windows' && inputs.windows-arch == '386'
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
$python = "${{ steps.windows_lldb_python_386.outputs.python-path }}"
$prefix = (& $python -c "import sys; print(sys.base_prefix)").Trim()
if (-not (Test-Path (Join-Path $prefix "python310.dll"))) {
throw "The native x86 LLDB Python runtime is incomplete: $prefix"
}
Add-Content -Encoding utf8 $env:GITHUB_ENV "LLGO_WINDOWS_LLDB_PYTHON_HOME=$prefix"

- name: Install cargs demo library on Unix
if: runner.os != 'Windows'
shell: bash
Expand Down Expand Up @@ -123,6 +149,12 @@ runs:
$null = Enter-LLGoVisualStudio2022 -GoArch "${{ inputs.windows-arch }}"
}
$compiler = (Get-Command clang.exe).Source
if ("${{ inputs.windows-abi }}" -eq "mingw" -and "${{ inputs.windows-arch }}" -eq "386") {
if (-not $env:LLGO_MINGW_TARGET_BIN) {
throw "The standalone llvm-mingw target was not configured"
}
$compiler = Join-Path $env:LLGO_MINGW_TARGET_BIN "i686-w64-mingw32-clang.exe"
}
$compilerArgs = @()
if ("${{ inputs.windows-abi }}" -eq "msvc") {
$compilerArgs = @("--target=$env:LLGO_WINDOWS_TARGET_TRIPLE")
Expand All @@ -138,6 +170,14 @@ runs:
if ($compilerTarget -notmatch "-(windows-gnu|mingw32)$") {
throw "The MinGW profile resolved Clang target $compilerTarget"
}
$targetArch = switch ("${{ inputs.windows-arch }}") {
"386" { "i686" }
"amd64" { "x86_64|amd64" }
"arm64" { "aarch64" }
}
if ($compilerTarget -notmatch "^($targetArch)-") {
throw "The MinGW profile resolved $compilerTarget for windows/${{ inputs.windows-arch }}"
}
$runtimeArgs = @()
$archive = "libcargs.a"
}
Expand Down
Loading
Loading