Skip to content

Commit 04c4fe6

Browse files
jkoritzinskyjkotaselinor-fung
authored
Add support for emitting Mach-O R2R images (#121186)
Adds support in crossgen2 for emitting Mach-O objects for composite R2R. --------- Co-authored-by: Jan Kotas <jkotas@microsoft.com> Co-authored-by: Elinor Fung <elfung@microsoft.com>
1 parent 39d4138 commit 04c4fe6

38 files changed

+777
-117
lines changed

docs/design/coreclr/botr/readytorun-format.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ struct READYTORUN_CORE_HEADER
135135
| READYTORUN_FLAG_COMPONENT | 0x00000020 | This is a component assembly of a composite R2R image
136136
| READYTORUN_FLAG_MULTIMODULE_VERSION_BUBBLE | 0x00000040 | This R2R module has multiple modules within its version bubble (For versions before version 6.3, all modules are assumed to possibly have this characteristic)
137137
| READYTORUN_FLAG_UNRELATED_R2R_CODE | 0x00000080 | This R2R module has code in it that would not be naturally encoded into this module
138+
| READYTORUN_FLAG_PLATFORM_NATIVE_IMAGE | 0x00000100 | The owning composite executable is in the platform native format
138139

139140
## READYTORUN_SECTION
140141

docs/design/coreclr/botr/readytorun-platform-native-envelope.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,44 @@ Mach‑O support will only be supported for composite ReadyToRun when the target
2222

2323
`crossgen2` does not produce the final shared library. A separate SDK / build linking step must preserve the `RTR_HEADER` export in the final `dylib`.
2424

25+
### Mach-O Emitter Decisions
26+
27+
There's a few cases in the R2R format that are not natively represented in the Mach-O format that have to be emulated. This section will describe some of the design decisions for the Mach-O R2R format.
28+
29+
#### Sections
30+
31+
Sections folded into `__TEXT,__text` that is in other sections in the PE envelope:
32+
33+
- CLR metadata: In the PE format, put in .cormeta, corresponds to the PE Header's "COR Header directory"
34+
- Win32 Resources: In the PE format, put in .rsrc, corresponds to the PE Header's "Win32 Resources Header directory"
35+
- Managed Unwind Info: In the Mach-O format, this section is expected to be in the Mach-O unwind format. The unwind info used by the runtime must be in the Windows unwind format.
36+
- GC Info: Entries correspond to the unwind info.
37+
38+
Data moved out of `__TEXT,__text`:
39+
40+
- Precompiled managed code has been moved into `__TEXT,__managedcode`. `__TEXT,__text` gets special treatment by the linker and `__TEXT,__managedcode` matches NativeAOT.
41+
42+
Data that stays in the corresponding locations as the PE envelope:
43+
44+
- Read-only data such as jump tables and the R2R headers: `__TEXT,__const`
45+
- Read-write data, such as fixup tables: `__DATA,__data`
46+
- Import thunks: `__TEXT,__text`
47+
48+
#### Relocations
49+
50+
Symbol ranges are represented differently in Mach-O than other platforms. Apple linkers have issues when multiple symbols are defined at the same location. Additionally, the Mach format natively supports a "subtractor" reloc to represent the distance between two symbols. As a result, we can represent the start of the symbol range as the start symbol of the range. We can represent the size of the range we can represent as "end symbol location - start symbol location + end symbol size".
51+
52+
#### Base Symbol and RVAs
53+
54+
The R2R format, like the PE format, is heavily based around having RVAs emitted into the image that can be added to the base symbol of the image. The COFF object file format natively supports such a concept, and the PE format uses such a concept in the PE header. However, other formats do not natively support such a concept.
55+
56+
The Apple linker does provide a base symbol for the Mach format, but the base symbol depends on the output type, generally in the form `__mh_<output>_header`. For dylibs, the symbol is `__mh_dylib_header`. This symbol is located at the address returned by `dlinfo` and `dladdr` for the base address. It also points to the Mach header, which can be used to find the size of the image to bound reads of the R2R data.
57+
58+
As a result, we can emulate this support in the Mach format with ease:
59+
60+
1. The base symbol that we use in the object writer will be `__mh_dylib_header`.
61+
2. To emit the distance from the base symbol, we will use a subtractor relocation to represent "symbol location - `__mh_dylib_header` location".
62+
2563
## Runtime: consuming a platform-native R2R image
2664

2765
The runtime will be updated to handle platform-native R2R images during assembly load.

src/coreclr/crossgen-corelib.proj

Lines changed: 151 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,32 +17,61 @@
1717
</PropertyGroup>
1818

1919
<PropertyGroup>
20-
<BuildDll>true</BuildDll>
21-
<BuildDll Condition="'$(TargetOS)' == 'netbsd' or '$(TargetOS)' == 'illumos' or '$(TargetOS)' == 'solaris' or '$(TargetOS)' == 'haiku'">false</BuildDll>
20+
<CrossgenTargetName>InvokeCrossgen2</CrossgenTargetName>
21+
22+
<PublishReadyToRun>true</PublishReadyToRun>
23+
<!-- Disable crossgen on NetBSD, illumos, Solaris and Haiku for now. This can be revisited when we have full support. -->
24+
<PublishReadyToRun Condition="'$(TargetOS)' == 'netbsd' or '$(TargetOS)' == 'illumos' or '$(TargetOS)' == 'solaris' or '$(TargetOS)' == 'haiku'">false</PublishReadyToRun>
25+
<!-- TODO-WASM: we will have WASM R2R after https://github.com/dotnet/runtime/issues/121257 -->
26+
<PublishReadyToRun Condition="'$(TargetOS)' == 'browser' or '$(TargetOS)' == 'wasi'">false</PublishReadyToRun>
27+
28+
<CrossgenTargetName Condition="!$(PublishReadyToRun)">CopyILCoreLib</CrossgenTargetName>
2229

2330
<BuildPdb>false</BuildPdb>
24-
<BuildPdb Condition="$(BuildDll) and '$(OS)' == 'Windows_NT' and '$(TargetOS)' == 'windows'">true</BuildPdb>
31+
<BuildPdb Condition="'$(OS)' == 'Windows_NT' and '$(TargetOS)' == 'windows'">true</BuildPdb>
2532

2633
<BuildPerfMap>false</BuildPerfMap>
27-
<BuildPerfMap Condition="$(BuildDll) and '$(TargetOS)' == 'linux'">true</BuildPerfMap>
34+
<BuildPerfMap Condition="'$(TargetOS)' == 'linux'">true</BuildPerfMap>
2835

2936
<_MergeMibcFilesCacheFile>$(MibcOptimizationDataDir)/$(TargetOS)/$(TargetArchitecture)/merge_mibc_files.cache</_MergeMibcFilesCacheFile>
3037
</PropertyGroup>
3138

39+
<PropertyGroup Condition="'$(TargetsAppleMobile)' == 'true' and $(PublishReadyToRun)">
40+
<PublishReadyToRunContainerFormat>macho</PublishReadyToRunContainerFormat>
41+
<UseComposite>true</UseComposite>
42+
<CrossgenTargetName>$(CrossgenTargetName);LinkCoreLibMachO</CrossgenTargetName>
43+
</PropertyGroup>
44+
45+
<PropertyGroup Condition="'$(UseComposite)' == 'true'">
46+
<CrossgenTargetName>$(CrossgenTargetName);CopyR2RComponentCoreLib</CrossgenTargetName>
47+
</PropertyGroup>
48+
3249
<ItemGroup>
3350
<OptimizationMibcFiles Include="$(MibcOptimizationDataDir)/$(TargetOS)/$(TargetArchitecture)/**/*.mibc" />
3451
</ItemGroup>
3552

3653
<PropertyGroup>
3754
<CoreLibAssemblyName>System.Private.CoreLib</CoreLibAssemblyName>
3855
<CoreLibOutputPath>$([MSBuild]::NormalizePath('$(BinDir)', '$(CoreLibAssemblyName).dll'))</CoreLibOutputPath>
56+
<CrossgenCoreLibOutputPath>$(CoreLibOutputPath)</CrossgenCoreLibOutputPath>
57+
<CrossgenCoreLibComponentOutputPath></CrossgenCoreLibComponentOutputPath>
3958
<CoreLibNiPdbPath></CoreLibNiPdbPath>
4059
<CoreLibPerfMapPath></CoreLibPerfMapPath>
4160
<CoreLibNiPdbPath Condition="$(BuildPdb)">$([MSBuild]::NormalizePath('$(BinDir)', 'PDB', '$(CoreLibAssemblyName).ni.pdb'))</CoreLibNiPdbPath>
4261
<CoreLibPerfMapPath Condition="$(BuildPerfMap)">$([MSBuild]::NormalizePath('$(BinDir)', '$(CoreLibAssemblyName).ni.r2rmap'))</CoreLibPerfMapPath>
4362
<MergedMibcPath>$([MSBuild]::NormalizePath('$(BinDir)', 'StandardOptimizationData.mibc'))</MergedMibcPath>
4463
</PropertyGroup>
4564

65+
<PropertyGroup Condition="'$(PublishReadyToRunContainerFormat)' == 'macho'">
66+
<CoreLibObjOutputPath>$([MSBuild]::NormalizePath('$(IntermediateOutputPath)', '$(CoreLibAssemblyName).o'))</CoreLibObjOutputPath>
67+
<CrossgenCoreLibOutputPath>$(CoreLibObjOutputPath)</CrossgenCoreLibOutputPath>
68+
<CoreLibDylibOutputPath>$([MSBuild]::NormalizePath('$(BinDir)', '$(CoreLibAssemblyName).dylib'))</CoreLibDylibOutputPath>
69+
</PropertyGroup>
70+
71+
<PropertyGroup Condition="'$(UseComposite)' == 'true'">
72+
<CrossgenCoreLibComponentOutputPath>$([MSBuild]::NormalizePath('$(IntermediateOutputPath)', '$(CoreLibAssemblyName).dll'))</CrossgenCoreLibComponentOutputPath>
73+
</PropertyGroup>
74+
4675
<!-- Creates a hash file that changes whenever the input mibc file modification times change.
4776
This will trigger a re-merge when updating to a new version of the optimization data,
4877
even if the new timestamps are still days in the past. -->
@@ -88,30 +117,25 @@
88117
<Target Name="CreateMergedMibcFile"
89118
DependsOnTargets="ResolveProjectReferences;MergeMibcFiles" />
90119

91-
<Target Name="PrepareInvokeCrossgen" DependsOnTargets="ResolveProjectReferences;CreateMergedMibcFile">
120+
<Target Name="PrepareInvokeCrossgen2" DependsOnTargets="ResolveProjectReferences;CreateMergedMibcFile">
92121
<ItemGroup>
93122
<Crossgen2Inputs Include="@(CoreLib)" />
94123
<Crossgen2Inputs Include="$(MergedMibcPath)" />
95124
<Crossgen2Inputs Include="@(Crossgen2Files->Metadata('OutputPath'))" />
96125
</ItemGroup>
97126
</Target>
98127

99-
<Target Name="InvokeCrossgenBrowser"
100-
DependsOnTargets="PrepareInvokeCrossgen"
101-
Inputs="@(Crossgen2Inputs)"
102-
Outputs="$(CoreLibOutputPath)"
103-
Condition="'$(TargetOS)' == 'browser'"
104-
AfterTargets="Build">
105-
<!-- TODO-WASM: we will have WASM R2R later, for now we just need to copy the file into expected location -->
128+
<Target Name="CopyILCoreLib"
129+
DependsOnTargets="ResolveProjectReferences"
130+
Inputs="@(CoreLib)"
131+
Outputs="$(CoreLibOutputPath)">
106132
<Copy SourceFiles="@(CoreLib)" DestinationFiles="$(CoreLibOutputPath)" UseHardlinksIfPossible="true" />
107133
</Target>
108134

109-
<Target Name="InvokeCrossgen"
110-
DependsOnTargets="PrepareInvokeCrossgen;CreateMergedMibcFile"
135+
<Target Name="InvokeCrossgen2"
136+
DependsOnTargets="PrepareInvokeCrossgen2;CreateMergedMibcFile"
111137
Inputs="@(Crossgen2Inputs)"
112-
Outputs="$(CoreLibOutputPath);$(CoreLibNiPdbPath);$(CoreLibPerfMapPath)"
113-
Condition="'$(TargetOS)' != 'browser'"
114-
AfterTargets="Build">
138+
Outputs="$(CoreLibOutputPath);$(CoreLibNiPdbPath);$(CoreLibPerfMapPath);$(CrossgenCoreLibOutputPath);$(CrossgenCoreLibComponentOutputPath)">
115139

116140
<MakeDir
117141
Directories="$(BinDir);$(IntermediatesDir);$(LogsDir)" />
@@ -121,9 +145,11 @@
121145

122146
<PropertyGroup>
123147
<CrossGenDllCmd>@(Crossgen2Files->Metadata('OutputPath')->WithMetadataValue('Filename','crossgen2')->WithMetadataValue('Extension','$(ExeSuffix)'))</CrossGenDllCmd>
124-
<CrossGenDllCmd>$(CrossGenDllCmd) -o:$(CoreLibOutputPath)</CrossGenDllCmd>
148+
<CrossGenDllCmd>$(CrossGenDllCmd) -o:$(CrossgenCoreLibOutputPath)</CrossGenDllCmd>
125149
<CrossGenDllCmd>$(CrossGenDllCmd) -r:$([MSBuild]::NormalizePath('$(BinDir)', 'IL', '*.dll'))</CrossGenDllCmd>
126150
<CrossGenDllCmd>$(CrossGenDllCmd) --targetarch:$(TargetArchitecture)</CrossGenDllCmd>
151+
<CrossGenDllCmd Condition="'$(PublishReadyToRunContainerFormat)' != ''">$(CrossGenDllCmd) --obj-format:$(PublishReadyToRunContainerFormat)</CrossGenDllCmd>
152+
<CrossGenDllCmd Condition="'$(UseComposite)' == 'true'">$(CrossGenDllCmd) --composite</CrossGenDllCmd>
127153
<CrossGenDllCmd Condition="'$(TargetsAndroid)' != 'true'">$(CrossGenDllCmd) --targetos:$(TargetOS)</CrossGenDllCmd>
128154
<!-- Unless and until Android requires R2R specific customizations, we're just dealing with another linux -->
129155
<CrossGenDllCmd Condition="'$(TargetsAndroid)' == 'true'">$(CrossGenDllCmd) --targetos:linux</CrossGenDllCmd>
@@ -145,21 +171,119 @@
145171
<CrossGenDllCmd>$(CrossGenDllCmd) --perfmap --perfmap-path:$(BinDir)</CrossGenDllCmd>
146172
</PropertyGroup>
147173

148-
<Message Condition="$(BuildDll)" Importance="High" Text="$(CrossGenDllCmd)" />
174+
<Message Importance="High" Text="$(CrossGenDllCmd)" />
149175

150-
<Exec Condition="$(BuildDll)" Command="$(CrossGenDllCmd)" />
176+
<Exec Command="$(CrossGenDllCmd)" />
151177

152-
<Message Condition="$(BuildPdb)" Importance="High" Text="$(CrossGenPdbCmd)" />
178+
<Message Importance="High" Text="Crossgenning of System.Private.CoreLib succeeded." />
179+
<Message Importance="High" Text="Product binaries are available at $(BinDir)" />
180+
</Target>
153181

154-
<Exec Condition="$(BuildPdb) and '$(CrossGenPdbCmd)' != ''" Command="$(CrossGenPdbCmd)" />
182+
<Target Name="CopyR2RComponentCoreLib"
183+
DependsOnTargets="InvokeCrossgen2"
184+
Inputs="$(CrossgenCoreLibComponentOutputPath)"
185+
Outputs="$(CoreLibOutputPath)">
186+
<Copy SourceFiles="$(CrossgenCoreLibComponentOutputPath)" DestinationFiles="$(CoreLibOutputPath)" UseHardlinksIfPossible="true" />
187+
</Target>
155188

156-
<Message Condition="$(BuildPerfMap)" Importance="High" Text="$(CrossGenPerfMapCmd)" />
189+
<Target
190+
Name="LinkCoreLibMachO"
191+
Inputs="$(CoreLibObjOutputPath)"
192+
Outputs="$(CoreLibDylibOutputPath)">
193+
<PropertyGroup>
194+
<_AppleTargetArchitecture Condition="'$(TargetArchitecture)' == 'x64'">x86_64</_AppleTargetArchitecture>
195+
<_AppleTargetArchitecture Condition="'$(TargetArchitecture)' == 'arm64'">arm64</_AppleTargetArchitecture>
196+
</PropertyGroup>
157197

158-
<Exec Condition="$(BuildPerfMap) and '$(CrossGenPerfMapCmd)' != ''" Command="$(CrossGenPerfMapCmd)" />
198+
<PropertyGroup>
199+
<AppleMinOSVersion Condition="'$(AppleMinOSVersion)' == '' and '$(TargetOS)' == 'osx'">12.0</AppleMinOSVersion>
200+
<AppleMinOSVersion Condition="'$(AppleMinOSVersion)' == '' and '$(TargetOS)' == 'maccatalyst'">15.0</AppleMinOSVersion>
201+
<AppleMinOSVersion Condition="'$(AppleMinOSVersion)' == '' and ($(TargetOS.StartsWith('ios')) or $(TargetOS.StartsWith('tvos')))">12.2</AppleMinOSVersion>
202+
203+
<_AppleSdkName Condition="'$(TargetOS)' == 'ios'">iphoneos</_AppleSdkName>
204+
<_AppleSdkName Condition="'$(TargetOS)' == 'iossimulator'">iphonesimulator</_AppleSdkName>
205+
<_AppleSdkName Condition="'$(TargetOS)' == 'tvos'">appletvos</_AppleSdkName>
206+
<_AppleSdkName Condition="'$(TargetOS)' == 'tvossimulator'">appletvsimulator</_AppleSdkName>
207+
<_AppleSdkName Condition="'$(TargetOS)' == 'maccatalyst' or '$(TargetOS)' == 'osx'">macosx</_AppleSdkName>
208+
209+
<_AppleTripleOS Condition="'$(TargetOS)' == 'osx'">macos</_AppleTripleOS>
210+
<_AppleTripleOS Condition="'$(TargetOS)' == 'maccatalyst' or $(TargetOS.StartsWith('ios'))">ios</_AppleTripleOS>
211+
<_AppleTripleOS Condition="$(TargetOS.StartsWith('tvos'))">tvos</_AppleTripleOS>
212+
213+
<_AppleTripleAbi Condition="'$(TargetOS)' == 'ios' or '$(TargetOS)' == 'tvos'">macho</_AppleTripleAbi>
214+
<_AppleTripleAbi Condition="'$(TargetOS)' == 'maccatalyst'">macabi</_AppleTripleAbi>
215+
<_AppleTripleAbi Condition="$(TargetOS.EndsWith('simulator'))">simulator</_AppleTripleAbi>
216+
217+
<TargetTriple Condition="'$(_AppleTripleAbi)' == ''">$(_AppleTargetArchitecture)-apple-$(_AppleTripleOS)$(AppleMinOSVersion)</TargetTriple>
218+
<TargetTriple Condition="'$(_AppleTripleAbi)' != ''">$(_AppleTargetArchitecture)-apple-$(_AppleTripleOS)$(AppleMinOSVersion)-$(_AppleTripleAbi)</TargetTriple>
219+
</PropertyGroup>
159220

160-
<Copy Condition="!$(BuildDll)" SourceFiles="@(CoreLib)" DestinationFiles="$(CoreLibOutputPath)" UseHardlinksIfPossible="true" />
221+
<PropertyGroup>
222+
<Xcrun Condition="'$(Xcrun)' == ''">xcrun</Xcrun>
223+
<_WhereXcrun>0</_WhereXcrun>
224+
</PropertyGroup>
161225

162-
<Message Importance="High" Text="Crossgenning of System.Private.CoreLib succeeded." />
163-
<Message Importance="High" Text="Product binaries are available at $(BinDir)" />
226+
<Exec Command="command -v &quot;$(Xcrun)&quot;" IgnoreExitCode="true" StandardOutputImportance="Low">
227+
<Output TaskParameter="ExitCode" PropertyName="_WhereXcrun" />
228+
</Exec>
229+
<Error Condition="'$(_WhereXcrun)' != '0'"
230+
Text="'$(Xcrun)' not found in PATH. Make sure '$(Xcrun)' is available in PATH." />
231+
232+
<Exec Command="&quot;$(Xcrun)&quot; --sdk $(_AppleSdkName) --show-sdk-path" IgnoreExitCode="true" StandardOutputImportance="Low" ConsoleToMsBuild="true">
233+
<Output TaskParameter="ConsoleOutput" PropertyName="SysRoot" />
234+
</Exec>
235+
236+
<Error Condition="!Exists('$(SysRoot)')"
237+
Text="Apple SDK was not found in: '$(SysRoot)'" />
238+
239+
<Exec Command="&quot;$(Xcrun)&quot; --sdk $(_AppleSdkName) --find clang" IgnoreExitCode="true" StandardOutputImportance="Low" ConsoleToMsBuild="true">
240+
<Output TaskParameter="ConsoleOutput" PropertyName="_AppleClang" />
241+
</Exec>
242+
243+
<Error Condition="!Exists('$(_AppleClang)')"
244+
Text="Apple Clang was not found at: '$(_AppleClang)'" />
245+
246+
<ItemGroup>
247+
<_MachLinkerArg Include="-gz=zlib" />
248+
<_MachLinkerArg Include="-isysroot &quot;$(SysRoot)&quot;" />
249+
<_MachLinkerArg Include="--target=$(TargetTriple)" />
250+
<_MachLinkerArg Include="-g" />
251+
<_MachLinkerArg Include="-dynamiclib" />
252+
<_MachLinkerArg Include="-Wl,-dead_strip" />
253+
</ItemGroup>
254+
255+
<Exec Command="&quot;$(_AppleClang)&quot; --version" IgnoreExitCode="true" StandardOutputImportance="Low" IgnoreStandardErrorWarningFormat="true" ConsoleToMSBuild="true">
256+
<Output TaskParameter="ExitCode" PropertyName="_XcodeVersionStringExitCode" />
257+
<Output TaskParameter="ConsoleOutput" PropertyName="_XcodeVersionString" />
258+
</Exec>
259+
260+
<PropertyGroup Condition="('$(_XcodeVersionStringExitCode)' == '0' or '$(_XcodeVersionStringExitCode)' == '1') and '$(_XcodeVersionString)' != ''">
261+
<_XcodeVersion>$([System.Text.RegularExpressions.Regex]::Match($(_XcodeVersionString), '[1-9]\d*'))</_XcodeVersion>
262+
</PropertyGroup>
263+
264+
<ItemGroup Condition="'$(UseLdClassicXCodeLinker)' != 'false'">
265+
<_MachLinkerArg Condition="'$(UseLdClassicXCodeLinker)' == 'true' or '$(_XcodeVersion)' == '15' or '$(_XcodeVersion)' == '16'" Include="-ld_classic" />
266+
</ItemGroup>
267+
268+
<PropertyGroup Condition="'$(UseLdClassicXCodeLinker)' != 'false'">
269+
<!-- Xcode 16 warns on -ld_classic -->
270+
<_IgnoreLinkerWarnings Condition="'$(_XcodeVersion)' == '16'">true</_IgnoreLinkerWarnings>
271+
</PropertyGroup>
272+
273+
<ItemGroup>
274+
<_MachLinkerArg Include="-Wl,-install_name,&quot;@rpath/$(CoreLibAssemblyName).dylib&quot;" />
275+
<_MachLinkerArg Include="$(CoreLibObjOutputPath)" />
276+
<_MachLinkerArg Include="-o $(CoreLibDylibOutputPath)" />
277+
</ItemGroup>
278+
279+
<MakeDir Directories="$([System.IO.Path]::GetDirectoryName($(CoreLibDylibOutputPath)))" />
280+
281+
<Exec Command="&quot;$(_AppleClang)&quot; @(_MachLinkerArg, ' ')"
282+
IgnoreStandardErrorWarningFormat="$(_IgnoreLinkerWarnings)"/>
283+
284+
<!-- remove executable flag -->
285+
<Exec Command="chmod 644 &quot;$(CoreLibDylibOutputPath)&quot;" />
164286
</Target>
287+
288+
<Target Name="CrossgenCoreLib" DependsOnTargets="$(CrossgenTargetName)" AfterTargets="CoreBuild" />
165289
</Project>

src/coreclr/inc/readytorun.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
// If you update this, ensure you run `git grep MINIMUM_READYTORUN_MAJOR_VERSION`
2121
// and handle pending work.
2222
#define READYTORUN_MAJOR_VERSION 17
23-
#define READYTORUN_MINOR_VERSION 0x0000
23+
#define READYTORUN_MINOR_VERSION 0x0001
2424

2525
#define MINIMUM_READYTORUN_MAJOR_VERSION 17
2626

@@ -47,7 +47,10 @@
4747
// R2R Version 14 changed x86 code generation to use funclets
4848
// R2R Version 15 removes double to int/uint helper calls
4949
// R2R Version 16 replaces the compression format for debug boundaries with a new format that is smaller and more efficient to parse
50+
// R2R 16 is not backward compatible with 15.x or earlier.
5051
// R2R Version 17 adds support for producing "fat" debug information (that e.g. can include async debug info)
52+
// R2R 17 is not backward compatible with 16.x or earlier.
53+
// R2R Version 17.1 adds the READYTORUN_FLAG_PLATFORM_NATIVE_IMAGE flag to specify that the R2R image pointed to by OwnerCompositeExecutable is in the platform native format.
5154

5255
struct READYTORUN_CORE_HEADER
5356
{

src/coreclr/nativeaot/Runtime/inc/ModuleHeaders.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ struct ReadyToRunHeaderConstants
1212
static const uint32_t Signature = 0x00525452; // 'RTR'
1313

1414
static const uint32_t CurrentMajorVersion = 17;
15-
static const uint32_t CurrentMinorVersion = 0;
15+
static const uint32_t CurrentMinorVersion = 1;
1616
};
1717

1818
struct ReadyToRunHeader

0 commit comments

Comments
 (0)