On Thu, 5 Sep 2024 10:49:59 +0200 Gianfranco Costamagna wrote:
> Hello, new debdiff pushed on deferred/10
>
> attached.
>
> G.

Hi Gianfranco Costamagna,

The whole support for loongarch64 in debian ldc 1:1.36.0-2, please consider the patch I attached (Signed-Off-By: wang...@loongson.cn).

1.Apply the attached patch.
Please unzip ldc-1.36.0-patches.tgz
# tree ldc-1.36.0-patches
ldc-1.36.0-patches
|-- ldc
|   |-- 0001-druntime-adjust-LoongArch64-definitions.patch
|   |-- 0002-ABI-Fix-calling-convention-for-LoongArch.patch
|   |-- 0003-ABI-Update-spec-url-for-LoongArch.patch
|   |-- 0004-druntime-Remove-unused-stack-slot-to-end-exactly-on-.patch
|   `-- 0005-druntime-Fix-backtraces-in-Fibers-for-LoongArch.patch
`-- phobos
    |-- 0001-Add-std-math-hardware.d-support-for-LoongArch64.patch
    |-- 0002-std-math-hardware.d-use-an-alternative-register-nami.patch
    |-- 0003-std-math-hardware.d-Fix-compile-error-for-LoongArch.patch
    `-- 0004-std.math.hardware-Fix-LoongArch-support-73.patch

For ldc:
#cd ldc-1.36.0
patch the below five patches in ldc-1.36.0-patches/ldc:
0001-druntime-adjust-LoongArch64-definitions.patch
0002-ABI-Fix-calling-convention-for-LoongArch.patch
0003-ABI-Update-spec-url-for-LoongArch.patch
0004-druntime-Remove-unused-stack-slot-to-end-exactly-on-.patch
0005-druntime-Fix-backtraces-in-Fibers-for-LoongArch.patch

For phobos:
#cd ldc-1.36.0/runtime/phobos
patch the below four patches in ldc-1.36.0-patches/phobos:
0001-Add-std-math-hardware.d-support-for-LoongArch64.patch
0002-std-math-hardware.d-use-an-alternative-register-nami.patch
0003-std-math-hardware.d-Fix-compile-error-for-LoongArch.patch
0004-std.math.hardware-Fix-LoongArch-support-73.patch

2.Add build support in d/control.
```
diff -Nru ldc-1.36.0/debian/control ldc-1.36.0/debian/control
--- ldc-1.36.0/debian/control   2024-02-18 22:00:23.000000000 +0100
+++ ldc-1.36.0/debian/control   2024-09-04 00:37:17.000000000 +0200
@@ -27,7 +27,7 @@
 Vcs-Browser: https://salsa.debian.org/d-team/ldc

 Package: ldc
-Architecture: amd64 arm64 armhf i386 riscv64
+Architecture: amd64 arm64 armhf i386 riscv64 loong64
 Provides: d-compiler,
           d-v2-compiler
 Depends: libphobos2-ldc-shared-dev (= ${binary:Version}),
@@ -42,7 +42,7 @@

 Package: libphobos2-ldc-shared106
 Section: libs
-Architecture: amd64 arm64 armhf i386 riscv64
+Architecture: amd64 arm64 armhf i386 riscv64 loong64
 Multi-Arch: same
 Depends: ${misc:Depends},
          ${shlibs:Depends}
@@ -57,7 +57,7 @@

 Package: libphobos2-ldc-shared-dev
 Section: libdevel
-Architecture: amd64 arm64 armhf i386 riscv64
+Architecture: amd64 arm64 armhf i386 riscv64 loong64
 Depends: libphobos2-ldc-shared106 (= ${binary:Version}),
          ${misc:Depends},
          ${shlibs:Depends}
```

The end, based on the above two steps, I have built ldc 1:1.36.0-2 successfully in my local ENV.
```
dpkg-deb: building package 'ldc' in '../ldc_1.36.0-2_loong64.deb'.
dpkg-deb: building package 'libphobos2-ldc-shared106' in '../libphobos2-ldc-shared106_1.36.0-2_loong64.deb'. dpkg-deb: building package 'libphobos2-ldc-shared-dev-dbgsym' in '../libphobos2-ldc-shared-dev-dbgsym_1.36.0-2_loong64.deb'. dpkg-deb: building package 'libphobos2-ldc-shared106-dbgsym' in '../libphobos2-ldc-shared106-dbgsym_1.36.0-2_loong64.deb'. dpkg-deb: building package 'libphobos2-ldc-shared-dev' in '../libphobos2-ldc-shared-dev_1.36.0-2_loong64.deb'.
 dpkg-genbuildinfo -O../ldc_1.36.0-2_loong64.buildinfo
 dpkg-genchanges -O../ldc_1.36.0-2_loong64.changes
```

Thanks,
Dandan

Attachment: ldc-1.36.0-patches.tgz
Description: application/compressed-tar

Reply via email to