@@ -47,7 +47,9 @@ AC_ARG_WITH([platform],
[AS_HELP_STRING([--with-platform=prefix],
[Select platform to be used, default linux-generic])],
[],
- [with_platform=linux-generic])
+ [with_platform=linux-generic
+ m4_include([./platform/linux-generic/m4/configure.m4])
+ ])
AC_SUBST([with_platform])
new file mode 100644
@@ -0,0 +1,17 @@
+AC_MSG_CHECKING(for GCC atomic builtins)
+AC_LINK_IFELSE(
+ [AC_LANG_SOURCE(
+ [[int main() {
+ int v = 1;
+ __atomic_fetch_add(&v, 1, __ATOMIC_RELAXED);
+ __atomic_fetch_sub(&v, 1, __ATOMIC_RELAXED);
+ __atomic_store_n(&v, 1, __ATOMIC_RELAXED);
+ __atomic_load_n(&v, __ATOMIC_RELAXED);
+ return 0;
+ }
+ ]])],
+ AC_MSG_RESULT(yes),
+ AC_MSG_RESULT(no)
+ echo "GCC-style __atomic builtins not supported by the compiler."
+ echo "Use newer version. For gcc > 4.7.0"
+ exit -1)
Odp atomic operations based on compiler build-ins. Make sure that compiler supports such operation at configure stage. Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> --- configure.ac | 4 +++- platform/linux-generic/m4/configure.m4 | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 platform/linux-generic/m4/configure.m4