On Fri, 21 Feb 2025 11:41:26 +0100 Bruno Haible wrote:
> Simon Josefsson wrote:
> > checking build system type... loongarch64-unknown-linux-gnu
> > checking host system type... loongarch64-unknown-linux-gnu
> > ...
> > checking 32-bit host C ABI... no
> >
> > Isn't that the right result?
>
> Right. That is as expected on loongarch64 machines.
>
> > > --- guile-fibers-1.3.1.orig/configure
> > > +++ guile-fibers-1.3.1/configure
> > > @@ -7134,6 +7134,26 @@ ia64-*-hpux*)
> > > fi
> > > rm -rf conftest*
> > > ;;
> > > + loong64 | loongarch64 )
>
> This line is not right: As can be seen from config.guess and config.sub,
> 'loong64' is not a valid CPU.
>
> > > + # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
>
> This line is partially correct. According to [1] table 6, the names
> of the 6 ABIs are:
> ilp32s, ilp32f, ilp32d, lp64s, lp64f, lp64d
>
> > > + # Size of 'long' and 'void *':
> > > + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> > > +/* end confdefs.h. */
> > > +#if defined __LP64__
> > > + int ok;
> > > + #else
> > > + error fail
> > > + #endif
>
> This test is nonsense: According to [1] table 9, cpu = loongarch64
implies
> one of the lp64* ABIs. Therefore there is no need to test __LP64__.
> As a user, you have to pass --host=loongarch32-linux-gnu when you are
using
> an ilp32* ABI compiler. It is *WRONG* to pass
--host=loongarch64-linux-gnu
> when using an ilp32* ABI compiler.
>
> > > mips64*-*linux*)
> > > # Find out what ABI is being produced by ac_compile, and set linker
> > > @@ -13283,7 +13303,7 @@ else $as_nop
> > > case "$gl_cv_host_cpu_c_abi" in
> > > i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32
| mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc)
> > > gl_cv_host_cpu_c_abi_32bit=yes ;;
> > > - x86_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 |
powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 )
> > > + x86_64 | alpha | arm64 | hppa64 | ia64 | loongarch64 | mips64 |
powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 )
> > > gl_cv_host_cpu_c_abi_32bit=no ;;
> > > *)
> > > gl_cv_host_cpu_c_abi_32bit=unknown ;;
>
> This change is correct, but is missing a corresponding change for
loongarch32.
>
> I'm applying the patch below instead.
>
> [1] LoongArch toolchain conventions,
>
https://loongson.github.io/LoongArch-Documentation/LoongArch-toolchain-conventions-EN.pdf
I think you're right.
wuruilong