Commit 1753549
[android] Enable android-arm CoreCLR with softfp ABI handling (#127578)
> [!NOTE]
> This PR description was updated with GitHub Copilot.
Fixes #127500.
## Description
This re-enables the `android-arm` CoreCLR runtime pack and CI coverage,
and fixes the Android ARM softfp ABI handling needed for native code,
ReadyToRun/Crossgen2-generated code, and NativeAOT target handling.
Android `arm` maps to the `armeabi-v7a` ABI. That ABI can use VFP
instructions internally, but floating-point arguments and return values
cross function-call boundaries through core registers/stack rather than
VFP argument registers. In .NET target terminology, the matching AOT/JIT
ABI is `armel`.
The original enablement exposed runtime crashes caused by parts of the
build and code-generation pipeline disagreeing on that ABI.
Native/CoreCLR builds needed `ARM_SOFTFP`, and AOT compiler target
handling needed to treat Android ARM as Linux/Bionic with the softfp
ABI.
## Changes
- Re-enable `android-arm` as a supported CoreCLR runtime pack target.
- Re-enable Android ARM CoreCLR legs in the runtime and extra-platform
CI pipelines.
- Add Android ARM Helix queue selection.
- Set `ARM_SOFTFP` for Android ARM native/CoreCLR builds.
- Treat Android ARM compile definitions as softfp when setting CoreCLR
target definitions.
- Keep Android as an accepted AOT command-line target OS without
extending the internal `TargetOS` enum.
- Centralize Android command-line normalization in both Crossgen2 and
NativeAOT ILCompiler:
```text
--targetos:android -> TargetOS.Linux
--targetos:android --targetarch:arm -> NativeAotArmel / softfp ABI
--targetos:android --targetarch:arm64 -> NativeAot
```
- Update Crossgen2 call sites to pass the real Android target identity
instead of duplicating Android-to-Linux remaps in MSBuild.
- Update NativeAOT build integration to pass `--targetos:android`
through to ILCompiler while preserving the existing bionic ARM `armel`
target-architecture handling.
## Validation
Built Android ARM locally:
```sh
./build.sh clr+libs+host+packs -os android -arch arm -c Release
```
Result:
```text
Build succeeded.
0 Warning(s)
0 Error(s)
```
Validated on a physical Android device with `armeabi-v7a` support.
The following Android ARM test runs completed with zero failures with
both `TestReadyToRun=true` and `TestReadyToRun=false`:
- `System.Runtime.Tests`
- `System.Runtime.Numerics.Tests`
- `System.Numerics.Vectors.Tests`
- `System.Numerics.Tensors.Tests`
- `Microsoft.Bcl.Numerics.Tests`
Additional validation for the centralized AOT target handling:
```sh
./build.sh clr+libs+host /p:RestoreDisableParallel=true
./dotnet.sh build src/coreclr/tools/aot/crossgen2/crossgen2.csproj /p:RestoreDisableParallel=true
./dotnet.sh build src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj /p:RestoreDisableParallel=true
./dotnet.sh build src/tasks/Crossgen2Tasks/Crossgen2Tasks.csproj /p:RestoreDisableParallel=true
./build.sh tasks /p:RestoreDisableParallel=true
./dotnet.sh build src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILCompiler.TypeSystem.Tests.csproj /t:Test --no-restore
./dotnet.sh build src/coreclr/tools/aot/ILCompiler.Compiler.Tests/ILCompiler.Compiler.Tests.csproj /t:Test --no-restore
```
Also smoke-tested that both Crossgen2 and ILCompiler accept Android
target arguments, including `--targetos:android --targetarch:arm` and
`--targetos:android --targetarch:arm64`, and that the existing
`--targetos:linux --targetarch:armel` normalization still works.
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>1 parent 11b17d7 commit 1753549
20 files changed
Lines changed: 66 additions & 82 deletions
File tree
- eng
- native
- pipelines
- coreclr/templates
- extra-platforms
- libraries
- testing
- src
- coreclr
- jit
- nativeaot/BuildIntegration
- tools
- Common
- aot
- ILCompiler
- crossgen2
- installer/pkg/sfx/Microsoft.NETCore.App
- mono/msbuild/android/build
- tasks/Crossgen2Tasks
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
| 32 | + | |
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
374 | 378 | | |
375 | 379 | | |
376 | 380 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | 84 | | |
89 | 85 | | |
90 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
49 | 56 | | |
50 | 57 | | |
51 | 58 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
98 | 100 | | |
99 | 101 | | |
100 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1106 | 1106 | | |
1107 | 1107 | | |
1108 | 1108 | | |
1109 | | - | |
| 1109 | + | |
1110 | 1110 | | |
1111 | 1111 | | |
1112 | 1112 | | |
| |||
1116 | 1116 | | |
1117 | 1117 | | |
1118 | 1118 | | |
| 1119 | + | |
1119 | 1120 | | |
1120 | 1121 | | |
1121 | 1122 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | 6 | | |
9 | 7 | | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
13 | | - | |
| 11 | + | |
14 | 12 | | |
15 | 13 | | |
16 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | 295 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
163 | | - | |
164 | | - | |
| 162 | + | |
165 | 163 | | |
166 | 164 | | |
167 | 165 | | |
| |||
0 commit comments