All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Hilse <andreas.hilse@googlemail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [Bug 13586] New: grub failure with BR2_OPTIMIZE_3
Date: Mon, 31 May 2021 12:22:28 +0200	[thread overview]
Message-ID: <CANabuZdQQTsX5Qfz24ukPUfufw-jPVipLuOJD-QJF+K6ywV7+A@mail.gmail.com> (raw)
In-Reply-To: <20210528214255.GK2788252@scaer>

Hi,

> So, maybe things have changed from way back when we wrote that comment
> (back in 2014, seven years ago!), or maybe we did not undestand all of
> it, or maybe we did not explain it properly, or a bit of all of that...
>
> In any case, we might want to also override CFLAGS and CPPFLAGS in the
> same vein as the above patch does for TARGET_CFLAGS et al.
>
> Care to have a look at that, see if it fixes the issue, and you can get
> a bootable grub2, please?

Additionally overriding CFLAGS and CPPFLAGS results in a bootable grub2.

diff --git a/boot/grub2/grub2.mk b/boot/grub2/grub2.mk
index af16ee91e1..52e9199ae9 100644
--- a/boot/grub2/grub2.mk
+++ b/boot/grub2/grub2.mk
@@ -118,9 +118,11 @@ HOST_GRUB2_CONF_ENV = \
 GRUB2_CONF_ENV = \
        CPP="$(TARGET_CC) -E" \
        TARGET_CC="$(TARGET_CC)" \
-       TARGET_CFLAGS="$(TARGET_CFLAGS)" \
-       TARGET_CPPFLAGS="$(TARGET_CPPFLAGS) -fno-stack-protector" \
-       TARGET_LDFLAGS="$(TARGET_LDFLAGS)" \
+       CFLAGS="$(TARGET_CFLAGS) -Os" \
+       TARGET_CFLAGS="$(TARGET_CFLAGS) -Os" \
+       CPPFLAGS="$(TARGET_CPPFLAGS) -Os -fno-stack-protector" \
+       TARGET_CPPFLAGS="$(TARGET_CPPFLAGS) -Os -fno-stack-protector" \
+       TARGET_LDFLAGS="$(TARGET_LDFLAGS) -Os" \
        TARGET_NM="$(TARGET_NM)" \
        TARGET_OBJCOPY="$(TARGET_OBJCOPY)" \
        TARGET_STRIP="$(TARGET_CROSS)strip"

Best regards
Andreas

  reply	other threads:[~2021-05-31 10:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-07 21:46 [Buildroot] [Bug 13586] New: grub failure with BR2_OPTIMIZE_3 bugzilla at busybox.net
2021-05-27 15:33 ` Andreas Hilse
2021-05-27 15:44   ` Yann E. MORIN
2021-05-27 16:28     ` David Laight
2021-05-27 20:37       ` Yann E. MORIN
2021-05-28 13:48         ` Andreas Hilse
2021-05-28 21:42           ` Yann E. MORIN
2021-05-31 10:22             ` Andreas Hilse [this message]
2021-06-04 20:52               ` Yann E. MORIN
2021-06-02 20:33 ` [Buildroot] [Bug 13586] " bugzilla at busybox.net

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=CANabuZdQQTsX5Qfz24ukPUfufw-jPVipLuOJD-QJF+K6ywV7+A@mail.gmail.com \
    --to=andreas.hilse@googlemail.com \
    --cc=buildroot@busybox.net \
    /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.