Trouble building opendht (jami dependency) package on mipsel

Amin Bandali amin.bandali at savoirfairelinux.com
Fri Nov 27 13:14:37 GMT 2020


Hello,

I've been working for a while on helping bring up-to-date the version of
Jami in the official Debian repos.  We've made some progress, but I've
run into a seemingly Debian-specific issue that I'm not sure how to work
around, and would appreciate any help I could get.

Context: opendht version 2.1.6-1 fails to build on architectures that
lack atomic support, as reflected in the build logs at
<https://buildd.debian.org/status/fetch.php?pkg=opendht&arch=mipsel&ver=2.1.6-1&stamp=1604370696&raw=0>.
As such, I asked upstream to adapt their CMake rules to link against
libatomic when necessary, and upstream versions 2.1.8.1 and later
include that fix.

I have verified that the upstream fix works on a mipsel machine, by
locally bumping the Debian package to latest release, and invoking cmake
and building manually on the terminal.  I see the following output from
CMake, as expected:

-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB
-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB - Failed
-- Looking for __atomic_fetch_add_4 in atomic
-- Looking for __atomic_fetch_add_4 in atomic - found
-- Performing Test HAVE_CXX_ATOMICS_WITH_LIB
-- Performing Test HAVE_CXX_ATOMICS_WITH_LIB - Success

However, it seems that CMake when invoked by the Debian packaging tools
(I tried both `dpkg-buildpackage -us -uc' and `debuild -b -uc -us'),
CMake fails to recognize the need for linking against libatomic, and
somehow mistakenly deduces that linking against libatomic isn't
necessary, when it very much is.  I see:

-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB
-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB - Success

Which looks clearly wrong to me, because later in the build process, it
will fail at the linking stage due to absence of atomics.

To try and find where the issue could be, I basically replaced the
content of the package's `override_dh_auto_configure' in `debian/rules'
with the exact series of commands I run from the terminal (i.e. mkdir
build && cd build && cmake ..), but I still observe the different
behaviour of CMake.

Any thoughts as to what is happening here?  I would appreciate any
pointers/tips on how to proceed with debugging this issue.

Thanks in advance,

-- 
Amin Bandali
Free Software Consultant
Savoir-faire Linux
GNU Jami: bandali



More information about the Pkg-voip-maintainers mailing list