[Debian-med-packaging] Bug#1037227: ctffind: Fix build on non-x86 architectures

Danilo Egea Gondolfo danilo.egea.gondolfo at gmail.com
Thu Jun 8 12:54:11 BST 2023


Package: ctffind
Version: 4.1.14-1
Severity: normal
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu mantic ubuntu-patch

Dear Maintainer,

* What led up to the situation?

This software uses x86 inline assembly and fails to build on other archs.

* What exactly did you do (or not do) that was effective (or ineffective)?

With this patch it will call sinf() and cosf() from the libc on non-x86 
systems.

* What was the outcome of this action?

Now it builds on non-x86 systems.



*** /tmp/tmp0oj8o0mu/bug_body

In Ubuntu, the attached patch was applied to achieve the following:

to get is building on non-x86 systems.

* d/p/src-core-matrix: fix build on non-x86 architectures.
Stop using x86 inline assembly on non-x86 architecture and call sinf()
and cosf() functions from the libc.


Thanks for considering the patch.

*** /tmp/tmp0oj8o0mu/ctffind_4.1.14-1ubuntu1.debdiff
diff -Nru ctffind-4.1.14/debian/patches/series 
ctffind-4.1.14/debian/patches/series
--- ctffind-4.1.14/debian/patches/series 1970-01-01 01:00:00.000000000 +0100
+++ ctffind-4.1.14/debian/patches/series 2023-06-08 12:14:33.000000000 +0100
@@ -0,0 +1 @@
+src-core-matrix
diff -Nru ctffind-4.1.14/debian/patches/src-core-matrix 
ctffind-4.1.14/debian/patches/src-core-matrix
--- ctffind-4.1.14/debian/patches/src-core-matrix 1970-01-01 
01:00:00.000000000 +0100
+++ ctffind-4.1.14/debian/patches/src-core-matrix 2023-06-08 
12:14:33.000000000 +0100
@@ -0,0 +1,18 @@
+Description: Don't use inline assembly on non-x86 architectures
+
+Bug-Ubuntu: https://launchpad.net/bugs/2023288
+
+--- a/src/core/matrix.cpp
++++ b/src/core/matrix.cpp
+@@ -4,7 +4,11 @@
+ // think i got it from a book i had about game programming in c.. it's 
probably slower than what the compiler would do these days.
+
+ #define AL_PI 3.14159265358979323846
++#if defined(__i386__) || defined(__x86_64__)
+ #define _AL_SINCOS(x, s, c) __asm__ ("fsincos" : "=t" (c), "=u" (s) : 
"0" (x))
++#else
++#define _AL_SINCOS(x, s, c) s = sinf(x); c = cosf(x)
++#endif
+ #define FLOATSINCOS(x, s, c) _AL_SINCOS((x) * AL_PI / 128.0, s ,c)
+
+ #define MAKE_ROTATION_f(x, y, z) \


-- System Information:
Debian Release: bookworm/sid
APT prefers mantic
APT policy: (500, 'mantic'), (100, 'mantic-proposed')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.2.0-21-generic (SMP w/16 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=en_IE.UTF-8, LC_CTYPE=en_IE.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_IE:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled



More information about the Debian-med-packaging mailing list