basic/architecture: Add sub-architecture types for SuperH

On SuperH, there are multiple sub-architectures defined with
different values for LIB_ARCH_TUPLE. The different sub-
architectures can be detected by checking whether __SH1__,
__SH2__, __SH3__, __SH4__, and so on are defined.
This commit is contained in:
John Paul Adrian Glaubitz 2017-03-02 01:51:53 +01:00
parent 202145c07a
commit 9da2a0ac4e

View file

@ -197,7 +197,23 @@ int uname_architecture(void);
# error "Missing LIB_ARCH_TUPLE for SH64"
#elif defined(__sh__)
# define native_architecture() ARCHITECTURE_SH
# define LIB_ARCH_TUPLE "sh4-linux-gnu"
# if defined(__SH1__)
# define LIB_ARCH_TUPLE "sh1-linux-gnu"
# elif defined(__SH2__)
# define LIB_ARCH_TUPLE "sh2-linux-gnu"
# elif defined(__SH2A__)
# define LIB_ARCH_TUPLE "sh2a-linux-gnu"
# elif defined(__SH2E__)
# define LIB_ARCH_TUPLE "sh2e-linux-gnu"
# elif defined(__SH3__)
# define LIB_ARCH_TUPLE "sh3-linux-gnu"
# elif defined(__SH3E__)
# define LIB_ARCH_TUPLE "sh3e-linux-gnu"
# elif defined(__SH4__) && !defined(__SH4A__)
# define LIB_ARCH_TUPLE "sh4-linux-gnu"
# elif defined(__SH4A__)
# define LIB_ARCH_TUPLE "sh4a-linux-gnu"
# endif
#elif defined(__m68k__)
# define native_architecture() ARCHITECTURE_M68K
# define LIB_ARCH_TUPLE "m68k-linux-gnu"