Package: limesuite
Version: 16.8.23.819+git20161221+dfsg-1
Severity: important
Tags: sid + patch
Justification: FTBFS
User: debian-m...@lists.debian.org
Usertags: mips-patch


Package limesuite_16.8.23.819+git20161221+dfsg-1 FTBFS on mips and mipsel with 
following error:

> /«BUILDDIR»/limesuite-16.8.23.819+git20161221+dfsg/src/boardEmulator.cpp:111:21:
>  warning: ignoring return value of 'int system(const char*)', declared with 
> attribute warn_unused_result [-Wunused-result]
>   system(linkCommand);
>                     ^
> ../libLimeSuite.so.16.8.23.819: undefined reference to `__atomic_exchange_8'
> ../libLimeSuite.so.16.8.23.819: undefined reference to `__atomic_load_8'
> ../libLimeSuite.so.16.8.23.819: undefined reference to `__atomic_store_8'
> collect2: error: ld returned 1 exit status
> src/examples/CMakeFiles/basicRX.dir/build.make:100: recipe for target 
> 'bin/basicRX' failed
> make[3]: *** [bin/basicRX] Error 1
> make[3]: Leaving directory 
> '/«BUILDDIR»/limesuite-16.8.23.819+git20161221+dfsg/obj-mips-linux-gnu'

Full build log:
https://buildd.debian.org/status/fetch.php?pkg=limesuite&arch=mips&ver=16.8.23.819%2Bgit20161221%2Bdfsg-1&stamp=1482435869

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 resolves this issue.
With this patch package builds successfully on mips, mipsel, mips64el and i386.

Build for powerpc also fails with same error and should be resolved in the same 
way as for the mips architecture,
but I did not have a chance to test it.

Regards,
Radovan
--- limesuite-16.8.23.819+git20161221+dfsg.orig/src/CMakeLists.txt
+++ limesuite-16.8.23.819+git20161221+dfsg/src/CMakeLists.txt
@@ -93,6 +93,12 @@ if(CMAKE_COMPILER_IS_GNUCXX)
     list(APPEND LIME_SUITE_LIBRARIES -pthread)
 endif(CMAKE_COMPILER_IS_GNUCXX)
 
+if (CMAKE_SYSTEM_PROCESSOR MATCHES "(mips)|(MIPS)|(mipsel)|(MIPSEL)")
+        if (CMAKE_SIZEOF_VOID_P MATCHES "4")
+             list(APPEND LIME_SUITE_LIBRARIES -latomic)
+	endif()
+endif()
+
 #sqlite depedency
 list(APPEND LIME_SUITE_INCLUDES ${SQLITE3_INCLUDE_DIRS})
 list(APPEND LIME_SUITE_LIBRARIES ${SQLITE3_LIBRARIES})

Reply via email to