Commit 598e458c authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner

Merge #3025

Detect old versions of boost and suggest either disabling shared memory
for them or upgrading.
parents 17453016 cf7cb62d
......@@ -912,6 +912,17 @@ if test "x$use_shared_memory" = "xyes"; then
fi
AC_SUBST(BOOST_MAPPED_FILE_CXXFLAG)
if test "$BOOST_OFFSET_PTR_OLD" = "yes" -a "$use_shared_memory" = "yes" ; then
AC_MSG_ERROR([You're trying to compile against boost older than 1.48 with
shared memory. Older versions of boost have a bug which causes segfaults in
offset_ptr implementation when compiled by GCC with optimisations enabled.
See ticket no. 3025 for details.
Either update boost to newer version or use --without-shared-memory.
Note that most users likely don't need shared memory support.
])
fi
# Add some default CPP flags needed for Boost, identified by the AX macro.
CPPFLAGS="$CPPFLAGS $CPPFLAGS_BOOST_THREADCONF"
......
......@@ -31,6 +31,12 @@ dnl It is of no use if "WOULDFAIL" is yes.
dnl BOOST_STATIC_ASSERT_WOULDFAIL set to "yes" if BOOST_STATIC_ASSERT would
dnl cause build error; otherwise set to "no"
dnl BOOST_OFFSET_PTR_OLD set to "yes" if the version of boost is older than
dnl 1.48. Older versions of boost have a bug which
dnl causes segfaults in offset_ptr implementation when
dnl compiled by GCC with optimisations enabled.
dnl See ticket no. 3025 for details.
AC_DEFUN([AX_BOOST_FOR_BIND10], [
AC_LANG_SAVE
AC_LANG([C++])
......@@ -106,9 +112,21 @@ if test "X$GXX" = "Xyes"; then
BOOST_NUMERIC_CAST_WOULDFAIL=yes])
CXXFLAGS="$CXXFLAGS_SAVED"
AC_MSG_CHECKING([Boost rbtree is old])
AC_TRY_COMPILE([
#include <boost/version.hpp>
#if BOOST_VERSION < 104800
#error Too old
#endif
],,[AC_MSG_RESULT(no)
BOOST_OFFSET_PTR_OLD=no
],[AC_MSG_RESULT(yes)
BOOST_OFFSET_PTR_OLD=yes])
else
# This doesn't matter for non-g++
BOOST_NUMERIC_CAST_WOULDFAIL=no
BOOST_OFFSET_PTR_OLD=no
fi
# Boost interprocess::managed_mapped_file is highly system dependent and
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment