From a800382e11edc0aad5ac4197dc2b65f70cd66929 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Date: Mon, 28 May 2018 14:17:22 +0100 Subject: [PATCH] Some architectures need to add -latomic explicitly =================================================================== Gbp-Pq: Name atomic_build_fix.patch --- Source/autotools/SetupCompilerFlags.m4 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Source/autotools/SetupCompilerFlags.m4 b/Source/autotools/SetupCompilerFlags.m4 index 2141818..2264cfb 100644 --- a/Source/autotools/SetupCompilerFlags.m4 +++ b/Source/autotools/SetupCompilerFlags.m4 @@ -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 +int main() { + std::atomic 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 -- 2.30.2