On Mon, Apr 07, 2025 at 03:12:22PM +0800, Lulu Cheng wrote:
> 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.
> 
> Sigend-off-by: Xi Ruoyao <1...@xry111.site>
> Sigend-off-by: Jakub Jelinek <ja...@redhat.com>
> 
>       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.

> --- a/libgfortran/configure
> +++ b/libgfortran/configure
> @@ -16413,7 +16413,7 @@ else
>      We can't simply define LARGE_OFF_T to be 9223372036854775807,
>      since some C++ compilers masquerading as C compilers
>      incorrectly reject 9223372036854775807.  */
> -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
> +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 
> 31))
>    int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
>                      && LARGE_OFF_T % 2147483647 == 1)
>                     ? 1 : -1];
> @@ -16459,7 +16459,7 @@ else
>      We can't simply define LARGE_OFF_T to be 9223372036854775807,
>      since some C++ compilers masquerading as C compilers
>      incorrectly reject 9223372036854775807.  */
> -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
> +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 
> 31))
>    int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
>                      && LARGE_OFF_T % 2147483647 == 1)
>                     ? 1 : -1];
> @@ -16483,7 +16483,7 @@ rm -f core conftest.err conftest.$ac_objext 
> conftest.$ac_ext
>      We can't simply define LARGE_OFF_T to be 9223372036854775807,
>      since some C++ compilers masquerading as C compilers
>      incorrectly reject 9223372036854775807.  */
> -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
> +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 
> 31))
>    int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
>                      && LARGE_OFF_T % 2147483647 == 1)
>                     ? 1 : -1];
> @@ -16528,7 +16528,7 @@ else
>      We can't simply define LARGE_OFF_T to be 9223372036854775807,
>      since some C++ compilers masquerading as C compilers
>      incorrectly reject 9223372036854775807.  */
> -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
> +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 
> 31))
>    int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
>                      && LARGE_OFF_T % 2147483647 == 1)
>                     ? 1 : -1];
> @@ -16552,7 +16552,7 @@ rm -f core conftest.err conftest.$ac_objext 
> conftest.$ac_ext
>      We can't simply define LARGE_OFF_T to be 9223372036854775807,
>      since some C++ compilers masquerading as C compilers
>      incorrectly reject 9223372036854775807.  */
> -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
> +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 
> 31))
>    int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
>                      && LARGE_OFF_T % 2147483647 == 1)
>                     ? 1 : -1];

The above hunks clearly show that you're regenerating it with some patched
autoconf or something like that.  Please manually remove those hunks or use
vanilla upstream autoconf 2.69.  Otherwise the CI will complain.

Otherwise the patch LGTM (though I think Sigend-off-by headers belong after
the ChangeLog entry, not before it).

        Jakub

Reply via email to