Some architectures need to add -latomic explicitly
authorAlberto Garcia <berto@igalia.com>
Wed, 14 Sep 2016 16:40:06 +0000 (16:40 +0000)
committerRaspbian forward porter <root@raspbian.org>
Wed, 14 Sep 2016 16:40:06 +0000 (16:40 +0000)
===================================================================

Gbp-Pq: Name atomic_build_fix.patch

Source/autotools/SetupCompilerFlags.m4

index 2141818735e8ca6499cff4af6c9ed7a3b60e00e5..2264cfb426661de9ee6d69e5faa3d8dbe5d3dd0e 100644 (file)
@@ -72,3 +72,18 @@ AC_LANG_POP([C++])
 if test "$has_atomic" = "no"; then
    LIBS="$LIBS -latomic"
 fi
+
+# Some architectures need to add libatomic explicitly
+AC_LANG_PUSH([C++])
+AC_LINK_IFELSE([AC_LANG_SOURCE([[
+#include <atomic>
+int main() {
+   std::atomic<int64_t> i(0);
+   i++;
+   return 0;
+}
+]])], has_atomic=yes, has_atomic=no)
+AC_LANG_POP([C++])
+if test "$has_atomic" = "no"; then
+   LIBS="$LIBS -latomic"
+fi