runtime: Add architectures supported by Mono but not supported by CoreCLR to System.Runtime.InteropServices.Architecture
Mono consumes this enum, but also supports architectures that aren’t 32/64-bit x86/ARM; in particular, PowerPC and WebAssembly. (SPARC and MIPS are supported, but being removed for 6.0 unless someone does something otherwise.)
To bikeshed on possible values:
-
PowerPC (32-bit PowerPC)
-
PowerPC64 (64-bit PowerPC)
-
S390X, related issue: https://github.com/dotnet/runtime/issues/34195
* WebAssembly (was added)
OSPlatform could also use other OSes, but string construction of new ones works in the meantime as CoreFX doesn’t want to add API surface until CoreCLR supports the OS.
Propsoal
namespace System.Runtime.InteropServices
{
public enum Architecture
{
X86,
X64,
Arm,
Arm64,
+ PowerPC,
+ PowerPC64,
+ S390X,
}
}
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 4
- Comments: 24 (20 by maintainers)
Commits related to this issue
- Detect Arm/Arm64 in RuntimeInformation * For ProcessArchitecture, use the DllMap arch of the runtime. * For OSArchitecture, make an educated guess combining ProcessArchitecture and Environment.... — committed to NattyNarwhal/mono by NattyNarwhal 6 years ago
- [System.Runtime.InteropServices] Detect Arm/Arm64 in RuntimeInformation (#10088) * For ProcessArchitecture, use the DllMap arch of the runtime. * For OSArchitecture, make an educated guess combini... — committed to mono/mono by NattyNarwhal 6 years ago
@neman Look this: https://github.com/dotnet/runtimelab/tree/feature/s390x
It looks good to me, but the only nitpick I have is LE and BE for ppc64 are different, unless API consumers also check
IsLittleEndian
. (That’s not even going into ELFv1 and ELFv2, which are not dependent on endianness, but a runtime should abstract that.)@jkotas w.r.t PPC64 and PPC64LE: They are different CPU architectures not different operating systems. Linux runs on both and requires different code to handle them.