Bug#1068233: snappy-java: please add support for loong64

wuruilong wuruilong at loongson.cn
Tue Apr 2 12:44:10 BST 2024


Source: snappy-java
Severity: wishlist
X-Debbugs-Cc: wuruilong at loongson.cn

Dear Maintainer,

According to the upstream commit, the loong64 architecture needs to update the attachment code to compile correctly.
The attached binary file libsnappyjava.so needs to be placed in the following directory
src/main/resources/org/xerial/snappy/native/Linux/loongarch64/libsnappyjava.so

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
-------------- next part --------------
Description: add support for loong64
 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.
 .
 snappy-java (1.1.10.5-1) unstable; urgency=medium
 .
   * Team upload.
   * Update debian/watch to detect new tagging format
   * New upstream version 1.1.10.5
     - Mitigates CVE-2023-43642 (Closes: #1053474)
Author: tony mancill <tmancill at debian.org>
Bug-Debian: https://bugs.debian.org/1053474

---
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: https://github.com/xerial/snappy-java/pull/526
Signed-Off-By: zaixiang
Last-Update: 2024-04-02
Reviewed-By: <name and email of someone who approved/reviewed the patch>

--- snappy-java-1.1.10.5.orig/Makefile.common
+++ snappy-java-1.1.10.5/Makefile.common
@@ -51,7 +51,7 @@ endif
 # os=Default is meant to be generic unix/linux
 
 # To support new CPU architecture, add a new target name here
-known_os_archs := Linux-x86 Linux-x86_64 Linux-arm Linux-armv6 Linux-armv7 Linux-android-arm Linux-android-aarch64 Linux-aarch64 Linux-ppc Linux-ppc64 Linux-ppc64le Linux-s390 Linux-s390x Mac-x86 Mac-x86_64 Mac-aarch64 FreeBSD-x86_64 Windows-x86 Windows-x86_64 Windows-aarch64 SunOS-x86 SunOS-sparc SunOS-x86_64 AIX-ppc AIX-ppc64 Linux-riscv Linux-riscv64
+known_os_archs := Linux-x86 Linux-x86_64 Linux-arm Linux-armv6 Linux-armv7 Linux-android-arm Linux-android-aarch64 Linux-aarch64 Linux-ppc Linux-ppc64 Linux-ppc64le Linux-s390 Linux-s390x Mac-x86 Mac-x86_64 Mac-aarch64 FreeBSD-x86_64 Windows-x86 Windows-x86_64 Windows-aarch64 SunOS-x86 SunOS-sparc SunOS-x86_64 AIX-ppc AIX-ppc64 Linux-riscv Linux-riscv64 Linux-loongarch Linux-loongarch64
 os_arch := $(OS_NAME)-$(OS_ARCH)
 IBM_JDK_7 := $(findstring IBM, $(shell $(JAVA) -version 2>&1 | grep IBM | grep "JRE 1.7"))
 
@@ -310,6 +310,19 @@ Windows-aarch64_CXXFLAGS  := -Ilib/inc_m
 Windows-aarch64_LINKFLAGS := -Wl,--kill-at -shared -static
 Windows-aarch64_LIBNAME   := snappyjava.dll
 
+Linux-loongarch_CXX       := $(CROSS_PREFIX)g++
+Linux-loongarch_STRIP     := $(CROSS_PREFIX)strip
+Linux-loongarch_CXXFLAGS  := -Ilib/inc_linux -I$(JAVA_HOME)/include -O2 -fPIC -fvisibility=hidden -std=c++11
+Linux-loongarch_LINKFLAGS := -shared
+Linux-loongarch_LIBNAME   := libsnappyjava.so
+Linux-loongarch_SNAPPY_FLAGS:=
+
+Linux-loongarch64_CXX       := $(CROSS_PREFIX)g++
+Linux-loongarch64_STRIP     := $(CROSS_PREFIX)strip
+Linux-loongarch64_CXXFLAGS  := -Ilib/inc_linux -I$(JAVA_HOME)/include -O2 -fPIC -fvisibility=hidden -std=c++11
+Linux-loongarch64_LINKFLAGS := -shared
+Linux-loongarch64_LIBNAME   := libsnappyjava.so
+Linux-loongarch64_SNAPPY_FLAGS:=
 
 CXX        := $($(os_arch)_CXX)
 STRIP     := $($(os_arch)_STRIP)
--- snappy-java-1.1.10.5.orig/build.sbt
+++ snappy-java-1.1.10.5/build.sbt
@@ -110,6 +110,7 @@ OsgiKeys.additionalHeaders := Map(
     "org/xerial/snappy/native/Linux/armv7/libsnappyjava.so;osname=linux;processor=arm_le",
     "org/xerial/snappy/native/Linux/ppc64/libsnappyjava.so;osname=linux;processor=ppc64le",
     "org/xerial/snappy/native/Linux/s390x/libsnappyjava.so;osname=linux;processor=s390x",
+    "org/xerial/snappy/native/Linux/loongarch64/libsnappyjava.so;osname=linux;processor=loongarch64",
     "org/xerial/snappy/native/AIX/ppc/libsnappyjava.a;osname=aix;processor=ppc",
     "org/xerial/snappy/native/AIX/ppc64/libsnappyjava.a;osname=aix;processor=ppc64",
     "org/xerial/snappy/native/SunOS/x86/libsnappyjava.so;osname=sunos;processor=x86",
--- snappy-java-1.1.10.5.orig/src/main/java/org/xerial/snappy/OSInfo.java
+++ snappy-java-1.1.10.5/src/main/java/org/xerial/snappy/OSInfo.java
@@ -48,6 +48,7 @@ public class OSInfo {
     public static final String IBMZ_64 = "s390x";
     public static final String AARCH_64 = "aarch64";
     public static final String RISCV_64 = "riscv64";
+    public static final String LOONGARCH_64 = "loongarch64";
 
     static {
         // x86 mappings
@@ -97,6 +98,9 @@ public class OSInfo {
 
         // RISC-V mappings
         archMapping.put(RISCV_64, RISCV_64);
+
+	// LoongArch64 mappings
+        archMapping.put(LOONGARCH_64, LOONGARCH_64);
     }
 
     public static void main(String[] args) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libsnappyjava.so
Type: application/x-sharedlib
Size: 51400 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-maintainers/attachments/20240402/04ccc1a1/attachment-0001.bin>


More information about the pkg-java-maintainers mailing list