Source: tup
Version: 0.7.11-4
Severity: wishlist
Tags: ftbfs patch
User: debian-loonga...@lists.debian.org
Usertags: loong64

Dear maintainers,

Compiling the tup failed for loong64 in the Debian Package Auto-Building environment.
The error log is as follows,
```
../src/tup/platform.c:70:2: error: #error Unsupported cpu architecture. Please add support in tup/platform.c    70 | #error Unsupported cpu architecture. Please add support in tup/platform.c
      |  ^~~~~
make[1]: *** [debian/rules:17: override_dh_auto_build] Error 1
```
The Full log can be found at https://buildd.debian.org/status/logs.php?pkg=tup&ver=0.7.11-4&arch=loong64.

I have added support for loongarch64 in tup package.
Please consider the patch I attached.
Your opinions are welcome.

Thanks,
Dandan Zhang

Description: Add support for LoongArch. 
Last-Update: 2024-04-09

--- tup-0.7.11.orig/src/tup/platform.c
+++ tup-0.7.11/src/tup/platform.c
@@ -66,6 +66,10 @@ const char *tup_arch = "hppa";
 const char *tup_arch = "riscv64";
 #elif (__riscv || __riscv__) && __riscv_xlen == 32
 const char *tup_arch = "riscv32";
+#elif __loongarch__ && __loongarch_grlen == 32
+const char *tup_arch = "loongarch32";
+#elif __loongarch__ && __loongarch_grlen == 64
+const char *tup_arch = "loongarch64";
 #else
 #error Unsupported cpu architecture. Please add support in tup/platform.c
 #endif
--- tup-0.7.11.orig/tup.1
+++ tup-0.7.11/tup.1
@@ -765,7 +765,7 @@ In this case, the @-variable "FOO" is ex
 TUP_PLATFORM is a special @-variable. If CONFIG_TUP_PLATFORM is not set in the tup.config file, it has a default value according to the platform that tup itself was compiled in. Currently the default value is one of "linux", "solaris", "macosx", "win32", "freebsd" or "netbsd".
 .TP
 .B @(TUP_ARCH)
-TUP_ARCH is another special @-variable. If CONFIG_TUP_ARCH is not set in the tup.config file, it has a default value according to the processor architecture that tup itself was compiled in. Currently the default value is one of "i386", "x86_64", "powerpc", "powerpc64", "ia64", "alpha", "sparc", "arm64", or "arm".
+TUP_ARCH is another special @-variable. If CONFIG_TUP_ARCH is not set in the tup.config file, it has a default value according to the processor architecture that tup itself was compiled in. Currently the default value is one of "i386", "x86_64", "powerpc", "powerpc64", "ia64", "alpha", "sparc", "loongarch32", "loongarch64", "arm64", or "arm".
 
 .SH "VARIANTS"
 Tup supports variants, which allow you to build your project multiple times with different configurations. Perhaps the most common case is to build a release and a debug configuration with different compiler flags, though any number of variants can be used to support whatever configurations you like. Each variant is built in its own directory distinct from each other and from the source tree. When building with variants, the in-tree build is disabled. To create a variant, make a new directory at the top of the tup hierarchy and create a "tup.config" file there. For example:

Reply via email to