[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] configure: Fix default -O2 being added when CFLAGS not set

From: Paul Menzel
Subject: Re: [PATCH] configure: Fix default -O2 being added when CFLAGS not set
Date: Fri, 25 Mar 2022 07:53:29 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0

Dear Glenn,

Thank you for your tireless awesome work on GRUB.

Am 24.03.22 um 23:31 schrieb Glenn Washburn:
Autoconf will set a default CFLAGS of "-g -O2" if CFLAGS is not set. CFLAGS
was defaulted to "" early in configure to prevent this. Apparently something
changed in autoconf and now AC_USE_SYSTEM_EXTENSIONS, which is before the
default setting of CFLAGS, will pull in this check. Move the default
setting of CFLAGS to before this so that if will see CFLAGS as set and not
give it a default.

Could you please mention the Autoconf version you use? I guess, it’d be great to know, when this behavior started, so to make sure, that the last X years all the tests were done like this, and reverting the behavior would actually break things (though shouldn’t).

With Debian sid/unstable and GNU Autoconf 2.71 I can reproduce your behavior:

    $ grep '^CFLAGS=' config.log
    CFLAGS='-g -O2'

Signed-off-by: Glenn Washburn <>
--- | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ b/
index 3ffbc7c57b..c1e50c9d75 100644
--- a/
+++ b/
@@ -36,12 +36,12 @@ dnl description of the relationships between them.
  # We don't want -g -O2 by default in CFLAGS
  : ${CFLAGS=""}
  # Checks for build, host and target systems.

Tested-by: Paul Menzel <>

    $ git am … && ./ && ./configure --with-platform=coreboot
    $ grep '^CFLAGS=' config.log

Kind regards,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]