From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1nCbKi-0002vv-Fg for mharc-grub-devel@gnu.org; Wed, 26 Jan 2022 00:59:04 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53894) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCbKg-0002vZ-CU for grub-devel@gnu.org; Wed, 26 Jan 2022 00:59:02 -0500 Received: from [2607:f8b0:4864:20::102b] (port=42993 helo=mail-pj1-x102b.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nCbKb-0004P0-Sj for grub-devel@gnu.org; Wed, 26 Jan 2022 00:59:01 -0500 Received: by mail-pj1-x102b.google.com with SMTP id my12-20020a17090b4c8c00b001b528ba1cd7so5192583pjb.1 for ; Tue, 25 Jan 2022 21:58:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3cVYoEV7r0fYbk/FL106SSlXnHilrl68io/I0n2nplY=; b=N3c1voHVKaybtQv8bIMgGeMDAbSz2dimPm8Re/OqAqH2t02Uvod7kw9Vix1dTZE9TM T7aziJ2JlXCCo4ZwjAWzaEt1nipmMVWOGrBeJclTdvcUDRelVy7hnk6LWxaPvh5h0g+g tbnwhgmVWWxrcPwGyv9Ug0bhphqib9zqaYhAvoOtb5A5Y8voCpIdwxXjnql1TQcQlhGn VzA8erFLiVPPNuVSCYibFnnDtBN9LCLHqtYWqTW/iQ8pzyLOjf2U/1/nNqbQmftEjZF1 hEMAOUCIIpa4yOKrsC2vShf4iBjNUp/aL67E7XVi3icZ+Mz4LNPnsJqiWXWT+d4iAOSw 9ELg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3cVYoEV7r0fYbk/FL106SSlXnHilrl68io/I0n2nplY=; b=oWT7gqxd96z11lxTzcb4E6ifLqO7kBz7tJc25Qa9MnbQ6e8LfsNo8q2L1/cl/Dan12 asBXcR03PApyfVwF1mc45vm0jsIxrSbGL3SdPM+HZG8m3foLHUTUGdgIha8XXPMCwTA6 55UvDj7MwWJc/HiuLHt02Xw3w3N872whmC/9YCcxAYc/LWV7MyV2hVd0nrEO/78QOMUl qFG9O+WsHICRv/xwQp+jOrOgmERlmzLMB24DyANEwiB8ztt0LXpnn7gPyKh62YNUA4ai yC7MQJCEYjnalpf9sH6t/z7tPTiaLRRL/4Szl8IewJv4FhgQ93XCCWM/8gU9XIU9dg4i CWtA== X-Gm-Message-State: AOAM533IYJmN6zELrqTzrenCLRWTtEl7xh/PJoFU6WUURIDp0IvygKrM hwU/JwKp+q+gKQOtrYeWAnZDrQ== X-Google-Smtp-Source: ABdhPJw+GP4WS34hwL4gQauEv237uS6ktrLyKY/fW4m6lMkebk4mYHRo5HNlq3ZCKqvUma0tygKXwQ== X-Received: by 2002:a17:90a:7c41:: with SMTP id e1mr7090576pjl.9.1643176735794; Tue, 25 Jan 2022 21:58:55 -0800 (PST) Received: from localhost.localdomain (yal.riseup.net. [199.58.83.9]) by smtp.gmail.com with ESMTPSA id qe15sm2068201pjb.47.2022.01.25.21.58.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jan 2022 21:58:55 -0800 (PST) From: Glenn Washburn To: Daniel Kiper , grub-devel@gnu.org, Daniel Axtens Cc: Glenn Washburn Subject: [PATCH] configure: Properly handle MM_DEBUG Date: Tue, 25 Jan 2022 23:55:16 -0600 Message-Id: <20220126055516.790622-1-development@efficientek.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::102b (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=development@efficientek.com; helo=mail-pj1-x102b.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2022 05:59:02 -0000 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 --- 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