define APK_DEFAULT_ARCH for loongarch targets

Macros used have been taken from Loongson's work-in-progress GCC 12
port.
cute-signatures
Ariadne Conill 2021-07-06 13:29:02 -06:00
parent 22a81e8fb5
commit 34162d01fd
1 changed files with 6 additions and 0 deletions

View File

@ -125,6 +125,12 @@ static inline int IS_ERR_OR_NULL(const void *ptr) { return IS_ERR(ptr) || !ptr;
#define APK_DEFAULT_ARCH "riscv32"
#elif defined(__riscv) && __riscv_xlen == 64
#define APK_DEFAULT_ARCH "riscv64"
#elif defined(__loongarch__) && defined(__loongarch32) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#define APK_DEFAULT_ARCH "loongarch32"
#elif defined(__loongarch__) && defined(__loongarchx32) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#define APK_DEFAULT_ARCH "loongarchx32"
#elif defined(__loongarch__) && defined(__loongarch64) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#define APK_DEFAULT_ARCH "loongarch64"
#else
#error APK_DEFAULT_ARCH not detected for this architecture
#endif