All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] configure: Fix default -O2 being added when CFLAGS not set
@ 2022-04-09  2:29 Glenn Washburn
  2022-04-11 16:49 ` Robbie Harwood
  0 siblings, 1 reply; 3+ messages in thread
From: Glenn Washburn @ 2022-04-09  2:29 UTC (permalink / raw)
  To: Daniel Kiper, grub-devel; +Cc: 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. A recent commit
ad9ccf660013c208077b1e983d6c824df25ed1cf ("configure: Fix various new
autotools warnings") added AC_USE_SYSTEM_EXTENSIONS, which pulls in the
autoconf CFLAGS check, before we default CFLAGS and thus setting the
autoconf default for CFLAGS. Move the default setting of CFLAGS to before
AC_USE_SYSTEM_EXTENSIONS so that autoconf will see CFLAGS as set and not
give it a default.

CFLAGS is also moved above AC_CONFIG_AUX_DIR, because CFLAGS should be
defaulted to "" as soon as possible to catch any autoconf macros that try
to use some other default. Regardless, this currently has no effect as that
macro does not consider the CFLAGS variable.

Signed-off-by: Glenn Washburn <development@efficientek.com>
---
 configure.ac | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 94653039c1..57fb709451 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,12 +36,12 @@ dnl description of the relationships between them.
 
 AC_INIT([GRUB],[2.11],[bug-grub@gnu.org])
 
-AC_USE_SYSTEM_EXTENSIONS
-AC_CONFIG_AUX_DIR([build-aux])
-
 # We don't want -g -O2 by default in CFLAGS
 : ${CFLAGS=""}
 
+AC_USE_SYSTEM_EXTENSIONS
+AC_CONFIG_AUX_DIR([build-aux])
+
 # Checks for build, host and target systems.
 AC_CANONICAL_BUILD
 AC_CANONICAL_HOST
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] configure: Fix default -O2 being added when CFLAGS not set
  2022-04-09  2:29 [PATCH v3] configure: Fix default -O2 being added when CFLAGS not set Glenn Washburn
@ 2022-04-11 16:49 ` Robbie Harwood
  2022-04-14 15:10   ` Daniel Kiper
  0 siblings, 1 reply; 3+ messages in thread
From: Robbie Harwood @ 2022-04-11 16:49 UTC (permalink / raw)
  To: Glenn Washburn, Daniel Kiper, grub-devel; +Cc: Glenn Washburn

[-- Attachment #1: Type: text/plain, Size: 1005 bytes --]

Glenn Washburn <development@efficientek.com> writes:

> Autoconf will set a default CFLAGS of "-g -O2" if CFLAGS is not set. CFLAGS
> was defaulted to "" early in configure to prevent this. A recent commit
> ad9ccf660013c208077b1e983d6c824df25ed1cf ("configure: Fix various new
> autotools warnings") added AC_USE_SYSTEM_EXTENSIONS, which pulls in the
> autoconf CFLAGS check, before we default CFLAGS and thus setting the
> autoconf default for CFLAGS. Move the default setting of CFLAGS to before
> AC_USE_SYSTEM_EXTENSIONS so that autoconf will see CFLAGS as set and not
> give it a default.
>
> CFLAGS is also moved above AC_CONFIG_AUX_DIR, because CFLAGS should be
> defaulted to "" as soon as possible to catch any autoconf macros that try
> to use some other default. Regardless, this currently has no effect as that
> macro does not consider the CFLAGS variable.
>
> Signed-off-by: Glenn Washburn <development@efficientek.com>

Reviewed-by: Robbie Harwood <rharwood@redhat.com>

Be well,
--Robbie

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] configure: Fix default -O2 being added when CFLAGS not set
  2022-04-11 16:49 ` Robbie Harwood
@ 2022-04-14 15:10   ` Daniel Kiper
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Kiper @ 2022-04-14 15:10 UTC (permalink / raw)
  To: Robbie Harwood; +Cc: Glenn Washburn, grub-devel

On Mon, Apr 11, 2022 at 12:49:01PM -0400, Robbie Harwood wrote:
> Glenn Washburn <development@efficientek.com> writes:
>
> > Autoconf will set a default CFLAGS of "-g -O2" if CFLAGS is not set. CFLAGS
> > was defaulted to "" early in configure to prevent this. A recent commit
> > ad9ccf660013c208077b1e983d6c824df25ed1cf ("configure: Fix various new
> > autotools warnings") added AC_USE_SYSTEM_EXTENSIONS, which pulls in the
> > autoconf CFLAGS check, before we default CFLAGS and thus setting the
> > autoconf default for CFLAGS. Move the default setting of CFLAGS to before
> > AC_USE_SYSTEM_EXTENSIONS so that autoconf will see CFLAGS as set and not
> > give it a default.
> >
> > CFLAGS is also moved above AC_CONFIG_AUX_DIR, because CFLAGS should be
> > defaulted to "" as soon as possible to catch any autoconf macros that try
> > to use some other default. Regardless, this currently has no effect as that
> > macro does not consider the CFLAGS variable.
> >
> > Signed-off-by: Glenn Washburn <development@efficientek.com>
>
> Reviewed-by: Robbie Harwood <rharwood@redhat.com>

Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Daniel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-14 15:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-09  2:29 [PATCH v3] configure: Fix default -O2 being added when CFLAGS not set Glenn Washburn
2022-04-11 16:49 ` Robbie Harwood
2022-04-14 15:10   ` Daniel Kiper

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.