Open
Conversation
Zig's LLD linker produces .pdata/.xdata (SEH unwind data) that is incompatible with the RtlVirtualUnwind-based unwind tester, causing STATUS_ACCESS_VIOLATION (0xc0000005) in ABITest.SanityCheck. Add a -no-unwind-tests flag to all_tests.go and use it for the Zig Windows CI targets. This follows the same pattern used for SDE builds.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3142 +/- ##
==========================================
+ Coverage 77.96% 77.97% +0.01%
==========================================
Files 689 689
Lines 122536 122537 +1
Branches 17071 17070 -1
==========================================
+ Hits 95535 95550 +15
+ Misses 26104 26090 -14
Partials 897 897 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
dougch
approved these changes
Apr 10, 2026
| shell: bash | ||
| run: | | ||
| cat <<EOF > ./toolchain.cmake | ||
| set(CMAKE_C_COMPILER ${ZIGCC}) |
Contributor
There was a problem hiding this comment.
Curious why these didn't go into CMakeLists.txt or a toolchain.${target_system}.cmake with a flag to enable them?
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.
Description of changes:
Adds CI to build and test AWS-LC using the Zig compiler toolchain (
zig cc/zig c++). The Zig compiler is Clang-based and is increasingly popular for cross-compilation and as an alternative C/C++ toolchain. This PR validates that AWS-LC builds and passes tests when compiled with Zig across five platform configurations:ubuntu-latestubuntu-24.04-armwindows-latestwindows-11-armmacos-latestZig doesn't accept a few GCC/Clang flags that our build emits, so this PR includes thin wrapper scripts (
util/zig-cc,util/zig-c++) that translate them before forwarding tozig cc/zig c++. The Windows variants (.cmd) are shims that call the bash scripts through Git Bash.Call-outs:
There are three platform-specific workarounds, all documented inline:
macOS linking: Zig's self-hosted MachO linker segfaults (ziglang/zig#25451, ziglang/zig#23704), so the toolchain falls back to the system compiler (
/usr/bin/cc) for linking only. Zig still handles all compilation.Windows
SSL_peektests: ThePeek-*-ServerSSL runner tests hang whenbssl_shimis compiled with Zig. These are disabled via a shim config file (zig_windows_config.json). A small CMake change plumbs the-DSSL_RUNNER_SHIM_CONFIGoption through to the runner's-shim-configflag.Windows SEH unwind tests: Zig's LLD linker produces
.pdata/.xdata(SEH unwind metadata) that is incompatible with theRtlVirtualUnwind-based unwind tester, causingSTATUS_ACCESS_VIOLATIONinABITest.SanityCheck. The non-unwind ABI register-preservation tests pass fine — only the single-step unwind verification crashes. A-no-unwind-testsflag was added toall_tests.go(following the existing SDE pattern) and is used for the Windows Zig targets.Testing:
CI across the five matrix configurations listed above. All tests pass.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.