Skip to content

Add NativeAOT support for armel - #132007

Open
ashaurtaev wants to merge 1 commit into
dotnet:mainfrom
ashaurtaev:add_armel_to_nativeaot
Open

Add NativeAOT support for armel#132007
ashaurtaev wants to merge 1 commit into
dotnet:mainfrom
ashaurtaev:add_armel_to_nativeaot

Conversation

@ashaurtaev

Copy link
Copy Markdown
Contributor

This PR adds NativeAOT support for linux-armel (ARM soft-float)

Previously crossgen2 and ILCompiler were not built for armel and the NativeAOT runtime pack was missing for this architecture.

Changes:

  • armel is now a separate platform in NativeAOT (not mapped to arm) with ARM_SOFTFP for soft-float ABI
  • Added runtime assembly stubs: GcProbe, InteropThunks, UniversalTransition, StackFrameIterator
  • Registered linux-armel in RID lists for runtime packs, ILCompiler, crossgen2, and apphost
  • Enabled SDK tools and host.native for armel in default CoreCLR subsets

cc @dotnet/samsung

@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Aug 7, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 4 pipeline(s).
12 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib
See info in area-owners.md if you want to be subscribed.

Comment thread eng/Subsets.props
<RuntimeFlavor Condition="'$(RuntimeFlavor)' == '' and '$(TargetsMobile)' == 'true'">Mono</RuntimeFlavor>
<RuntimeFlavor Condition="'$(RuntimeFlavor)' == '' and ($(_subset.Contains('+mono+')) or $(_subset.Contains('+mono.runtime+'))) and (!$(_subset.Contains('+clr+')) and !$(_subset.Contains('+clr.runtime+')) and !$(_subset.Contains('+clr.corelib+')))">Mono</RuntimeFlavor>
<RuntimeFlavor Condition="'$(RuntimeFlavor)' == ''">$(PrimaryRuntimeFlavor)</RuntimeFlavor>
</PropertyGroup>

<PropertyGroup>
<DefaultCoreClrSubsets>clr.native+clr.corelib+clr.tools+clr.nativecorelib+clr.packages+clr.nativeaotlibs+clr.crossarchtools+host.native</DefaultCoreClrSubsets>
<DefaultCoreClrSubsets Condition="'$(TargetRid)' == 'linux-armel'">clr.native+clr.corelib+clr.tools+clr.nativecorelib+clr.packages+clr.nativeaotlibs+clr.crossarchtools</DefaultCoreClrSubsets>
<DefaultCoreClrSubsets Condition="'$(TargetRid)' == 'linux-armel'">clr.native+clr.corelib+clr.tools+clr.nativecorelib+clr.packages+clr.nativeaotlibs+clr.crossarchtools+host.native</DefaultCoreClrSubsets>

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.

Suggested change
<DefaultCoreClrSubsets Condition="'$(TargetRid)' == 'linux-armel'">clr.native+clr.corelib+clr.tools+clr.nativecorelib+clr.packages+clr.nativeaotlibs+clr.crossarchtools+host.native</DefaultCoreClrSubsets>

Unnecessary - same as the default on previous line

@jkotas

jkotas commented Aug 7, 2026

Copy link
Copy Markdown
Member

Is the thing you want to enable really linux-armel with glibc; or are you actually trying to enable native AOT for linux-bionic-arm?

@jkotas

jkotas commented Aug 7, 2026

Copy link
Copy Markdown
Member

Build breaks in Tizen CI leg

@am11

am11 commented Aug 7, 2026

Copy link
Copy Markdown
Member

Is the thing you want to enable really linux-armel with glibc; or are you actually trying to enable native AOT for linux-bionic-arm?

Android/bionic do not support armel.

Build breaks in Tizen CI leg

Since linux-armel isn't officially supported, it could be added to bootstrap community platform next to:

- freebsd_x64

@jkotas

jkotas commented Aug 7, 2026

Copy link
Copy Markdown
Member

Android/bionic do not support armel.

Android/bionic use armel ABI on arm by default. This detail is not visible in the RID - the RIDs are still linux-bionic-arm and android-arm. Armel ABI is enabled automatically when targeting Android/bionic arm.

@jkotas

jkotas commented Aug 7, 2026

Copy link
Copy Markdown
Member

Since linux-armel isn't officially supported, it could be added to bootstrap community platform next to

I assume that @ashaurtaev is actually interested in targeting Tizen that we have a CI leg for already.

@am11

am11 commented Aug 7, 2026

Copy link
Copy Markdown
Member

From https://developer.android.com/ndk/guides/abis.html?utm_source=chatgpt.com

For historical reasons, this ABI uses -mfloat-abi=softfp causing all float values to be passed in integer registers and all double values to be passed in integer register pairs when making function calls. Despite the name, this only affects the floating point calling convention: the compiler will still use hardware floating point instructions for arithmetic.

@am11

am11 commented Aug 7, 2026

Copy link
Copy Markdown
Member

we have a CI leg for already.

PR is enabling host subset, that's the one which causes issues when official nuget isn't present. Previously it was getting linux-arm LKG packages.

@@ -250,6 +252,7 @@ internal struct ArgumentRegisters
[StructLayout(LayoutKind.Sequential)]
internal struct FloatArgumentRegisters

@jkotas jkotas Aug 7, 2026

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.

These structures have to be in sync with CoreCLR w/ JIT. We do not have these fine-grained ifdefs in CoreCLR. https://github.com/dotnet/runtime/blob/main/src/coreclr/vm/arm/cgencpu.h

These are all slow paths. It is very minor inefficiency to save the extra floating-point registers with armel even though it is not strictly necessary. I think it would be simpler to avoid these ifdefs and accept this minor inefficiency. (Otherwise, you need a bunch more places that need these ifdefs to ensure everything is in sync.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch-arm32 area-NativeAOT-coreclr community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants