Skip to content

Commit 9da2a0a

Browse files
committed
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.
1 parent 202145c commit 9da2a0a

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/basic/architecture.h

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,23 @@ int uname_architecture(void);
197197
# error "Missing LIB_ARCH_TUPLE for SH64"
198198
#elif defined(__sh__)
199199
# define native_architecture() ARCHITECTURE_SH
200-
# define LIB_ARCH_TUPLE "sh4-linux-gnu"
200+
# if defined(__SH1__)
201+
# define LIB_ARCH_TUPLE "sh1-linux-gnu"
202+
# elif defined(__SH2__)
203+
# define LIB_ARCH_TUPLE "sh2-linux-gnu"
204+
# elif defined(__SH2A__)
205+
# define LIB_ARCH_TUPLE "sh2a-linux-gnu"
206+
# elif defined(__SH2E__)
207+
# define LIB_ARCH_TUPLE "sh2e-linux-gnu"
208+
# elif defined(__SH3__)
209+
# define LIB_ARCH_TUPLE "sh3-linux-gnu"
210+
# elif defined(__SH3E__)
211+
# define LIB_ARCH_TUPLE "sh3e-linux-gnu"
212+
# elif defined(__SH4__) && !defined(__SH4A__)
213+
# define LIB_ARCH_TUPLE "sh4-linux-gnu"
214+
# elif defined(__SH4A__)
215+
# define LIB_ARCH_TUPLE "sh4a-linux-gnu"
216+
# endif
201217
#elif defined(__m68k__)
202218
# define native_architecture() ARCHITECTURE_M68K
203219
# define LIB_ARCH_TUPLE "m68k-linux-gnu"

0 commit comments

Comments
 (0)