Source: sbsigntool
Version: 0.9.4-3.1
Severity: wishlist
Tags: ftbfs patch
User: debian-loonga...@lists.debian.org
Usertags: loong64

Dear maintainers,

Compiling sbsigntool package failed on my local loong64 rootfs environment.
I have added support for loongarch in sbsigntool package.
In addition, we should add build support for loongarch.

The sbsigntool was built successfully in my local ENV.
Please consider the patch I attached.
Your opinions are welcome.

Thanks,
Dandan Zhang

diff -Nru sbsigntool-0.9.4/debian/control sbsigntool-0.9.4/debian/control
--- sbsigntool-0.9.4/debian/control     2021-09-14 06:39:01.000000000 +0000
+++ sbsigntool-0.9.4/debian/control     2022-06-04 11:37:27.000000000 +0000
@@ -17,7 +17,7 @@
 Standards-Version: 4.5.1
 
 Package: sbsigntool
-Architecture: any-amd64 any-i386 arm64 armhf any-riscv64
+Architecture: any-amd64 any-i386 arm64 armhf any-riscv64 any-loong64
 Depends: ${shlibs:Depends}, ${misc:Depends}
 Multi-Arch: foreign
 Description: Tools to manipulate signatures on UEFI binaries and drivers
diff -Nru 
sbsigntool-0.9.4/debian/patches/add-support-for-LoongArch-images.patch 
sbsigntool-0.9.4/debian/patches/add-support-for-LoongArch-images.patch
--- sbsigntool-0.9.4/debian/patches/add-support-for-LoongArch-images.patch      
1970-01-01 00:00:00.000000000 +0000
+++ sbsigntool-0.9.4/debian/patches/add-support-for-LoongArch-images.patch      
2022-06-04 11:37:27.000000000 +0000
@@ -0,0 +1,36 @@
+Description: Add support for LoongArch images
+ .
+ sbsigntool (0.9.4-3.1+loong64) unreleased; urgency=medium
+ .
+   * Add support for LoongArch images.
+Author: Dandan Zhang <zhangdan...@loongson.cn>
+---
+Last-Update: 2024-04-17
+
+--- sbsigntool-0.9.4.orig/src/coff/pe.h
++++ sbsigntool-0.9.4/src/coff/pe.h
+@@ -133,6 +133,8 @@
+ #define IMAGE_FILE_MACHINE_EBC               0x0ebc
+ #define IMAGE_FILE_MACHINE_I386              0x014c
+ #define IMAGE_FILE_MACHINE_IA64              0x0200
++#define IMAGE_FILE_MACHINE_LOONGARCH32       0x6232
++#define IMAGE_FILE_MACHINE_LOONGARCH64       0x6264
+ #define IMAGE_FILE_MACHINE_M32R              0x9041
+ #define IMAGE_FILE_MACHINE_M68K              0x0268
+ #define IMAGE_FILE_MACHINE_MIPS16            0x0266
+--- sbsigntool-0.9.4.orig/src/image.c
++++ sbsigntool-0.9.4/src/image.c
+@@ -240,11 +240,13 @@ static int image_pecoff_parse(struct ima
+       case IMAGE_FILE_MACHINE_AMD64:
+       case IMAGE_FILE_MACHINE_AARCH64:
+       case IMAGE_FILE_MACHINE_RISCV64:
++      case IMAGE_FILE_MACHINE_LOONGARCH64:
+               rc = image_pecoff_parse_64(image);
+               break;
+       case IMAGE_FILE_MACHINE_I386:
+       case IMAGE_FILE_MACHINE_THUMB:
+       case IMAGE_FILE_MACHINE_RISCV32:
++      case IMAGE_FILE_MACHINE_LOONGARCH32:
+               rc = image_pecoff_parse_32(image);
+               break;
+       default:
diff -Nru sbsigntool-0.9.4/debian/patches/series 
sbsigntool-0.9.4/debian/patches/series
--- sbsigntool-0.9.4/debian/patches/series      2022-06-04 11:36:09.000000000 
+0000
+++ sbsigntool-0.9.4/debian/patches/series      2022-06-04 11:37:27.000000000 
+0000
@@ -2,3 +2,4 @@
 fix-efi-arch-detection.patch
 0001-sbsigntool-add-support-for-RISC-V-images.patch
 OpenSSL3.patch
+add-support-for-LoongArch-images.patch

Reply via email to