[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/2] build: Fix option to explicitly disable memory debugging
From: |
Paul Menzel |
Subject: |
Re: [PATCH 1/2] build: Fix option to explicitly disable memory debugging |
Date: |
Mon, 9 Mar 2020 12:18:41 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 |
Dear Patrick,
On 2020-03-07 17:29, Patrick Steinhardt wrote:
> The memory management system supports a debug mode that can be enabled
> at build time by passing "--enable-mm-debug" to the configure script.
> Passing the option will cause us define MM_DEBUG as expected, but in
> fact the reverse option "--disable-mm-deubg" will do the exact same
s/deubg/debug/
> thing and also set up the define. This currently causes the build of
> "lib/gnulib/base64.c" to fail as it tries to use `grub_debug_malloc()`
> and `grub_debug_free()` even though both symbols aren't defined.
>
> Seemingly, `AC_ARG_ENABLE()` will always execute the third argument if
> either the positive or negative option was passed. Let's thus fix the
> issue by moving the call to`AC_DEFINE()` into an explicit `if test
> $xenable_mm_debug` block, similar to how other defines work.
>
> Signed-off-by: Patrick Steinhardt <address@hidden>
> ---
> configure.ac | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index f19489418..9eeec2d76 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1448,9 +1448,11 @@ LIBS="$tmp_LIBS"
> # Memory manager debugging.
> AC_ARG_ENABLE([mm-debug],
> AS_HELP_STRING([--enable-mm-debug],
> - [include memory manager debugging]),
> - [AC_DEFINE([MM_DEBUG], [1],
> - [Define to 1 if you enable memory manager
> debugging.])])
> + [include memory manager debugging]))
> +if test x$enable_mm_debug = xyes; then
> + AC_DEFINE([MM_DEBUG], [1],
> + [Define to 1 if you enable memory manager debugging.])
> +fi
>
> AC_ARG_ENABLE([cache-stats],
> AS_HELP_STRING([--enable-cache-stats],
Reviewed-by: Paul Menzel <address@hidden>
Kind regards,
Paul
smime.p7s
Description: S/MIME Cryptographic Signature