Source: linuxlogo
Version: 6.0-0.1
Severity: normal
X-Debbugs-Cc: [email protected]
Dear Maintainer,
linuxlogo compiled incorrectly on loongarch platform, attachment patch solved
the problem. It has been verified on loongarch platform, please merge the patch.
wuruilong
-- System Information:
Debian Release: trixie/sid
APT prefers unreleased
APT policy: (500, 'unreleased'), (500, 'unstable')
Architecture: loong64 (loongarch64)
Kernel: Linux 5.10.0-60.96.0.126.oe2203.loongarch64 (SMP w/32 CPU threads)
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: unable to detect
Description: <short summary of the patch>
TODO: Put a short summary on the line above and replace this paragraph
with a longer explanation of this change. Complete the meta-information
with other relevant fields (see below for details). To make it easier, the
information below has been extracted from the changelog. Adjust it or drop
it.
.
linuxlogo (6.0-0.1) unstable; urgency=medium
.
* NMU: Non-Maintainer Upload
* New Upstream release
- Can read amount of system RAM w/o privs (closes: #839594)
- Update debian/rules for dh13 and new release
- Update debian/linuxlogo.docs to upstream changes
- Forward port quilt patches, all but 3 have been upstreamed
- Add quilt patch so po/Makefile uses DESTDIR
- Add quilt patch to use fscanf return value
* Bump debhelper from deprecated 9 to 13.
* Bump to Debian Policy 4.5.1.
* Use secure copyright file specification URI.
* Change priority extra to priority optional.
* Set upstream metadata fields: Repository, Repository-Browse,
Bug-Database, Bug-Submit.
* Update Vcs-* headers to use salsa repository.
* Trim trailing whitespace in changelog.
* Fix day-of-week for changelog entry 3.9b4-1.2.
* Update watch file format version to 4.
* Rules-Requires-Root: no
* Add pre-dependency per lintian
* Fix FTCBFS: Export a suitable CROSS variable (Closes: #972289),
thanks to Helmut Grohne <[email protected]>
* Flush ./potmp/ stuff, backup/restore po/linux_logo.pot instead
* Enable full hardening flags
Author: Barak A. Pearlmutter <[email protected]>
Bug-Debian: https://bugs.debian.org/839594
Bug-Debian: https://bugs.debian.org/972289
---
The information above should follow the Patch Tagging Guidelines, please
checkout https://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:
Origin: (upstream|backport|vendor|other), (<patch-url>|commit:<commit-id>)
Bug: <upstream-bugtracker-url>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: (no|not-needed|<patch-forwarded-url>)
Applied-Upstream: <version>, (<commit-url>|commit:<commid-id>)
Reviewed-By: <name and email of someone who approved/reviewed the patch>
Last-Update: 2024-09-03
--- linuxlogo-6.0.orig/libsysinfo-0.3.0/Linux/Makefile
+++ linuxlogo-6.0/libsysinfo-0.3.0/Linux/Makefile
@@ -32,6 +32,10 @@ ifneq (,$(findstring mips,$(ARCH)))
ARCH := mips
endif
+ifneq (,$(findstring loongarch,$(ARCH)))
+ ARCH := loongarch
+endif
+
all: cpuinfo.o sysinfo_linux.o
@@ -55,6 +59,9 @@ frv: cpuinfo_frv.c
ia64: cpuinfo_ia64.c
$(CROSS)$(CC) $(CFLAGS) -o cpuinfo.o -c cpuinfo_ia64.c
+loongarch: cpuinfo_loongarch.c
+ $(CROSS)$(CC) $(CFLAGS) -o cpuinfo.o -c cpuinfo_loongarch.c
+
m32r: cpuinfo_m32r.c
$(CROSS)$(CC) $(CFLAGS) -o cpuinfo.o -c cpuinfo_m32r.c
--- /dev/null
+++ linuxlogo-6.0/libsysinfo-0.3.0/Linux/cpuinfo_loongarch.c
@@ -0,0 +1,69 @@
+/* Handles loongarch chips on Linux architecture */
+/* by JiaLing Zhang <[email protected]> */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h> /* atof */
+
+#include "../sysinfo.h"
+#include "../include/generic.h"
+
+int get_cpu_info(struct cpu_info_type *cpu_info) {
+
+ FILE *fff;
+ char temp_string[BUFSIZ];
+ char vendor_string[BUFSIZ],model_string[BUFSIZ];
+ int cpu_count=0;
+ float megahertz=0.0,bogomips=0.0;
+
+ vendor_string[0]=model_string[0]=0;
+
+ strncpy(vendor_string,"Loongson",9);
+
+ /* We get all of our info here from /proc/cpuinfo */
+ if ((fff=fopen(get_cpuinfo_file(),"r") )!=NULL) {
+
+ while ( (fgets(temp_string,BUFSIZ,fff)!=NULL) ) {
+
+ if (cpu_count==0) {
+
+ if ( !(strncmp(temp_string,"Model Name",10))) {
+
strncpy(model_string,parse_line(temp_string),BUFSIZ-1);
+ clip_lf(model_string,BUFSIZ);
+ }
+
+ if ( !(strncmp(temp_string,"CPU MHz",7))) {
+ megahertz=atof(parse_line(temp_string));
+ }
+ }
+
+ /* Ugh why must people play with capitalization */
+ if ( !(strncmp(temp_string,"bogomips",8)) ||
+ !(strncmp(temp_string,"BogoMips",8)) ||
+ !(strncmp(temp_string,"BogoMIPS",8))) {
+ bogomips+=atof(parse_line(temp_string));
+ cpu_count++; /* Cheating way to detect number
of CPUs */
+ }
+ }
+ }
+
+
strncpy_truncate(cpu_info->chip_vendor,vendor_string,SYSINFO_CHIP_VENDOR_SIZE);
+
strncpy_truncate(cpu_info->chip_type,model_string,SYSINFO_CHIP_TYPE_SIZE);
+
+ cpu_info->num_cpus=cpu_count;
+ cpu_info->megahertz=megahertz;
+ cpu_info->bogomips=bogomips;
+
+ return 0;
+}
+
+int get_hardware(char *hardware_string) {
+
+ return -1;
+}
+
+ /* Some architectures might have better ways of detecting RAM size */
+long long get_arch_specific_mem_size(void) {
+ /* We have no special way of detecting RAM */
+ return 0;
+}