Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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 src/coreclr/crossgen-corelib.proj
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@
<CrossGenDllCmd Condition="'$(PublishReadyToRunContainerFormat)' == 'wasm'">$(CrossGenDllCmd) "--opt-cross-module:*"</CrossGenDllCmd>
<CrossGenDllCmd Condition="'$(UseComposite)' == 'true'">$(CrossGenDllCmd) --composite</CrossGenDllCmd>
<CrossGenDllCmd>$(CrossGenDllCmd) --targetos:$(TargetOS)</CrossGenDllCmd>
<CrossGenDllCmd Condition="'$(FeatureDynamicCodeCompiled)' != ''">$(CrossGenDllCmd) --target-allows-runtime-code-generation:$(FeatureDynamicCodeCompiled)</CrossGenDllCmd>
<CrossGenDllCmd Condition="'$(UsingToolIbcOptimization)' != 'true' and '$(EnableNgenOptimization)' == 'true'">$(CrossGenDllCmd) -m:$(MergedMibcPath) --embed-pgo-data</CrossGenDllCmd>
<CrossGenDllCmd>$(CrossGenDllCmd) -O</CrossGenDllCmd>
<!-- Enable type and field layout verification to make it easier to catch when the crossgen2 type layout engine and the runtime disagree on layout conventions -->
Expand Down
3 changes: 3 additions & 0 deletions src/coreclr/tools/aot/crossgen2/Crossgen2RootCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ internal class Crossgen2RootCommand : RootCommand
new("--maxgenericcyclebreadth") { DefaultValueFactory = _ => ReadyToRunCompilerContext.DefaultGenericCycleBreadthCutoff, Description = SR.GenericCycleBreadthCutoff };
public Option<string> TargetOS { get; } =
new("--targetos") { Description = SR.TargetOSOption };
public Option<bool?> TargetAllowsRuntimeCodeGeneration { get; } =
new("--target-allows-runtime-code-generation") { Description = SR.TargetAllowsRuntimeCodeGenerationOption };
public Option<string> JitPath { get; } =
new("--jitpath") { Description = SR.JitPathOption };
public Option<bool> PrintReproInstructions { get; } =
Expand Down Expand Up @@ -199,6 +201,7 @@ public Crossgen2RootCommand(string[] args) : base(SR.Crossgen2BannerText)
Options.Add(GenericCycleBreadthCutoff);
Options.Add(TargetArchitecture);
Options.Add(TargetOS);
Options.Add(TargetAllowsRuntimeCodeGeneration);
Options.Add(JitPath);
Options.Add(PrintReproInstructions);
Options.Add(SingleMethodTypeName);
Expand Down
3 changes: 2 additions & 1 deletion src/coreclr/tools/aot/crossgen2/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ public int Run()

(TargetArchitecture targetArchitecture, TargetOS targetOS, TargetAbi targetAbi) =
Helpers.GetTargetSpec(Get(_command.TargetArchitecture), Get(_command.TargetOS));
bool targetAllowsRuntimeCodeGeneration = GetTargetAllowsRuntimeCodeGeneration(targetOS, targetArchitecture);
bool targetAllowsRuntimeCodeGeneration = Get(_command.TargetAllowsRuntimeCodeGeneration)
?? GetTargetAllowsRuntimeCodeGeneration(targetOS, targetArchitecture);

// Crossgen2 is partial AOT and its pre-compiled methods can be thrown away at runtime if
// they mismatch in required ISAs or computed layouts of structs. On targets that allow
Expand Down
3 changes: 3 additions & 0 deletions src/coreclr/tools/aot/crossgen2/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,9 @@
<data name="TargetArchOption" xml:space="preserve">
<value>Target architecture for cross compilation</value>
</data>
<data name="TargetAllowsRuntimeCodeGenerationOption" xml:space="preserve">
<value>Override whether the target supports runtime code generation</value>
</data>
<data name="TargetOSOption" xml:space="preserve">
<value>Target OS for cross compilation</value>
</data>
Expand Down
Loading