From 98753aa73772bb0fae8cee668e513d5754ab7737 Mon Sep 17 00:00:00 2001 From: Aliaksey Kandratsenka Date: Mon, 20 Feb 2017 16:04:14 -0800 Subject: [PATCH] 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. --- configure.ac | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 752e22a..a7f63f7 100644 --- a/configure.ac +++ b/configure.ac @@ -358,9 +358,11 @@ 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(,)], - perftools_cv_sized_deallocation_result=yes, - perftools_cv_sized_deallocation_result=no) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [[#include ]], + [[(::operator delete)(0, 256)]])], + perftools_cv_sized_deallocation_result=yes, + perftools_cv_sized_deallocation_result=no) CXXFLAGS="$OLD_CXXFLAGS" AC_LANG_POP(C++)])