On the LoongArch64 CPU, GCC and clang predefine only __loongarch__, __loongarch64. GCC predefines also __loongarch_lp64. But it's too hard to remember that __loongarch64__ is not defined. So, let host-cpu-c-abi define it.
Btw, this is independent of the floating-point variants of the ABI: -mabi=lp64d (the default) defines #define __loongarch_hard_float 1 #define __loongarch_double_float 1 -mabi=lp64f defines #define __loongarch_hard_float 1 #define __loongarch_single_float 1 -mabi=lp64s defines #define __loongarch_soft_float 1 2022-01-09 Bruno Haible <br...@clisp.org> host-cpu-c-abi: Add support for LoongArch64 CPU. * m4/host-cpu-c-abi.m4 (gl_HOST_CPU_C_ABI): Define __loongarch64__. (GCC and clang predefine only __loongarch__, __loongarch64.) diff --git a/m4/host-cpu-c-abi.m4 b/m4/host-cpu-c-abi.m4 index 6d1e4578c7..b9223241b4 100644 --- a/m4/host-cpu-c-abi.m4 +++ b/m4/host-cpu-c-abi.m4 @@ -1,4 +1,4 @@ -# host-cpu-c-abi.m4 serial 14 +# host-cpu-c-abi.m4 serial 15 dnl Copyright (C) 2002-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -382,6 +382,9 @@ EOF #ifndef __ia64__ #undef __ia64__ #endif +#ifndef __loongarch64__ +#undef __loongarch64__ +#endif #ifndef __m68k__ #undef __m68k__ #endif