Source: codeblocks
Version: 20.03+svn13046-0.1
Severity: wishlist
Tags: patch ftbfs
User: debian-de...@lists.debian.org
Usertags: loongarch64
Dear maintainers,
When compiling the package codeblocks for loong64 in the Debian Package
Auto-Building environment [1], The error message is as follows:
......Omit
../../src/sdk/mozilla_chardet/include/nsprpub/pr/include/prcpucfg_linux.h:965:2:
error: #error "Unknown CPU architecture"
965 | #error "Unknown CPU architecture"
| ^~~~~
../../src/sdk/mozilla_chardet/include/nsprpub/pr/include/prtypes.h:263:2:
error: #error No suitable type for PRInt8/PRUint8
263 | #error No suitable type for PRInt8/PRUint8
| ^~~~~
../../src/sdk/mozilla_chardet/include/nsprpub/pr/include/prtypes.h:288:2:
error: #error No suitable type for PRInt16/PRUint16
288 | #error No suitable type for PRInt16/PRUint16
| ^~~~~
../../src/sdk/mozilla_chardet/include/nsprpub/pr/include/prtypes.h:320:2:
error: #error No suitable type for PRInt32/PRUint32
320 | #error No suitable type for PRInt32/PRUint32
......Omit
The full compilation log can be found at [2].
I have added support for loongarch64. Please consider the patch I have
attached.
BTW, the patch I provided in the attachment doesn't affect other
architectures and compiles fine on the loongarch architecture.
If you have any questions, you can contact me at any time.
[1]:https://buildd.debian.org/status/package.php?p=codeblocks&suite=sid
[2]:https://buildd.debian.org/status/logs.php?pkg=codeblocks&ver=20.03%2Bsvn13046-0.1&arch=loong64
thanks,
Dandan Zhang
Description: Add support for loongarch64
codeblocks (20.03+svn13046-0.1+loong64) unreleased; urgency=medium
.
* Add support for loongarch64.
Author: Dandan Zhang <zhangdan...@loongson.cn>
Last-Update: 2023-10-11
--- codeblocks-20.03+svn13046.orig/src/sdk/mozilla_chardet/include/nsprpub/pr/include/prcpucfg_linux.h
+++ codeblocks-20.03+svn13046/src/sdk/mozilla_chardet/include/nsprpub/pr/include/prcpucfg_linux.h
@@ -486,6 +486,52 @@
#define PR_BYTES_PER_WORD_LOG2 2
#define PR_BYTES_PER_DWORD_LOG2 3
+#elif defined(__loongarch__) && __loongarch_grlen == 64
+
+#define IS_LITTLE_ENDIAN 1
+#undef IS_BIG_ENDIAN
+#define IS_64
+
+#define PR_BYTES_PER_BYTE 1
+#define PR_BYTES_PER_SHORT 2
+#define PR_BYTES_PER_INT 4
+#define PR_BYTES_PER_INT64 8
+#define PR_BYTES_PER_LONG 8
+#define PR_BYTES_PER_FLOAT 4
+#define PR_BYTES_PER_DOUBLE 8
+#define PR_BYTES_PER_WORD 4
+#define PR_BYTES_PER_DWORD 8
+
+#define PR_BITS_PER_BYTE 8
+#define PR_BITS_PER_SHORT 16
+#define PR_BITS_PER_INT 32
+#define PR_BITS_PER_INT64 64
+#define PR_BITS_PER_LONG 64
+#define PR_BITS_PER_FLOAT 32
+#define PR_BITS_PER_DOUBLE 64
+#define PR_BITS_PER_WORD 32
+
+#define PR_BITS_PER_BYTE_LOG2 3
+#define PR_BITS_PER_SHORT_LOG2 4
+#define PR_BITS_PER_INT_LOG2 5
+#define PR_BITS_PER_INT64_LOG2 6
+#define PR_BITS_PER_LONG_LOG2 6
+#define PR_BITS_PER_FLOAT_LOG2 5
+#define PR_BITS_PER_DOUBLE_LOG2 6
+#define PR_BITS_PER_WORD_LOG2 5
+
+#define PR_ALIGN_OF_SHORT 2
+#define PR_ALIGN_OF_INT 4
+#define PR_ALIGN_OF_LONG 8
+#define PR_ALIGN_OF_INT64 8
+#define PR_ALIGN_OF_FLOAT 4
+#define PR_ALIGN_OF_DOUBLE 8
+#define PR_ALIGN_OF_POINTER 8
+#define PR_ALIGN_OF_WORD 4
+
+#define PR_BYTES_PER_WORD_LOG2 2
+#define PR_BYTES_PER_DWORD_LOG2 3
+
#elif defined(__mips__)
#ifdef __MIPSEB__