rts/linker/ElfTypes.h does not compile on most of UNREG arches (and some registerised arches)
Builds fail as:
rts_dist_HC rts/dist/build/RtsStartup.o
rts/linker/ElfTypes.h:23:4: error:
error: #error "Unsupported arch!"
The code that fails in rts/linker/ElfTypes.h:
# define ELF_TARGET_AMD64 /* Used inside <elf.h> on Solaris 11 */
#if defined(powerpc64_HOST_ARCH) || defined(powerpc64le_HOST_ARCH) \
|| defined(ia64_HOST_ARCH) || defined(aarch64_HOST_ARCH) \
|| defined(x86_64_HOST_ARCH)
# define ELF_64BIT
#elif defined(sparc_HOST_ARCH) || defined(i386_HOST_ARCH) \
|| defined(arm_HOST_ARCH)
# define ELF_32BIT
#else
# error "Unsupported arch!"
#endif
Note it's a whitelist of architectures. It fails at least on powerpc (arm_HOST_ARCH), hppa (hppa_HOST_ARCH), m68k (m68k_HOST_ARCH). mips, mips64, alpha, s390x, sparc64.
It does not look like keeping a whitelist is scalable here.
How about using
#if defined(__LP64__) || defined (_LP64)
as a proxy for ELF64 and maintain a list of arches that are exception instead?