Package: cubicsdr
Version: 0.2.0+git20170310+dfsg-1
Severity: important
Tags: sid + patch
Justification: FTBFS
User: debian-m...@lists.debian.org
Usertags: mips-patch


Package cubicsdr_0.2.0+git20170310+dfsg-1 FTBFS on mips and mipsel with 
following error:

>...
> CMakeFiles/CubicSDR.dir/src/sdr/SoapySDRThread.cpp.o: In function 
> `std::__atomic_base<long long>::load(std::memory_order) const':
> /usr/include/c++/6/bits/atomic_base.h:396: undefined reference to 
> `__atomic_load_8'
> /usr/include/c++/6/bits/atomic_base.h:396: undefined reference to 
> `__atomic_load_8'
> /usr/include/c++/6/bits/atomic_base.h:396: undefined reference to 
> `__atomic_load_8'
> /usr/include/c++/6/bits/atomic_base.h:396: undefined reference to 
> `__atomic_load_8'
> /usr/include/c++/6/bits/atomic_base.h:396: undefined reference to 
> `__atomic_load_8'
> CMakeFiles/CubicSDR.dir/src/sdr/SoapySDRThread.cpp.o:/usr/include/c++/6/bits/atomic_base.h:396:
>  more undefined references to `__atomic_load_8' follow
> collect2: error: ld returned 1 exit status
> CMakeFiles/CubicSDR.dir/build.make:2053: recipe for target 'x86/CubicSDR' 
> failed
> make[3]: *** [x86/CubicSDR] Error 1
> make[3]: Leaving directory 
> '/«BUILDDIR»/cubicsdr-0.2.0+git20170310+dfsg/obj-mipsel-linux-gnu'
> CMakeFiles/Makefile2:102: recipe for target 'CMakeFiles/CubicSDR.dir/all' 
> failed
> make[2]: *** [CMakeFiles/CubicSDR.dir/all] Error 2
> make[2]: Leaving directory 
> '/«BUILDDIR»/cubicsdr-0.2.0+git20170310+dfsg/obj-mipsel-linux-gnu'
> Makefile:130: recipe for target 'all' failed
> make[1]: *** [all] Error 2
>...

Full build log:
https://buildd.debian.org/status/fetch.php?pkg=cubicsdr&arch=mipsel&ver=0.2.0%2Bgit20170310%2Bdfsg-1&stamp=1491259779&raw=0


The problem occurs because mips 32-bit architectures does not support use of 
8-byte atomics functions.
To solve this problem, it is necessary to provide linking with libatomic 
library.

I have created and attached a patch that enables linking with latomic library 
as needed.
With this patch package builds successfully on mips, mipsel, mips64el and i386.

Build for powerpc fails with same error and it should be solved as well.

Regards,
Radovan
--- cubicsdr-0.2.0+git20170310+dfsg.orig/CMakeLists.txt
+++ cubicsdr-0.2.0+git20170310+dfsg/CMakeLists.txt
@@ -238,7 +238,7 @@ IF (UNIX AND NOT APPLE)
     SET(USE_SYSTEM_RTAUDIO OFF CACHE BOOL "Use the system RtAudio which in turn provides OSS, ALSA, JACK, PulseAudio support depending on how it was compiled")
 
     SET(LIQUID_LIB liquid)
-    SET(OTHER_LIBRARIES ${OTHER_LIBRARIES} dl)
+    SET(OTHER_LIBRARIES ${OTHER_LIBRARIES} dl -Wl,--as-needed -latomic)
 
     IF(USE_SYSTEM_RTAUDIO)
         find_package(RtAudio)

Reply via email to