-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build error while cmake arguments ARM_SOFTFP=1 and CLR_ARM_FPU_TYPE=none #40270
Comments
You should still be compiling with FPU instructions enabled. Kernel does FPU emulation with armel builds. Code assumes FPU presence. |
In case dotnet is built without -cmakeargs -DARM_SOFTFP=1 -cmakeargs -DCLR_ARM_FPU_TYPE=none error "Illegal instruction" appears while executing it on device. However if I comment FPU instructions "Hello world" runs successfully but data abort appears in libraries when I run my application (this data abort do not exits when I execute on armhf processor). |
Yeah, I was referring to DCLR_ARM_FPU_TYPE section only. You should not use that option on armel builds. @janvorli thoughts? You can maybe get the callstack in disassembly? |
Next error appears if all FPU instructions in *.S files is commented: Empty application just with printing finishes successfully: |
You really shouldn't be commenting out the FPU instructions. Kernel is supposed to emulate the FPU instructions for you. Can you please check your kernel configuration? I don't think you can go anywhere by commenting out FPU code. |
In case FPU instructions are commented out Error "Illegal instruction" appears while running "dotnet TestApplication.dll" or "dotnet --info" on device. |
Apparently, you need a new option ARM EABI: ABI flags passed by gcc to binutils: -mabi=aapcs-linux -mfloat-abi=soft -meabi=4 |
I also learnt that kernel fpu emulation has been removed in favor of the code generation options reported on the previous message. |
Hello I changed the floating point abi to "soft" (instead of "softfp"), so that no hardware floating point registers are used There are 3 kind of uses of those registers that i noticed:
|
I'm not sure how feasible this is tho...the JIT also assumes we have an FPU and emits FPU registers... |
according to this page, you need softfp in order to do register emulation. https://embeddedartistry.com/blog/2017/10/11/demystifying-arm-floating-point-compiler-options/ Here are your float-abi options: soft: full software floating-point support |
I think the FPU emulation is not enabled in the kernel currently running on the target, and i'm not sure if i can feasibly enable it (it's kernel 3.4.11-rt19 and has proprietary blobs and modifications that limit the kernels you can use). Using softfp results in illegal instructions exceptions even in pure C/C++ sources (where no assembly is used explicitly) For example, i get the following crash (gdb output)
|
Interesting, it is almost impossible to run dotnet without fpu emulation. Looks like fpu emulation was removed in later versions of the kernel due to licensing issues |
This is about to hit dead end. You can try qemu with binary emulation mode. I don’t know how good if would run on your platform. Performance should be 15-20% slow |
Let's be positive 👍 , i think i have an alternative I previously tried to use the libraries from the I will try to replace the files in a published application to see if i can use I have this PR open: #38798 but i'll probably rebase it on master.
In general i find the Runtime ID a bit ambiguous because |
I'm getting this error (DOTNET_SYSTEM_GLOBALIZATION_INVARIANT required to avoid this: dotnet/macios#8906)
The library is there, but i'm not sure if it's a version issue (5.0.0.0 vs 5.0.0-dev). Edit: it's related to this
|
Mono is supposed to work in this environment if that works for you. |
It would have been cool to get dotnet core to work Otherwise, mono will be the only solution for constrained devices. |
I have looked at removing FPU access before. There are also other issues where this was discussed. Biggest challenge is JIT. It assumes floating point register presence. You can disable JIT and run with interpreter but interpreter was broken and unmaintained. Even if you get interpreter working, performance would be terrible. I agree that this would be a nice change. It looks like a project to me. Feel free to go to existing issues and probe interest if you are willing to take on this work. |
I'll think about it, as it's not a tiny task As for mono, i fixed it. The official released mono doesn't support QCalls. HEAD does, but i had problems building it (has dependencies on the coreclr repository even when built outside of it) So i used the version shipped in this repository (had to fix some symlinks first as there are issues with Finally
Note that this involves pieces of CoreCLR that are built FPU-less, so the ability to build the runtime with |
@akoeplinger Is it possible to build Mono-based runtime stack for older generation ARM processor from dotnet/runtime repo? |
@jkotas it should be possible, but might need some tweaks in mono.proj which hooks msbuild with mono's autotools-based build. |
Can someone please confirm whether this issue can be scheduled for the .NET 6 release - or is this something we need to continue tracking in our current .NET 5 backlog? |
This can be closed. The initial question that started this issue was answered. |
Device has processor Armel without any FPU features:
if dotnet is built with next command line:
next errors appear that are required to FPU instructions:
Such FPU instructions exist in several *.S files.
In case dotnet is built without cmakeargs:
compilation finishes without error but Error "Illegal instruction" appears while running on device.
The text was updated successfully, but these errors were encountered: