From 16bdbddc2cab90e360002b3440a4ed634e3c87f1 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 11 Jul 2018 09:36:24 -0400 Subject: When setting a nonstandard malloc, disable the system malloc. Closes ticket 20424. --- configure.ac | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 279660d9b2..d700329925 100644 --- a/configure.ac +++ b/configure.ac @@ -1438,6 +1438,10 @@ fi if test "$using_custom_malloc" = "no"; then AC_CHECK_FUNCS(mallinfo) fi +if test "$using_custom_malloc" = "yes"; then + # Tell the C compiler not to use the system allocator functions. + TOR_CHECK_CFLAGS([-fno-builtin-malloc -fno-builtin-realloc -fno-builtin-calloc -fno-builtin-free]) +fi # By default, we're going to assume we don't have mlockall() # bionic and other platforms have various broken mlockall subsystems. -- cgit v1.2.3-54-g00ecf