Your message dated Fri, 07 Mar 2025 15:38:18 +0000
with message-id <[email protected]>
and subject line Bug#1074432: fixed in rust-generator 0.7.1-1.1
has caused the Debian Bug report #1074432,
regarding rust-generator: FTBFS: add support for loongarch64
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
1074432: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1074432
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Source: rust-generator
Version: 0.7.1-1
Severity: normal
Tags: patch
User: [email protected]
Usertags: loong64

Dear maintainers,

Compiling the rust-generator failed for loong64 in the Debian Package Auto-Building environment.
Build failed 12 times.
The full log can be found at https://buildd.debian.org/status/logs.php?pkg=rust-generator&ver=0.7.1-1&arch=loong64.

The rust-generator source package lacks LoongArch architecture support.
The support for loongarch64 has been submitted by heiher to upstream.
The detail message is as follows,
Description: Add support for LoongArch64 targets
Sigened-Off-By: heiher
Pull-Request: https://github.com/Xudong-Huang/generator-rs/pull/48

Please update upstream for rust-generator or consider the patch I have attached. And the rust-generator source package was compiled successfully on my local loong64 rootfs environment.
```
......
dpkg-deb: building package 'librust-generator-dev' in '../librust-generator-dev_0.7.1-1_loong64.deb'.
 dpkg-genbuildinfo -O../rust-generator_0.7.1-1_loong64.buildinfo
 dpkg-genchanges -O../rust-generator_0.7.1-1_loong64.changes
```
Would it be possible to include the support for LoongArch in the next upload?

thanks,
Dandan Zhang

Description: Add support for LoongArch64 targets
Sigened-Off-By: heiher
Pull-Request: https://github.com/Xudong-Huang/generator-rs/pull/48
Last-Update: 2024-06-28

