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:

* 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

Most upvoted comments

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.