From 0ec289545a054ee21bac7ded9d474288e43554b7 Mon Sep 17 00:00:00 2001 From: Ilya Grigoriev Date: Thu, 23 Jul 2026 09:58:25 -0700 Subject: [PATCH] configure.ac: don't enable jemalloc if ASAN enabled on macOS, error if both enabled ASAN and jemalloc both replace `malloc` with their version. Previously, configuring with `--enable-asan` on macOS would enable both jemalloc and ASAN. I'm not sure which one won, but seemed undesired. --- configure.ac | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 53c513acc..549f4a3b3 100644 --- a/configure.ac +++ b/configure.ac @@ -635,13 +635,20 @@ AC_ARG_ENABLE( ) try_jemalloc=no require_jemalloc=no +if test "x$enable_asan" = xyes && test "x$enable_jemalloc" = xyes; then + AC_MSG_ERROR([--enable-asan and --enable-jemalloc cannot be used together]) +fi if test "x$enable_jemalloc" = xyes; then try_jemalloc=yes elif test "x$enable_jemalloc" = x; then case "$host_os" in *darwin*) - try_jemalloc=yes - require_jemalloc=yes + if test "x$enable_asan" = xyes; then + enable_jemalloc=no + else + try_jemalloc=yes + require_jemalloc=yes + fi ;; esac fi