[android] Enable ARM_SOFTFP for Android ARM32 to fix SIGSEGV in DateTime.Now#127527
Draft
[android] Enable ARM_SOFTFP for Android ARM32 to fix SIGSEGV in DateTime.Now#127527
Conversation
…eTime.Now Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/9c818677-7e26-4388-8525-e0525d87e1de Co-authored-by: mangod9 <61718172+mangod9@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix SIGSEGV error during native code execution
[android] Enable ARM_SOFTFP for Android ARM32 to fix SIGSEGV in DateTime.Now
Apr 28, 2026
Member
|
Let's see how this works out... I don't think we ever tested the softfp support in our own CI, and this support was added many years ago by Samsung, so it may be quite bitrotted at this point. |
Member
|
It appears the DateTime issue is resolved but there are other failures with that leg. Dont think android-arm on coreclr is ready to be in CI yet. The change should be reverted till the leg is validated for longer @simonrozsival ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Android armeabi-v7a mandates the softfp calling convention (
-mfloat-abi=softfp): float args pass through integer registers at call boundaries even though VFP is used for arithmetic. After #127225 enabled RyuJIT for android-arm, the JIT was never told to use softfp, so it treated the ABI as hardfp.Math.TruncatecallsModF(d, &d)— but with no stack slot allocated ford(it lives ind0),&dis null → SIGSEGV before any test runs.Description
eng/native/configureplatform.cmake: SetARM_SOFTFP=1whenCLR_CMAKE_TARGET_ARCH=armandCLR_CMAKE_TARGET_OS=android. This feeds into the existingconfigurecompiler.cmakepath that globally emits-DARM_SOFTFPand-mfloat-abi=softfp, aligning the JIT's codegen ABI assumptions with the NDK default.src/coreclr/clrdefinitions.cmake: Extend theARM_SOFTFPtarget_compile_definitionsinset_target_definitions_to_custom_os_and_archto also coverarch=armwhenCLR_CMAKE_TARGET_ANDROIDis set. This ensures JIT/gcinfo cross-compilation targets get the correct define.Customer Impact
Hard crash (SIGSEGV) on startup of any .NET app running on Android ARM32 with the CoreCLR runtime. Affects every test leg on android-arm, blocking all PRs that trigger those legs.
Regression
Yes — introduced by #127225 (merged 2026-04-28) which first enabled the CoreCLR JIT on android-arm. No prior release shipped android-arm CoreCLR support, so no stable release is affected.
Testing
The fix is build-system / compile-flag only. Correctness is validated by the android-arm CI leg added in #127225 — the SIGSEGV crash on
DateTime.get_Now()during test runner init will no longer occur once the JIT correctly spills float parameters to stack slots.Risk
Low. The change mirrors exactly what is already done for
armel(soft-float embedded Linux). It only activates whenCLR_CMAKE_TARGET_OS=android+CLR_CMAKE_TARGET_ARCH=arm, leaving all other targets unaffected.Package authoring no longer needed in .NET 9
IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older versions.