In GCC14, LoongArch added __float128 as an alias for _Float128.
In commit r15-8962, support for q/Q suffixes for 128-bit floating point
numbers. This will cause the compiler to automatically link libquadmath
when compiling Fortran programs. But on LoongArch `long double` is
IEEE quad, so there is no need to implement libquadmath.
This causes link failure.
PR target/119408
libgfortran/ChangeLog:
* acinclude.m4: When checking for __float128 support, determine
whether the current architecture is LoongArch. If so, return false.
* configure: Regenerate.
libquadmath/ChangeLog:
* configure.ac: When checking for __float128 support, determine
whether the current architecture is LoongArch. If so, return false.
* configure: Regenerate.
Sigend-off-by: Xi Ruoyao <xry111@xry111.site>
Sigend-off-by: Jakub Jelinek <jakub@redhat.com>
(cherry picked from commit
1534f0099c98ea14c08a401302b05edf2231f411)
AC_CACHE_CHECK([whether we have a usable _Float128 type],
libgfor_cv_have_float128, [
GCC_TRY_COMPILE_OR_LINK([
+ #ifdef __loongarch__
+ #error On LoongArch we should use long double instead; __float128 is only for porting existing code easier.
+ #endif
+
_Float128 foo (_Float128 x)
{
_Complex _Float128 z1, z2;
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+ #ifdef __loongarch__
+ #error On LoongArch we should use long double instead; __float128 is only for porting existing code easier.
+ #endif
+
_Float128 foo (_Float128 x)
{
_Complex _Float128 z1, z2;
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+ #ifdef __loongarch__
+ #error On LoongArch we should use long double instead; __float128 is only for porting existing code easier.
+ #endif
+
_Float128 foo (_Float128 x)
{
_Complex _Float128 z1, z2;
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+ #ifdef __loongarch__
+ #error On LoongArch we should use long double instead; __float128 is only for porting existing code easier.
+ #endif
+
#if (!defined(_ARCH_PPC)) || defined(__LONG_DOUBLE_IEEE128__)
typedef _Complex float __attribute__((mode(TC))) __complex128;
#else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+ #ifdef __loongarch__
+ #error On LoongArch we should use long double instead; __float128 is only for porting existing code easier.
+ #endif
+
#if (!defined(_ARCH_PPC)) || defined(__LONG_DOUBLE_IEEE128__)
typedef _Complex float __attribute__((mode(TC))) __complex128;
#else
AC_CACHE_CHECK([whether __float128 is supported], [libquad_cv_have_float128],
[GCC_TRY_COMPILE_OR_LINK([
+ #ifdef __loongarch__
+ #error On LoongArch we should use long double instead; __float128 is only for porting existing code easier.
+ #endif
+
#if (!defined(_ARCH_PPC)) || defined(__LONG_DOUBLE_IEEE128__)
typedef _Complex float __attribute__((mode(TC))) __complex128;
#else