From: Glenn Washburn <development@efficientek.com>
To: Daniel Kiper <dkiper@net-space.pl>,
grub-devel@gnu.org, Daniel Axtens <dja@axtens.net>
Cc: Glenn Washburn <development@efficientek.com>
Subject: [PATCH] configure: Properly handle MM_DEBUG
Date: Tue, 25 Jan 2022 23:55:16 -0600 [thread overview]
Message-ID: <20220126055516.790622-1-development@efficientek.com> (raw)
Define MM_DEBUG in config.h when --enable-mm-debug is passed to configure.
It was being defined in config-util.h which only gets used when building
GRUB utilities for the host side. The enabling of debugging for memory
management in include/grub/mm.h explicitly does not happen when compiling
for the GRUB utilities. So this debugging code effectively could never be
enabled. Note, that MM_DEBUG is defined in an #if directive because the
enabling of debugging checks if MM_DEBUG is defined, not what its value is.
So even if MM_DEBUG were defined to nothing, the debugging code would
still be enabled.
Signed-off-by: Glenn Washburn <development@efficientek.com>
---
I just got bit by this, and then remembered that Daniel A had something similar,
which inadvertently always enables MM_DEBUG. I believe this patch addresses
the concern that Daniel K had with that patch. Technically, the #undef is
unnecessary and I'm not opposed to taking it out.
Glenn
---
config.h.in | 6 ++++++
configure.ac | 6 ++++--
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/config.h.in b/config.h.in
index 9e8f9911b..9063e8149 100644
--- a/config.h.in
+++ b/config.h.in
@@ -9,6 +9,12 @@
#define GCRYPT_NO_DEPRECATED 1
#define HAVE_MEMMOVE 1
+#if @MM_DEBUG@
+#define MM_DEBUG @MM_DEBUG@
+#else
+#undef MM_DEBUG
+#endif
+
/* Define to 1 to enable disk cache statistics. */
#define DISK_CACHE_STATS @DISK_CACHE_STATS@
#define BOOT_TIME_STATS @BOOT_TIME_STATS@
diff --git a/configure.ac b/configure.ac
index 4f649edaf..263f02775 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1511,9 +1511,11 @@ AC_ARG_ENABLE([mm-debug],
AS_HELP_STRING([--enable-mm-debug],
[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.])
+ MM_DEBUG=1
+else
+ MM_DEBUG=0
fi
+AC_SUBST([MM_DEBUG])
AC_ARG_ENABLE([cache-stats],
AS_HELP_STRING([--enable-cache-stats],
--
2.27.0
reply other threads:[~2022-01-26 5:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220126055516.790622-1-development@efficientek.com \
--to=development@efficientek.com \
--cc=dja@axtens.net \
--cc=dkiper@net-space.pl \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.