Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
9127b77
Fix Android ARM softfp ABI handling
simonrozsival Apr 29, 2026
9aab8ac
Enable Android ARM CoreCLR CI
simonrozsival Apr 29, 2026
5e6a157
Map Android ARM Crossgen2 invocations to armel
simonrozsival Apr 30, 2026
95f8bec
Use CrossGen target property naming for Android remap
simonrozsival Apr 30, 2026
8f2df4d
Centralize Android target handling in AOT tools
simonrozsival Apr 30, 2026
8d9c811
Normalize Android AOT target at command line boundary
simonrozsival Apr 30, 2026
75eddef
Cleanup
simonrozsival May 4, 2026
a10d06f
Address AOT target option review feedback
simonrozsival May 5, 2026
561f041
Merge branch 'main' of github.com:dotnet/runtime into dev/simonrozsiv…
simonrozsival May 5, 2026
86b8be3
Clean up
simonrozsival May 5, 2026
ae475c9
Always pass android target OS directly
simonrozsival May 5, 2026
7881483
Undo unnecessary changes
simonrozsival May 5, 2026
450ec03
Rename GetTargetDetails to GetTargetSpec
simonrozsival May 5, 2026
ce21d4a
Clean up
simonrozsival May 5, 2026
8ff1e3e
Add armel to the list of valid architectures for ilc
simonrozsival May 5, 2026
3405a8d
Remove unnecessary <arg>
simonrozsival May 6, 2026
90ff6d6
Update valid os and architecture for help
simonrozsival May 6, 2026
e1a1245
Remove redundant cmake configuration
simonrozsival May 6, 2026
956a735
Switch to the new Android.Arm32 queue
simonrozsival May 7, 2026
57a0998
Update helix queues setup
simonrozsival May 7, 2026
7d81b13
Apply suggestion from @jkotas
jkotas May 8, 2026
1022e38
Potential fix for pull request finding
jkotas May 8, 2026
bf09f90
Apply suggestion from @jkotas
jkotas May 8, 2026
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
3 changes: 1 addition & 2 deletions eng/Subsets.props
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
<!-- Determine if the CoreCLR runtime can build/run for the specified target. -->
<_CoreCLRSupportedOS Condition="'$(TargetsMobile)' != 'true' and '$(TargetsLinuxBionic)' != 'true'">true</_CoreCLRSupportedOS>

<!-- Android 32-bit builds blocked by https://github.com/dotnet/runtime/issues/111665 -->
<_CoreCLRSupportedOS Condition="'$(TargetsAndroid)' == 'true' and '$(TargetArchitecture)' != 'arm' and '$(TargetArchitecture)' != 'x86'">true</_CoreCLRSupportedOS>
<_CoreCLRSupportedOS Condition="'$(TargetsAndroid)' == 'true' and '$(TargetArchitecture)' != 'x86'">true</_CoreCLRSupportedOS>
<_CoreCLRSupportedOS Condition="'$(TargetsBrowser)' == 'true'">true</_CoreCLRSupportedOS>
<_CoreCLRSupportedOS Condition="'$(TargetsAppleMobile)' == 'true'">true</_CoreCLRSupportedOS>

Expand Down
7 changes: 7 additions & 0 deletions eng/pipelines/coreclr/templates/helix-queues-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ jobs:
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
- OSX.15.Amd64

# Android arm
- ${{ if in(parameters.platform, 'android_arm') }}:
- ${{ if eq(variables['System.TeamProject'], 'public') }}:
- Windows.11.Amd64.Android.Arm32.Open
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
- Windows.11.Amd64.Android.Arm32

# Android arm64
- ${{ if in(parameters.platform, 'android_arm64') }}:
- ${{ if eq(variables['System.TeamProject'], 'public') }}:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ jobs:
buildConfig: Release
runtimeFlavor: coreclr
platforms:
- android_arm
- android_arm64
variables:
# map dependencies variables to local variables
Expand Down
4 changes: 3 additions & 1 deletion eng/pipelines/libraries/helix-queues-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ jobs:
- Ubuntu.2204.Amd64.Android.29.Open
- ${{ if and(ne(variables['System.TeamProject'], 'public'), in(parameters.platform, 'android_arm', 'android_arm64', 'linux_bionic_arm', 'linux_bionic_arm64')) }}:
- Ubuntu.2204.Amd64.Android.29.Open
- ${{ if and(eq(variables['System.TeamProject'], 'public'), in(parameters.platform, 'android_arm', 'android_arm64', 'linux_bionic_arm', 'linux_bionic_arm64')) }}:
- ${{ if and(eq(variables['System.TeamProject'], 'public'), in(parameters.platform, 'android_arm', 'linux_bionic_arm')) }}:
- Windows.11.Amd64.Android.Arm32.Open
- ${{ if and(eq(variables['System.TeamProject'], 'public'), in(parameters.platform, 'android_arm64', 'linux_bionic_arm64')) }}:
- Windows.11.Amd64.Android.Open

