boot/grub2: workaround breakage with -O2, -O3 build
authorAndreas Hilse <andreas.hilse@googlemail.com>
Fri, 25 Jun 2021 11:42:51 +0000 (13:42 +0200)
committerYann E. MORIN <yann.morin.1998@free.fr>
Wed, 30 Jun 2021 21:37:01 +0000 (23:37 +0200)
commit7cb51d4843caaa9144270d92f86e60d8b5a2a1ec
tree8fe9f9a13616fb8880b1e4a8d717e1ca04479f73
parent95c09d121987ef3503beacc088d2b21f8566f1f4
boot/grub2: workaround breakage with -O2, -O3 build

When grub2 (i386-pc) is built with -O2 or -O3 it is unable to boot
and the system will reboot in a loop.

Tony Battersby has bisected [0] the error down to this security bugfix:
boot/grub2/0132-kern-parser-Fix-a-stack-buffer-overflow.patch
There is also a bug report by Peter Seiderer about this [1].

As discussed on the mailing list [2], this patch introduces a workaround
in the grub2.mk overriding the global optimization settings with -Os
which results in a booting system.

References:
[0] https://savannah.gnu.org/bugs/?60458
[1] https://bugs.busybox.net/show_bug.cgi?id=13586
[2] http://lists.busybox.net/pipermail/buildroot/2021-May/311524.html

Signed-off-by: Andreas Hilse <andreas.hilse@googlemail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
boot/grub2/grub2.mk