Subject: oaklisp: Please add support for loong64

From: wuruilong <[email-masked]>
Date: Tue, 31 Dec 2024 08:05:36 +0000

Source: oaklisp
Version: 1.3.7-4
Severity: normal
Tags: sid patch
X-Debbugs-Cc: [email-masked]
User: [email-masked]
Usertags: loong64

Dear Maintainer,

Add 32-bit support for this architecture according to loongarch's official documentation. Link to details: https://github.com/loongson/la-toolchain-conventions

wuruilong

-- System Information:
Debian Release: trixie/sid
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'unstable')
Architecture: loong64 (loongarch64)

Kernel: Linux 5.10.0-60.96.0.126.oe2203.loongarch64 (SMP w/32 CPU threads)
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: unable to detect
Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 oaklisp (1.3.7-4) unstable; urgency=medium
 .
   * #;e
Author: Barak A. Pearlmutter <[email-masked]>

---
The information above should follow the Patch Tagging Guidelines, please
checkout https://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: (upstream|backport|vendor|other), (<patch-url>|commit:<commit-id>)
Bug: <upstream-bugtracker-url>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: (no|not-needed|<patch-forwarded-url>)
Applied-Upstream: <version>, (<commit-url>|commit:<commid-id>)
Reviewed-By: <name and email of someone who approved/reviewed the patch>
Last-Update: 2024-12-31

--- oaklisp-1.3.7.orig/configure.ac
+++ oaklisp-1.3.7/configure.ac
@@ -102,6 +102,7 @@ AS_CASE([${ac_cv_sizeof_void_p}],
        [amd64* | x86_64],     [flag32="-m32"],
        [arm64*],              [flag32="-mabi=ilp32"],
        [ia64*],               [flag32="-milp32"],
+       [loongarch*],          [flag32="-mabi=ilp32f"],
        [mips64*],             [flag32="-mabi=32"],
        [powerpc64* | ppc64*], [flag32="-m32"],
        [s390x*],              [flag32="-m31"],

---

From: xiao sheng wen(肖盛文) <[email-masked]>
Date: Mon, 6 Jan 2025 16:49:26 +0800

Hi,

  I just test your patch[1] for loong64, it failed:

The error log is:

checking build system type... loongarch64-unknown-linux-gnu
checking host system type... loongarch64-unknown-linux-gnu
configure: WARNING: non 32-bit pointer platform detected
configure: trying to enable 32-bit memory model compiler option for loongarch64
configure: compiler option for 32-bit memory model: -mabi=ilp32f
checking size of void *... 0
configure: error: bad flags, Indy
        tail -v -n \+0 config.log
==> config.log <==
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by Oaklisp configure 1.3.7, which was
generated by GNU Autoconf 2.72.  Invocation command line was

  $ ./configure --build=loongarch64-linux-gnu --prefix=/usr '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' --sysconfdir=/etc --localstatedir=/var --disable-option-checking --disable-silent-rules '--libdir=${prefix}/lib/loongarch64-linux-gnu' --runstatedir=/run --disable-maintainer-mode --disable-dependency-tracking

The full build log please see attachment.

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=1091769;filename=add-support-for-loong64.patch;msg=5

Regards,
-- 
肖盛文 xiao sheng wen -- Debian Developer(atzlinux)
Debian QA page: https://qa.debian.org/developer.php?login=atzlinux%40debian.org
Debian salsa: https://salsa.debian.org/atzlinux-guest
GnuPG Public Key: 0x00186602339240CB

---

From: "Barak A. Pearlmutter" <[email-masked]>
Date: Mon, 6 Jan 2025 09:30:14 +0000

Xiao Sheng,

Thanks for testing that -mabi=ilp32f patch.

----------------

wuruilong (and other loong folks),

Here is what the build log says:

> configure:5169: gcc -o conftest ... -mabi=ilp32f ... conftest.c ...
> gcc: error: unrecognized argument in option '-mabi=ilp32f'
> gcc: note: valid arguments to '-mabi=' are: lp64d lp64f lp64s

It would seem that Debian GCC for loongarch64 did not have 32-bit
support available on the build system.

Perhaps gcc-multilib needs to be installed? That is necessary for
other 64-bit architectures that have a 32-bit mode. I could add
loongarch64 to the architecture list for gcc-multilib in the build
dependencies. But I'm not seeing it as available for loongarch64 in
https://packages.debian.org/unstable/gcc-multilib