Description
Describe the bug
We are currently working on porting .NET to the IBM Z (s390x) architecture, targeting the .NET 6 release. Support for the runtime has already been merged upstream, as well as necessary bugfixes in various SDK components (roslyn, fsharp, msbuild, nuget). However, aspnetcore does not yet work out of the box, due mostly due to endian issues.
IBM Z is a big-endian platform, and the current aspnetcore code base does not support big-endian platforms. In the Kestrel component, there is an explicit assertion that will prevent the server from even starting; in other places, some code is simply incorrect for big-endian machines.
Further technical details
I've re-built a version of the .NET 6 Preview7 SDK & runtime targeting the linux-s390x platform, and used this to build & test the Preview7 aspnetcore code base (running natively on s390x).
The following endian-specific problems showed up:
- Endian assumptions in optimized HTTP header string processing in Kestrel (including in generated code)
- Endian assumptions in optimized IP/socket address processing in Kestrel
- Accessing binary data in little-endian format in the RenderBatch code in Ignitor
- Endian assumptions in optimized Guid processing in KeyRingBasedDataProtector.cs
I've created fixes for all problems listed above, and am planning to submit PRs shortly, all linked to this issue.