# iOS Simulator/Mac Catalyst arm64
Expand Down
3 changes: 2 additions & 1 deletion eng/pipelines/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,7 @@ extends:
eq(variables['isRollingBuild'], true))

#
# Android arm64 devices and x64 emulators
# Android arm/arm64 devices and x64 emulators
# Build the whole product using CoreCLR and run functional tests
#
- template: /eng/pipelines/common/platform-matrix.yml
Expand All @@ -1110,6 +1110,7 @@ extends:
buildConfig: Release
runtimeFlavor: coreclr
platforms:
- android_arm
- android_x64
- android_arm64
variables:
Expand Down
4 changes: 1 addition & 3 deletions eng/testing/tests.readytorun.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
<Target Name="ResolveReadyToRunCompilers">
<PropertyGroup>
<Crossgen2Path>$([MSBuild]::NormalizePath('$(Crossgen2InBuildDir)', 'crossgen2$(ExeSuffix)'))</Crossgen2Path>
<_CrossGenTargetOS Condition="'$(TargetsAndroid)' != 'true'">$(TargetOS)</_CrossGenTargetOS>
<_CrossGenTargetOS Condition="'$(TargetsAndroid)' == 'true'">linux</_CrossGenTargetOS>
</PropertyGroup>

<ItemGroup>
<Crossgen2Tool Include="$(Crossgen2Path)"
TargetArch="$(TargetArchitecture)"
TargetOS="$(_CrossGenTargetOS)"
TargetOS="$(TargetOS)"
PerfmapFormatVersion="$(PublishReadyToRunPerfmapFormatVersion)"/>
</ItemGroup>
</Target>
Expand Down
3 changes: 2 additions & 1 deletion src/coreclr/clrdefinitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ function(set_target_definitions_to_custom_os_and_arch)
target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_WASM32)
endif()

if (TARGETDETAILS_ARCH STREQUAL "armel")
if (TARGETDETAILS_ARCH STREQUAL "armel" OR
(TARGETDETAILS_ARCH STREQUAL "arm" AND CLR_CMAKE_TARGET_ANDROID))
target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE ARM_SOFTFP)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This ARM_SOFTFP define looks redundant. Delete it?

eng\native\gen-buildsys.sh(85):cmake_extra_defines="$cmake_extra_defines -DARM_SOFTFP=1"

endif()
endfunction()
4 changes: 1 addition & 3 deletions src/coreclr/crossgen-corelib.proj
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,7 @@
<CrossGenDllCmd>$(CrossGenDllCmd) --targetarch:$(TargetArchitecture)</CrossGenDllCmd>
<CrossGenDllCmd Condition="'$(PublishReadyToRunContainerFormat)' != ''">$(CrossGenDllCmd) --obj-format:$(PublishReadyToRunContainerFormat)</CrossGenDllCmd>
<CrossGenDllCmd Condition="'$(UseComposite)' == 'true'">$(CrossGenDllCmd) --composite</CrossGenDllCmd>
<CrossGenDllCmd Condition="'$(TargetsAndroid)' != 'true'">$(CrossGenDllCmd) --targetos:$(TargetOS)</CrossGenDllCmd>
<!-- Unless and until Android requires R2R specific customizations, we're just dealing with another linux -->
<CrossGenDllCmd Condition="'$(TargetsAndroid)' == 'true'">$(CrossGenDllCmd) --targetos:linux</CrossGenDllCmd>
<CrossGenDllCmd>$(CrossGenDllCmd) --targetos:$(TargetOS)</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
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,7 @@ The .NET Foundation licenses this file to you under the MIT license.
<IlcArg Include="@(IlcSatelliteAssembly->'--satellite:%(Identity)')" />
<IlcArg Include="@(MibcFile->'--mibc:%(Identity)')" />
<IlcArg Condition="$(IlcGenerateMetadataLog) == 'true'" Include="--metadatalog:$(NativeIntermediateOutputPath)%(ManagedBinary.Filename).metadata.csv" />
<!-- To the NativeAOT compiler, Android is just another linux -->
<IlcArg Condition="'$(_targetOS)' == 'android'" Include="--targetos:linux" />
<IlcArg Condition="'$(_targetOS)' != '' and '$(_targetOS)' != 'android'" Include="--targetos:$(_targetOS)" />
<IlcArg Condition="'$(_targetOS)' != ''" Include="--targetos:$(_targetOS)" />
<IlcArg Condition="$(_targetArchitectureWithAbi) != ''" Include="--targetarch:$(_targetArchitectureWithAbi)" />
Comment thread
jkotas marked this conversation as resolved.
<IlcArg Condition="$(IlcMultiModule) == 'true'" Include="--multifile" />
<IlcArg Condition="$(IlcMultiModule) != 'true' and '$(IlcDehydrate)' != 'false' and ($(_targetOS) != 'win' or '$(OptimizationPreference)' == 'Size' or '$(IlcDehydrate)' == 'true')" Include="--dehydrate" />
Expand Down
22 changes: 21 additions & 1 deletion src/coreclr/tools/Common/CommandLineHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ internal static partial class Helpers
{
public const string DefaultSystemModule = "System.Private.CoreLib";

public static string[] ValidOS { get; } = ["windows", "linux", "freebsd", "osx", "maccatalyst", "ios", "iossimulator", "tvos", "tvossimulator", "android", "browser", "wasi"];
public static string[] ValidArchitectures { get; } = ["arm", "armel", "arm64", "x86", "x64", "riscv64", "loongarch64", "wasm"];

public static Dictionary<string, string> BuildPathDictionary(IReadOnlyList<Token> tokens, bool strict)
{
Dictionary<string, string> dictionary = new(StringComparer.OrdinalIgnoreCase);
Expand Down Expand Up @@ -73,7 +76,7 @@ public static TargetOS GetTargetOS(string token)

return token.ToLowerInvariant() switch
{
"linux" => TargetOS.Linux,
"linux" or "android" => TargetOS.Linux,
"win" or "windows" => TargetOS.Windows,
"osx" => TargetOS.OSX,
"freebsd" => TargetOS.FreeBSD,
Expand Down Expand Up @@ -120,6 +123,23 @@ public static TargetArchitecture GetTargetArchitecture(string token)
}
}

public static (TargetArchitecture, TargetOS, TargetAbi) GetTargetSpec(string targetArchitectureToken, string targetOSToken)
{
targetArchitectureToken = targetArchitectureToken?.ToLowerInvariant();
targetOSToken = targetOSToken?.ToLowerInvariant();

TargetArchitecture targetArchitecture = GetTargetArchitecture(targetArchitectureToken);
Comment thread
jkotas marked this conversation as resolved.
TargetOS targetOS = GetTargetOS(targetOSToken);
TargetAbi targetAbi = (targetOSToken, targetArchitectureToken) switch
{
(_, "armel") => TargetAbi.NativeAotArmel,
("android", "arm") => TargetAbi.NativeAotArmel,
_ => TargetAbi.NativeAot,
};

return (targetArchitecture, targetOS, targetAbi);
}

public static RootCommand UseVersion(this RootCommand command)
{
for (int i = 0; i < command.Options.Count; i++)
Expand Down
31 changes: 7 additions & 24 deletions src/coreclr/tools/aot/ILCompiler/ILCompilerRootCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@ internal sealed class ILCompilerRootCommand : RootCommand
new("--trim") { DefaultValueFactory = _ => Array.Empty<string>(), Description = "Trim the specified assembly" };
public Option<bool> RootDefaultAssemblies { get; } =
new("--defaultrooting") { Description = "Root assemblies that are not marked [IsTrimmable]" };
public Option<TargetArchitecture> TargetArchitecture { get; } =
new("--targetarch") { CustomParser = MakeTargetArchitecture, DefaultValueFactory = MakeTargetArchitecture, Description = "Target architecture for cross compilation", HelpName = "arg" };
public Option<TargetOS> TargetOS { get; } =
new("--targetos") { CustomParser = result => Helpers.GetTargetOS(result.Tokens.Count > 0 ? result.Tokens[0].Value : null), DefaultValueFactory = result => Helpers.GetTargetOS(result.Tokens.Count > 0 ? result.Tokens[0].Value : null), Description = "Target OS for cross compilation", HelpName = "arg" };
public Option<string> TargetArchitecture { get; } =
new("--targetarch") { Description = "Target architecture for cross compilation" };
public Option<string> TargetOS { get; } =
new("--targetos") { Description = "Target OS for cross compilation" };
public Option<string> JitPath { get; } =
new("--jitpath") { Description = "Path to JIT compiler library" };
public Option<string> SingleMethodTypeName { get; } =
Expand All @@ -187,8 +187,6 @@ internal sealed class ILCompilerRootCommand : RootCommand

public OptimizationMode OptimizationMode { get; private set; }
public ParseResult Result;
public static bool IsArmel { get; private set; }

public ILCompilerRootCommand(string[] args) : base(".NET Native IL Compiler")
{
Arguments.Add(InputFilePaths);
Expand Down Expand Up @@ -349,20 +347,17 @@ public static void PrintExtendedHelp(ParseResult _)
Console.WriteLine("Use the '--' option to disambiguate between input files that have begin with -- and options. After a '--' option, all arguments are " +
"considered to be input files. If no input files begin with '--' then this option is not necessary.\n");

string[] ValidArchitectures = new string[] { "arm", "arm64", "x86", "x64", "riscv64", "loongarch64" };
string[] ValidOS = new string[] { "windows", "linux", "freebsd", "osx", "maccatalyst", "ios", "iossimulator", "tvos", "tvossimulator" };

Console.WriteLine("Valid switches for {0} are: '{1}'. The default value is '{2}'\n", "--targetos", string.Join("', '", ValidOS), Helpers.GetTargetOS(null).ToString().ToLowerInvariant());
Console.WriteLine("Valid switches for {0} are: '{1}'. The default value is '{2}'\n", "--targetos", string.Join("', '", Helpers.ValidOS), Helpers.GetTargetOS(null).ToString().ToLowerInvariant());

Console.WriteLine(string.Format("Valid switches for {0} are: '{1}'. The default value is '{2}'\n", "--targetarch", string.Join("', '", ValidArchitectures), Helpers.GetTargetArchitecture(null).ToString().ToLowerInvariant()));
Console.WriteLine(string.Format("Valid switches for {0} are: '{1}'. The default value is '{2}'\n", "--targetarch", string.Join("', '", Helpers.ValidArchitectures), Helpers.GetTargetArchitecture(null).ToString().ToLowerInvariant()));

Console.WriteLine("The allowable values for the --instruction-set option are described in the table below. Each architecture has a different set of valid " +
"instruction sets, and multiple instruction sets may be specified by separating the instructions sets by a ','. By default other instruction sets not " +
"specified may light-up optimistically via dynamic checks. Individual instruction sets can be disallowed from such light-up by prefixing them with '-'. " +
"All such light-up can be disallowed by specifying '-optimistic'. The instruction sets supported by the machine invoking the tool can be targeted by " +
"specifying 'native'. For example 'native', 'avx,aes', 'avx,aes,-avx2', or 'avx,aes,-optimistic'");

foreach (string arch in ValidArchitectures)
foreach (string arch in Helpers.ValidArchitectures)
{
TargetArchitecture targetArch = Helpers.GetTargetArchitecture(arch);
bool first = true;
Expand Down Expand Up @@ -395,18 +390,6 @@ public static void PrintExtendedHelp(ParseResult _)
Console.WriteLine(string.Join(", ", Internal.JitInterface.InstructionSetFlags.AllCpuNames));
}

private static TargetArchitecture MakeTargetArchitecture(ArgumentResult result)
{
string firstToken = result.Tokens.Count > 0 ? result.Tokens[0].Value : null;
if (firstToken != null && firstToken.Equals("armel", StringComparison.OrdinalIgnoreCase))
{
IsArmel = true;
return Internal.TypeSystem.TargetArchitecture.ARM;
}

return Helpers.GetTargetArchitecture(firstToken);
}

private static int MakeParallelism(ArgumentResult result)
{
if (result.Tokens.Count > 0)
Expand Down
5 changes: 2 additions & 3 deletions src/coreclr/tools/aot/ILCompiler/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ public int Run()
// directly encoded as part of the required ISAs.
bool isVectorTOptimistic = false;

TargetArchitecture targetArchitecture = Get(_command.TargetArchitecture);
TargetOS targetOS = Get(_command.TargetOS);
(TargetArchitecture targetArchitecture, TargetOS targetOS, TargetAbi targetAbi) =
Helpers.GetTargetSpec(Get(_command.TargetArchitecture), Get(_command.TargetOS));
InstructionSetSupport instructionSetSupport = Helpers.ConfigureInstructionSetSupport(Get(_command.InstructionSet), Get(_command.MaxVectorTBitWidth), isVectorTOptimistic, targetArchitecture, targetOS,
"Unrecognized instruction set {0}", "Unsupported combination of instruction sets: {0}/{1}", logger,
allowOptimistic: _command.OptimizationMode != OptimizationMode.PreferSize,
Expand All @@ -122,7 +122,6 @@ public int Run()
SharedGenericsMode genericsMode = SharedGenericsMode.CanonicalReferenceTypes;

var simdVectorLength = instructionSetSupport.GetVectorTSimdVector();
var targetAbi = ILCompilerRootCommand.IsArmel ? TargetAbi.NativeAotArmel : TargetAbi.NativeAot;
var targetDetails = new TargetDetails(targetArchitecture, targetOS, targetAbi, simdVectorLength);
CompilerTypeSystemContext typeSystemContext =
new CompilerTypeSystemContext(targetDetails, genericsMode, supportsReflection ? DelegateFeature.All : 0,
Expand Down
Loading
Loading