Description: Fix a FTBFS on armel, mips, mipsel and friends
Bug-Debian: http://bugs.debian.org/872881
Forwarded: not yet

---
 tools/cmake/MakeLib.cmake |    5 +++++
 1 file changed, 5 insertions(+)

Index: b/tools/cmake/MakeLib.cmake
===================================================================
--- a/tools/cmake/MakeLib.cmake
+++ b/tools/cmake/MakeLib.cmake
@@ -114,6 +114,11 @@ if(enable_smpi AND APPLE)
   set(SIMGRID_DEP "${SIMGRID_DEP} -Wl,-U -Wl,_smpi_simulated_main")
 endif()
 
+# Fix a FTBFS on armel, mips, mipsel and friends (Debian's #872881)
+if(CMAKE_COMPILER_IS_GNUCC)
+    set(SIMGRID_DEP   "${SIMGRID_DEP}   -Wl,--as-needed -latomic -Wl,--no-as-needed")
+endif()
+
 target_link_libraries(simgrid 	${SIMGRID_DEP})
 
 # Dependencies from maintainer mode
