Skip to content

Conversation

SingleAccretion
Copy link

@SingleAccretion SingleAccretion commented Sep 16, 2025

Since we only know the size of the methods once we compile them, introduce a "relocatable object node" concept:

  1. We record LLVM methods at object emission time with 0 sizes, recording the location in the IL stream where the size is set.
  2. We request the linker to produce a link map.
  3. We "relocate" the mstat in an MSBuild task by parsing the aforementioned section together with the link map.

Fixes #3152.

@jkotas jkotas added the area-NativeAOT-LLVM LLVM generation for Native AOT compilation (including Web Assembly) label Sep 16, 2025
Since we only know the size of the methods once we compile them,
introduce a "relocatable object node" concept:
1) We record LLVM methods at object emission time with 0 sizes,
   recording the location in the IL stream where the size is set.
2) We request the linker to produce a link map.
3) We "relocate" the mstat in an MSBuild task by parsing the
   aforementioned section together with the link map.
@SingleAccretion SingleAccretion marked this pull request as ready for review September 16, 2025 18:28
@SingleAccretion
Copy link
Author

@dotnet/nativeaot-llvm

This argument has proven more harmful than useful - you
can just use /p:DebugType=none to test DI-less scenarios.
Copy link
Contributor

@yowl yowl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, one nit.

@jkotas jkotas merged commit d226778 into dotnet:feature/NativeAOT-LLVM Sep 23, 2025
16 checks passed
@SingleAccretion SingleAccretion deleted the MSTAT branch September 24, 2025 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-NativeAOT-LLVM LLVM generation for Native AOT compilation (including Web Assembly)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants