Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1nK2hS-0006XY-2p for mharc-grub-devel@gnu.org; Tue, 15 Feb 2022 13:37:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57006) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nK2hP-0006Tt-Ns for grub-devel@gnu.org; Tue, 15 Feb 2022 13:37:15 -0500 Received: from [2607:f8b0:4864:20::82e] (port=36661 helo=mail-qt1-x82e.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nK2hN-0006vC-HC for grub-devel@gnu.org; Tue, 15 Feb 2022 13:37:15 -0500 Received: by mail-qt1-x82e.google.com with SMTP id z1so19471246qto.3 for ; Tue, 15 Feb 2022 10:37:04 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=iNRJ5oc6VZLS2RtAtcttaI64Iv6fsVKLcxE4PSXYO/Y=; b=AbJhkUjcOhTK7VZ/97GyxoWrhOqAM1U3JfoQ95GW1C37qPubZXOuSZ/7IA3A5lmPqN oh3J0PQW3Qlm0A9H5cY7uv1ZnIat7nYOfWs8pgWggjJ2YNLP/CeWP4OMN/r0g/FQmHpA 67bYhVP+DzMXljxeBAPBi4sfVAjer4RqXQVjX23hm1UxmhH+K6jTPzk4KCpcDdZUWp6Z C9ARAvOtCKAmEJxYHvF8dqJ2cWn+67BIboGa37SNdWni2dTUPyY3nRb9GNj8OgzHLFWf Dzr7HkXPbH64m3zJCI5ucnvbpNlMuNr5zcDHc3drcDOHbU5bdAcG3tgmm9YjbHBYxG+K mmEA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=iNRJ5oc6VZLS2RtAtcttaI64Iv6fsVKLcxE4PSXYO/Y=; b=A6xdgYIUw4aMnigP92Dti3pnlE50C3IueL2T4xtxh4nHr6f7qiatnORUHYalmxIzXP S4pU7u99w5JnrH0SujF90qitKCJ8OarRFzysUHNf/bgz3HkpszNJ2kglH40PQaOp9Grk niBKTURfUnEDk6oAVOpO6j2R2p/cWbGNnhYmHUrhzgcntmmw5FLwtRwtzN/xorsHnA2Z 7G4pdA3D+EXaaXACj2PKfhDwjvCgWhHJ83RaS41iDI7x6iNA0GuiuD4exa4brb9OD4t3 wEEMDBRzN8DGdgSmTVDXmhWh6yaV9KbQifRSev7qh8zvY0s+rY73yTWvkoWSekVOo2KE GA2A== X-Gm-Message-State: AOAM532mdX3WJM97lMT7jleAynxn/AewsLoXwPOHOmK7R7RVcUjWZ9Ap Cf9fERWUl67jPfh5xHRvhWyZ7Zw6QfqcFA== X-Google-Smtp-Source: ABdhPJzaHWtaLXa4Fp/j87cxe2qhplNy0w5/BhuUTX7aWQv/s/vuV4Zb3WA2a9ppaoyHC6GK5Y9Y3w== X-Received: by 2002:a05:622a:95:: with SMTP id o21mr343367qtw.684.1644950223048; Tue, 15 Feb 2022 10:37:03 -0800 (PST) Received: from localhost.localdomain (garza.riseup.net. [198.252.153.109]) by smtp.gmail.com with ESMTPSA id w10sm21320714qtj.73.2022.02.15.10.37.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 10:37:02 -0800 (PST) From: Glenn Washburn To: Daniel Kiper , grub-devel@gnu.org Cc: Glenn Washburn Subject: [PATCH 1/3] configure: Properly handle MM_DEBUG Date: Tue, 15 Feb 2022 12:36:41 -0600 Message-Id: <151cdcca9229f5190815bbfe38e5c3ad306a50ba.1644949742.git.development@efficientek.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::82e (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::82e; envelope-from=development@efficientek.com; helo=mail-qt1-x82e.google.com X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.904, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: Tue, 15 Feb 2022 18:37:16 -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 --- config.h.in | 4 ++++ configure.ac | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/config.h.in b/config.h.in index 9e8f9911b1..c1323a88e3 100644 --- a/config.h.in +++ b/config.h.in @@ -9,6 +9,10 @@ #define GCRYPT_NO_DEPRECATED 1 #define HAVE_MEMMOVE 1 +#if @MM_DEBUG@ +#define MM_DEBUG @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 5c01af0fab..65d7f8a3be 100644 --- a/configure.ac +++ b/configure.ac @@ -1519,9 +1519,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