Skip to content

Make GcScanRoots a no-op on native AOT/WASM - #135767

Merged
MichalStrehovsky merged 1 commit into
dotnet:mainfrom
MichalStrehovsky:nativeaot-wasm-no-stack-scan
Oct 14, 2026
Merged

MichalStrehovsky merged 1 commit into
dotnet:mainfrom
MichalStrehovsky:nativeaot-wasm-no-stack-scan

Conversation

@MichalStrehovsky

Copy link
Copy Markdown
Member

Part of a series of pull requests that enable compiling, linking, and running a Console.WriteLine hello world on WASI/native AOT.

Summary

Remove GcScanWasmShadowStack and its undefined t_pShadowStackTop/t_pShadowStackBottom globals, inherited from the older NativeAOT-LLVM prototype. That prototype's shadow-stack representation is not the current direct RyuJIT Wasm stack ABI.

Keep the existing CrossThreadUnhijack() bookkeeping, but perform the StackFrameIterator walk only on non-Wasm targets.

This deliberately leaves managed stack-root enumeration unimplemented on Wasm. It removes obsolete linking dependencies for bringup; it is not a GC correctness fix or production-ready stack-scanning support.

Validation

  • .\build.cmd clr.nativeaotruntime -rc Checked -os wasi -arch wasm - passed.
  • With the rest of the series, both real-CoreLib Hello programs linked without the obsolete globals and ran successfully under Wasmtime, printing the expected text and exiting 0.

These results are from the combined local bringup tree, including prerequisite NativeAOT/Wasm enablement, not a fresh build of this isolated main-based branch. GC-pressure and root-survival behavior were not validated.

Note

This PR description was generated by GitHub Copilot.

`t_pShadowStackTop`/`t_pShadowStackBottom` doesn't link, these two are from the NativeAOT-LLVM prototype from CoreRT times.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: c78266f3-08e3-4918-b2e5-9fe0ddf2ca17
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara
See info in area-owners.md if you want to be subscribed.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib
See info in area-owners.md if you want to be subscribed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-wasm WebAssembly architecture area-NativeAOT-coreclr

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants