[med-svn] [Git][med-team/libmaus2][master] 2 commits: Fix "fix error caused by sysconf function" with a patch from the bug summiter.

Michael R. Crusoe (@crusoe) gitlab at salsa.debian.org
Wed Apr 17 15:58:00 BST 2024



Michael R. Crusoe pushed to branch master at Debian Med / libmaus2


Commits:
b4e10a25 by Michael R. Crusoe at 2024-04-17T16:01:21+02:00
Fix "fix error caused by sysconf function" with a patch from the bug summiter.

(Closes: #1068573)

- - - - -
848b6afb by Michael R. Crusoe at 2024-04-17T16:01:22+02:00
d/control: pkg-config => pkgconf

- - - - -


4 changed files:

- debian/changelog
- debian/control
- + debian/patches/add-support-for-loong64.patch
- + debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,12 @@
+libmaus2 (2.0.813+ds-2) UNRELEASED; urgency=medium
+
+  * Team upload.
+  * Fix "fix error caused by sysconf function" with a patch from the bug
+    summiter. (Closes: #1068573)
+  * d/control: pkg-config => pkgconf
+
+ -- Michael R. Crusoe <crusoe at debian.org>  Wed, 17 Apr 2024 15:54:21 +0200
+
 libmaus2 (2.0.813+ds-1) unstable; urgency=medium
 
   * New upstream version


=====================================
debian/control
=====================================
@@ -9,7 +9,7 @@ Build-Depends: debhelper-compat (= 13),
                d-shlibs,
                libboost-atomic-dev,
                libsecrecy-dev,
-               pkg-config,
+               pkgconf,
                zlib1g-dev
 Standards-Version: 4.6.2
 Vcs-Browser: https://salsa.debian.org/med-team/libmaus2


=====================================
debian/patches/add-support-for-loong64.patch
=====================================
@@ -0,0 +1,43 @@
+Description: workaround for architectures with broken sysconf.c
+Author: wuruilong <wuruilong at loongson.cn>
+Bug-Debian: https://bugs.debian.org/1068573
+Forwarded: https://gitlab.com/german.tischler/libmaus2/-/merge_requests/21
+
+Some architectures in glibc do not define the sysconf.c file, and using the
+generic posix sysconf.c file to call the _SC_LEVEL1_DCACHE_LINESIZE variable
+returns 0 by default, which leads to failure of the test in
+loongarch, ia64, s390x and other architectures,
+
+This patch reference lscpu code to read the data in coherency_line_size file
+directly can fix the above error, and it passes the test on x86 and loongarch.
+
+--- libmaus2.orig/src/libmaus2/arch/CacheLineSize.cpp
++++ libmaus2/src/libmaus2/arch/CacheLineSize.cpp
+@@ -17,6 +17,7 @@
+ */
+ #include <libmaus2/arch/CacheLineSize.hpp>
+ #include <stdexcept>
++#include <stdio.h>
+ 
+ #include <libmaus2/LibMausConfig.hpp>
+ 
+@@ -39,10 +40,17 @@
+ /**
+  * @return size of a (level 1) cache line in bytes
+  **/
+-#if defined(LIBMAUS2_HAVE_SYSCONF) && defined(_SC_LEVEL1_DCACHE_LINESIZE)
++#if defined(__linux__)
+ static uint64_t getCacheLineSizeLocal()
+ {
+-	return sysconf(_SC_LEVEL1_DCACHE_LINESIZE);
++	FILE *fp = NULL;
++	fp = fopen("/sys/devices/system/cpu/cpu0/cache/index0/coherency_line_size", "r");
++	uint64_t i = 0;
++	if(fp){
++		fscanf(fp, "%d", &i);
++		fclose(fp);
++	}
++	return i;
+ }
+ #elif defined(_WIN32)
+ static uint64_t getCacheLineSizeLocal()


=====================================
debian/patches/series
=====================================
@@ -0,0 +1 @@
+add-support-for-loong64.patch



View it on GitLab: https://salsa.debian.org/med-team/libmaus2/-/compare/4efc6b010fed0f1a29fb939a509c96a8ff625da7...848b6afb3f040b100026f6b28d253389629f0278

-- 
View it on GitLab: https://salsa.debian.org/med-team/libmaus2/-/compare/4efc6b010fed0f1a29fb939a509c96a8ff625da7...848b6afb3f040b100026f6b28d253389629f0278
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20240417/fb7304a5/attachment-0001.htm>


More information about the debian-med-commit mailing list