--- rust-generator-0.7.1.orig/README.md
+++ rust-generator-0.7.1/README.md
@@ -75,10 +75,11 @@ fn main() {
     - x86_64 MacOs
     - x86_64 Windows
     - aarch64 Linux
+    - loongarch64 Linux
 
 ## License
 
 This project is licensed under either of the following, at your option:
 
  * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
- * MIT License ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
\ No newline at end of file
+ * MIT License ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
--- rust-generator-0.7.1.orig/build.rs
+++ rust-generator-0.7.1/build.rs
@@ -22,6 +22,7 @@ fn main() {
         // "mips" | "mipsel" => "mips32",
         // "powerpc" => "ppc32",
         // "powerpc64" => "ppc64",
+        "loongarch64" => "loongarch64",
         "x86_64" => "x86_64",
         _ => {
             panic!("Unsupported architecture: {}", target);
--- /dev/null
+++ rust-generator-0.7.1/src/detail/asm/asm_loongarch64_sysv_elf_gas.S
@@ -0,0 +1,74 @@
+.text
+.globl prefetch
+.type prefetch,@function
+.align 16
+prefetch:
+    preld 0, $a0, 0
+    ret
+.size prefetch,.-prefetch
+
+.text
+.globl bootstrap_green_task
+.type bootstrap_green_task,@function
+.align 16
+bootstrap_green_task:
+    move $a0, $s0   // arg0
+    move $a1, $s1   // arg1
+    move $ra, $zero // clear LR
+    jirl $zero, $s2, 0
+.size bootstrap_green_task,.-bootstrap_green_task
+
+.text
+.globl swap_registers
+.type swap_registers,@function
+.align 16
+swap_registers:
+    st.d $ra, $a0, 0
+    st.d $sp, $a0, 8
+    st.d $fp, $a0, 16
+    st.d $s0, $a0, 24
+    st.d $s1, $a0, 32
+    st.d $s2, $a0, 40
+    st.d $s3, $a0, 48
+    st.d $s4, $a0, 56
+    st.d $s5, $a0, 64
+    st.d $s6, $a0, 72
+    st.d $s7, $a0, 80
+    st.d $s8, $a0, 88
+
+    fst.d $fs0, $a0, 96
+    fst.d $fs1, $a0, 104
+    fst.d $fs2, $a0, 112
+    fst.d $fs3, $a0, 120
+    fst.d $fs4, $a0, 128
+    fst.d $fs5, $a0, 136
+    fst.d $fs6, $a0, 144
+    fst.d $fs7, $a0, 152
+
+    ld.d $ra, $a1, 0
+    ld.d $sp, $a1, 8
+    ld.d $fp, $a1, 16
+    ld.d $s0, $a1, 24
+    ld.d $s1, $a1, 32
+    ld.d $s2, $a1, 40
+    ld.d $s3, $a1, 48
+    ld.d $s4, $a1, 56
+    ld.d $s5, $a1, 64
+    ld.d $s6, $a1, 72
+    ld.d $s7, $a1, 80
+    ld.d $s8, $a1, 88
+
+    fld.d $fs0, $a1, 96
+    fld.d $fs1, $a1, 104
+    fld.d $fs2, $a1, 112
+    fld.d $fs3, $a1, 120
+    fld.d $fs4, $a1, 128
+    fld.d $fs5, $a1, 136
+    fld.d $fs6, $a1, 144
+    fld.d $fs7, $a1, 152
+
+    ret
+.size swap_registers,.-swap_registers
+
+/* Mark that we don't need executable stack. */
+.section .note.GNU-stack,"",%progbits
--- /dev/null
+++ rust-generator-0.7.1/src/detail/loongarch64_unix.rs
@@ -0,0 +1,85 @@
+use crate::detail::align_down;
+use crate::reg_context::InitFn;
+use crate::stack::Stack;
+
+#[link(name = "asm", kind = "static")]
+extern "C" {
+    pub fn bootstrap_green_task();
+    pub fn prefetch(data: *const usize);
+    pub fn swap_registers(out_regs: *mut Registers, in_regs: *const Registers);
+}
+
+#[repr(C, align(16))]
+#[derive(Debug)]
+pub struct Registers {
+    // We save the 12 callee-saved registers:
+    //  0: ra
+    //  1: sp
+    //  2: fp
+    //  3: s0
+    //  4: s1
+    //  5: s2
+    //  6: s3
+    //  7: s4
+    //  8: s5
+    //  9: s6
+    // 10: s7
+    // 11: s8
+    // and the 8 callee-saved floating point registers:
+    // 12: fs0
+    // 13: fs1
+    // 14: fs2
+    // 15: fs3
+    // 16: fs4
+    // 17: fs5
+    // 18: fs6
+    // 19: fs7
+    gpr: [usize; 20],
+}
+
+impl Registers {
+    pub fn new() -> Registers {
+        Registers { gpr: [0; 20] }
+    }
+
+    #[inline]
+    pub fn prefetch(&self) {
+        let ptr = self.gpr[1] as *const usize;
+        unsafe {
+            prefetch(ptr); // SP
+            prefetch(ptr.add(8)); // SP + 8
+        }
+    }
+}
+
+pub fn initialize_call_frame(
+    regs: &mut Registers,
+    fptr: InitFn,
+    arg: usize,
+    arg2: *mut usize,
+    stack: &Stack,
+) {
+    const RA: usize = 0;
+    const SP: usize = 1;
+    const FP: usize = 2;
+    const S0: usize = 3;
+    const S1: usize = 4;
+    const S2: usize = 5;
+
+    let sp = align_down(stack.end());
+
+    // These registers are frobbed by bootstrap_green_task into the right
+    // location so we can invoke the "real init function", `fptr`.
+    regs.gpr[S0] = arg;
+    regs.gpr[S1] = arg2 as usize;
+    regs.gpr[S2] = fptr as usize;
+
+    // LoongArch64 current stack frame pointer
+    regs.gpr[FP] = sp as usize;
+
+    regs.gpr[RA] = bootstrap_green_task as usize;
+
+    // setup the init stack
+    // this is prepared for the swap context
+    regs.gpr[SP] = sp as usize;
+}
--- rust-generator-0.7.1.orig/src/detail/mod.rs
+++ rust-generator-0.7.1/src/detail/mod.rs
@@ -33,6 +33,10 @@ pub mod asm;
 #[path = "aarch64_unix.rs"]
 pub mod asm;
 
+#[cfg(all(unix, target_arch = "loongarch64"))]
+#[path = "loongarch64_unix.rs"]
+pub mod asm;
+
 pub use self::asm::{initialize_call_frame, prefetch, swap_registers, Registers};
 
 #[inline]
--- rust-generator-0.7.1.orig/src/stack/mod.rs
+++ rust-generator-0.7.1/src/stack/mod.rs
@@ -17,6 +17,10 @@ pub mod sys;
 #[path = "unix.rs"]
 pub mod sys;
 
+#[cfg(all(unix, target_arch = "loongarch64"))]
+#[path = "unix.rs"]
+pub mod sys;
+
 #[cfg(all(windows, target_arch = "x86_64"))]
 #[path = "windows.rs"]
 pub mod sys;

--- End Message ---
--- Begin Message ---
Source: rust-generator
Source-Version: 0.7.1-1.1
Done: Gianfranco Costamagna <[email protected]>

We believe that the bug you reported is fixed in the latest version of
rust-generator, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Gianfranco Costamagna <[email protected]> (supplier of updated 
rust-generator package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Fri, 07 Mar 2025 15:09:21 +0100
Source: rust-generator
Built-For-Profiles: noudeb
Architecture: source
Version: 0.7.1-1.1
Distribution: unstable
Urgency: medium
Maintainer: Debian Rust Maintainers 
<[email protected]>
Changed-By: Gianfranco Costamagna <[email protected]>
Closes: 1074432
Changes:
 rust-generator (0.7.1-1.1) unstable; urgency=medium
 .
   * Non-maintainer upload.
 .
   [ zhangdandan <[email protected]> ]
   * Add support for loongarch64 (Closes: #1074432)
Checksums-Sha1:
 6244af3c4eb26416b5d05220a887dcfe6080f05b 2370 rust-generator_0.7.1-1.1.dsc
 f3db0609e552bd1cc563a9e9ff7abdfe251a9e1a 5108 
rust-generator_0.7.1-1.1.debian.tar.xz
 0319e8d70afacc668d75d0744c28dbfd5f896714 9001 
rust-generator_0.7.1-1.1_source.buildinfo
Checksums-Sha256:
 dfeda215dac7d7d234342862d45b3760969d832164209367b0296afc760ccbf5 2370 
rust-generator_0.7.1-1.1.dsc
 39d49d14d4aff228742da9609ff0cf0d418f3a9e199b9105f51a49eb6648740d 5108 
rust-generator_0.7.1-1.1.debian.tar.xz
 250d493c76bf0aedb341c2e863e3e69c6f9be423668407afb0bd1b1e3538d3cf 9001 
rust-generator_0.7.1-1.1_source.buildinfo
Files:
 1c850e1660401975d5ba0dce9f51f462 2370 rust optional 
rust-generator_0.7.1-1.1.dsc
 04262fc6764d4df54e8f7f74e6736195 5108 rust optional 
rust-generator_0.7.1-1.1.debian.tar.xz
 d18ce4467b3444e30cc80db452955c3b 9001 rust optional 
rust-generator_0.7.1-1.1_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEkpeKbhleSSGCX3/w808JdE6fXdkFAmfK/jEACgkQ808JdE6f
XdmMXQ//alvzZb1h0P/GiZzF+ftYMLDuvrV49imXKBecTgx0jIVodymdTTJxFgXH
7yOyH1IRL4JDcePtHWwLGpT90kXwi+wKgcCX8ixq973fjG+Tkdp1zRSNwqNQgX4p
c1KFzl+Q7DGimAYiKdf1WbJSWFY9wFM+vrIW2B/AlCb946ZQWBoZ9MM7O/zzjBcR
QRE5gP/0ft/hQk0wgjlth8zW+9FT0JdErRWhfRu1YIRlw0USIIBoGzcp2/UluTUu
cCszB8UdHu4+aES21aDrtx43h543joPe3k0tcnxVBDv9C8wFmCOCGYSPkss7af/V
amYvW+2rvQeIID5a2s0u3Ox97zF/8oQxc/gWO/PgC+oDS8/V/Jg/ur9NpHWqeIIb
EnFhRbijWWyfaN+SdAclICqdnTz/tLGrxaDa90646bpTwIEKJ3yREhn1xYOgOsZX
qZ/4B5BYpPj0Cd0s9ROosaQyPl64R0lnejE70kHioocgvrL08tPVkW/N7XTwx6qx
UOqwZRZPGBAcSV2yNaqRd4fJVMmrYqQZXxvmkZlbQG+jvaM/06vQnGUB0TEq/X5T
5r9Xm2vyFjjykmwhN5xLE0ECrse0pctvJdbN06Uul8PfswxXtYfA9hs5/SEJtBTe
anNhIQZN6oe80rImnvZab6HDF09AAUtdI2IS0SR7XkSBEab6tcY=
=96jz
-----END PGP SIGNATURE-----

Attachment: pgpTWe6Vvn_7S.pgp
Description: PGP signature


--- End Message ---

Reply via email to