Package: exadrums
Followup-For: Bug #927229
Control: reassign -1 libexadrums
Control: retitle -1 libexadrums requires libatomic on some archiectures
Control: affects -1 exadrums
Control: tag -1 + patch

Hello.

The exadrums executable directly uses neither threads nor atomic
variables.

The problem is a missing dependency in the libexadrums library.
https://buildd.debian.org/status/fetch.php?pkg=libexadrums&arch=armel&ver=0.3.0-1&stamp=1555353342&raw=0

A patch is attached.

Once a fixed libexadrums is available in the archive, it should be
sufficient to rebuild exadrums on the affected architectures.

I may sponsor the upload if/when you agree on the solution.

By the way…

In order to have such issues reported sooner, I suggest adding
-Wl,--no-undefined to the linker flags.

The -pthread "adds architecture-dependent compiler and linker options
required when LIBS+=-lpthread is intended". As far as I understand, no
one should ever use -lpthread only.
https://stackoverflow.com/questions/2127797/significance-of-pthread-flag-when-compiling
and especially
http://www.hpl.hp.com/techreports/2004/HPL-2004-209.pdf

The reason why libexadrums requires *both* libatomic and libpthread
should probably be documented somewhere.
diff --git a/debian/changelog b/debian/changelog
index d4cc7aa..0948542 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+exadrums (0.3.0-2) experimental; urgency=medium
+
+  * Add -pthread -latomic --no-undefined build flags. Closes: #927229.
+
+ -- Jeremy Oden <jerem.o...@gmail.com>  Fri, 19 Apr 2019 12:44:53 +0200
+
 libexadrums (0.3.0-1) experimental; urgency=medium
 
   * Initial Debian packaging. Closes: #919327.
diff --git a/debian/patches/libatomic.diff b/debian/patches/libatomic.diff
new file mode 100644
index 0000000..014e123
--- /dev/null
+++ b/debian/patches/libatomic.diff
@@ -0,0 +1,35 @@
+Description: explicitly add -latomic to linker flags.
+ The upstream author is also the Debian maintainer, so there is no
+ need to forward the patch further.
+Bug-Debian: https://bugs.debian.org/927229
+Forwarded: not-needed
+Author: Nicolas Boulenguez <nico...@debian.org>
+
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -23,16 +23,23 @@
+ 
+ # Good habits.
+ AM_CXXFLAGS = -Wall
+-AM_LDFLAGS = -Wl,--as-needed
++AM_LDFLAGS = -Wl,--as-needed -Wl,--no-undefined
+ 
+ # Delegate library handling to libtool.
+ lib_LTLIBRARIES = libexadrums.la
+ 
+ libexadrums_la_CXXFLAGS = $(AM_CXXFLAGS) \
++  -pthread \
+   -std=c++17 $(alsa_CFLAGS) $(tinyxml2_CFLAGS)
+ libexadrums_la_LDFLAGS = $(AM_LDFLAGS) \
++  -pthread \
+   -version-info $(exadrums_libtool_version_info)
+-libexadrums_la_LIBADD = $(alsa_LIBS) $(tinyxml2_LIBS) -lpthread -lstdc++fs
++# The -pthread compiler and linker option links with libpthread, but
++# also selects various architecture-dependent settings.
++libexadrums_la_LIBADD = $(alsa_LIBS) $(tinyxml2_LIBS) -latomic -lstdc++fs
++# The standard C++ library does not include libatomic on some
++# architectures (armel mips mipsel). It does not hurt to always list
++# it here, it will only be effective when used thanks to --as-needed.
+ 
+ # Distribute and embed into the library.
+ libexadrums_la_SOURCES = \
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..2829210
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+libatomic.diff

Reply via email to