[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1054463: kodi: FTBFS: add support for loongarch64



Source: kodi
Version: 2:20.2+dfsg-4
Severity: wishlist
Tags: ftbfs patch
User: debian-loongarch@lists.debian.org
Usertags: loong64

Dear maintainers,

When compiling the package kodi for loong64 in the Debian Package Auto-Building environment [1], the error messages is as follows.
......Omit
The following tests FAILED:
    130 - TestSystemInfo.GetKernelBitness (Failed)
    131 - TestSystemInfo.GetKernelCpuFamily (Failed)
    132 - TestSystemInfo.GetXbmcBitness (Failed)
    137 - TestSystemInfo.GetBuildTargetCpuFamily (Failed)
Errors while running CTest
make[2]: *** [Makefile:74: test] Error 8
make[2]: Leaving directory '/<<PKGBUILDDIR>>/obj-loongarch64-linux-gnu'
dh_auto_test: error: cd obj-loongarch64-linux-gnu && make -j16 test ARGS\+=--verbose ARGS\+=-j16 returned exit code 2
......Omit

The full compilation log can be found at [2].

I have added loongarch64 support in the SystemInfo.cpp file.
Please consider the patch I have attached.
Would it be possible to include the support for LoongArch in the next upload?
If you have any questions, you can contact me at any time.

[1]:https://buildd.debian.org/status/package.php?p=kodi&suite=sid
[2]:https://buildd.debian.org/status/logs.php?pkg=kodi&ver=2%3A20.2%2Bdfsg-4&arch=loong64

thanks,
Dandan Zhang

Description: Add support for loongarch64 
Last-Update: 2023-10-21

--- kodi-20.2+dfsg.orig/xbmc/utils/SystemInfo.cpp
+++ kodi-20.2+dfsg/xbmc/utils/SystemInfo.cpp
@@ -952,7 +952,7 @@ int CSysInfo::GetKernelBitness(void)
       std::string machine(un.machine);
       if (machine == "x86_64" || machine == "amd64" || machine == "arm64" || machine == "aarch64" ||
           machine == "ppc64" || machine == "ppc64el" || machine == "ppc64le" || machine == "ia64" ||
-          machine == "mips64" || machine == "s390x" || machine == "riscv64" ||
+          machine == "loongarch64" || machine == "mips64" || machine == "s390x" || machine == "riscv64" ||
           machine == "sparc64" || machine == "alpha")
         kernelBitness = 64;
       else
@@ -1000,6 +1000,8 @@ const std::string& CSysInfo::GetKernelCp
       std::string machine(un.machine);
       if (machine.compare(0, 3, "arm", 3) == 0 || machine.compare(0, 7, "aarch64", 7) == 0)
         kernelCpuFamily = "ARM";
+      else if (machine.compare(0, 9, "loongarch", 9) == 0 || machine.compare(0, 7, "loong64", 7) == 0 )
+        kernelCpuFamily = "LoongArch";
       else if (machine.compare(0, 4, "mips", 4) == 0)
         kernelCpuFamily = "MIPS";
       else if (machine.compare(0, 4, "i686", 4) == 0 || machine == "i386" || machine == "amd64" ||  machine.compare(0, 3, "x86", 3) == 0)
@@ -1391,6 +1393,8 @@ std::string CSysInfo::GetBuildTargetCpuF
   return "ARM (Thumb)";
 #elif defined(__arm__) || defined(_M_ARM) || defined (__aarch64__)
   return "ARM";
+#elif defined(__loongarch__)
+  return "LoongArch";
 #elif defined(__mips__) || defined(mips) || defined(__mips)
   return "MIPS";
 #elif defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) || defined(_M_AMD64) || \

Reply to: