Source: rust-jemalloc-sys
Version: 0.3.2-2
Severity: wishlist
Tags: ftbfs patch
User: debian-loonga...@lists.debian.org
Usertags: loong64

Dear maintainers,

Compiling the rust-jemalloc-sys failed for loong64 in the Debian Package Auto-Building environment.
The error log is as follows,
```
[jemalloc-sys 0.3.2] In file included from include/jemalloc/internal/size_classes.h:6, [jemalloc-sys 0.3.2]                  from ../jemalloc/include/jemalloc/internal/tcache_types.h:4, [jemalloc-sys 0.3.2]                  from ../jemalloc/include/jemalloc/internal/jemalloc_internal_includes.h:46,
[jemalloc-sys 0.3.2]                  from ../jemalloc/src/bin.c:2:
[jemalloc-sys 0.3.2] ../jemalloc/include/jemalloc/internal/jemalloc_internal_types.h:114:6: error: #error "Unknown minimum alignment for architecture; specify via " [jemalloc-sys 0.3.2]   114 | #    error "Unknown minimum alignment for architecture; specify via "
[jemalloc-sys 0.3.2]       |      ^~~~~
```
The Full log can be found at https://buildd.debian.org/status/logs.php?pkg=rust-jemalloc-sys&ver=0.3.2-2&arch=loong64.

I have added loongarch support in rust-jemalloc-sys package. Please consider the patch I attached. In addition, the LoongArch architecture has been supported by jemalloc upstream, pelase see https://github.com/jemalloc/jemalloc. Would it be possible to include the support for LoongArch in the next upload?
Your opinions are welcome.

Thanks,
Dandan Zhang
Description: Add loongarch support
Last-Update: 2024-04-09

--- rust-jemalloc-sys-0.3.2.orig/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h
+++ rust-jemalloc-sys-0.3.2/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h
@@ -110,6 +110,9 @@ typedef int malloc_cpuid_t;
 #  ifdef __le32__
 #    define LG_QUANTUM		4
 #  endif
+#  ifdef __loongarch__
+#    define LG_QUANTUM		4
+#  endif
 #  ifndef LG_QUANTUM
 #    error "Unknown minimum alignment for architecture; specify via "
 	 "--with-lg-quantum"
--- rust-jemalloc-sys-0.3.2.orig/rep/include/jemalloc/internal/quantum.h
+++ rust-jemalloc-sys-0.3.2/rep/include/jemalloc/internal/quantum.h
@@ -61,6 +61,9 @@
 #  ifdef __le32__
 #    define LG_QUANTUM		4
 #  endif
+#  ifdef __loongarch__
+#    define LG_QUANTUM		4
+#  endif
 #  ifndef LG_QUANTUM
 #    error "Unknown minimum alignment for architecture; specify via "
 	 "--with-lg-quantum"

Reply via email to