Source: rust-libseccomp-sys
Version: 0.2.1-1
Severity: wishlist
Tags: patch FTBFS
User: debian-loonga...@lists.debian.org
Usertags: loong64

Dear maintainers,

When I added loongarch64 support for rust-libseccomp and built locally, I found rust-libseccomp-sys source package lacks LoongArch architecture support.
The error log can be found as follows,
```
error[E0425]: cannot find value `SCMP_ARCH_LOONGARCH64` in this scope
   --> src/arch.rs:67:34
    |
67  |             Self::Loongarch64 => SCMP_ARCH_LOONGARCH64,
    |                                  ^^^^^^^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `SCMP_ARCH_AARCH64`
    |
   ::: /usr/share/cargo/registry/libseccomp-sys-0.2.1/src/lib.rs:211:1
    |
211 | pub const SCMP_ARCH_AARCH64: u32 = 0xc00000b7;
    | -------------------------------- similarly named constant `SCMP_ARCH_AARCH64` defined here
```
We can check that /usr/share/cargo/registry/libseccomp-sys-0.2.1/src/lib.rs is provided by librust-libseccomp-sys-dev.
# dpkg -S /usr/share/cargo/registry/libseccomp-sys-0.2.1/src/lib.rs
librust-libseccomp-sys-dev:loong64: /usr/share/cargo/registry/libseccomp-sys-0.2.1/src/lib.rs

I have added loongarch64 support in rust-libseccomp-sys source package. And built successfully on my local ENV.
Please consider the patch I attached.
If you have any questions, you can contact me at any time.

thanks,
Dandan Zhang

Description: Add loongarch64 support 
 .
 rust-libseccomp-sys (0.2.1-1+loong64) unreleased; urgency=medium
 .
   * src/lib.rs: Add loongarch64 support.
Author: Dandan Zhang <zhangdan...@loongson.cn>

---
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-11-27

--- rust-libseccomp-sys-0.2.1.orig/src/lib.rs
+++ rust-libseccomp-sys-0.2.1/src/lib.rs
@@ -209,6 +209,7 @@ pub const SCMP_ARCH_X86_64: u32 = 0xc000
 pub const SCMP_ARCH_X32: u32 = 0x4000003e;
 pub const SCMP_ARCH_ARM: u32 = 0x40000028;
 pub const SCMP_ARCH_AARCH64: u32 = 0xc00000b7;
+pub const SCMP_ARCH_LOONGARCH64: u32 = 0xc0000102;
 pub const SCMP_ARCH_MIPS: u32 = 0x8;
 pub const SCMP_ARCH_MIPS64: u32 = 0x80000008;
 pub const SCMP_ARCH_MIPS64N32: u32 = 0xa0000008;

Reply via email to