test that sized deallocation really works before enabling it

Weirdly, some OSX compiler does allow -fsized-deallocation, yet barks
on any attempt to actually use it at compile time (!). So lets detect
this as well in configure and opt out as necessary.

Should fix issue #870.
This commit is contained in:
Aliaksey Kandratsenka 2017-02-20 16:04:14 -08:00
parent 5618ef7850
commit 98753aa737

View File

@ -358,7 +358,9 @@ AC_CACHE_CHECK([if C++ compiler supports -fsized-deallocation],
[AC_LANG_PUSH(C++)
OLD_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -fsized-deallocation"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,)],
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <new>]],
[[(::operator delete)(0, 256)]])],
perftools_cv_sized_deallocation_result=yes,
perftools_cv_sized_deallocation_result=no)
CXXFLAGS="$OLD_CXXFLAGS"