grub: build with -Os instead of -O2.

Fixes being stuck at "GRUB loading." when booting through legacy BIOS.

Upstream bug: https://savannah.gnu.org/bugs/?60458
Related discussion: https://www.linuxquestions.org/questions/showthread.php?p=6257712

Closes: #31795 [via git-merge-pr]
This commit is contained in:
Ophidiophobia 2021-07-04 19:04:01 +02:00 committed by Érico Nogueira
parent 7fe28ebf98
commit 1d3ebb0be6

View file

@ -1,7 +1,7 @@
# Template file for 'grub'
pkgname=grub
version=2.06
revision=1
revision=2
hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf help2man"
makedepends="libusb-compat-devel ncurses-devel freetype-devel
liblzma-devel device-mapper-devel fuse-devel"
@ -44,6 +44,13 @@ case "$XBPS_TARGET_MACHINE" in
esac
do_configure() {
# workaround for https://savannah.gnu.org/bugs/?60458
# some more info: https://www.linuxquestions.org/questions/showthread.php?p=6257712
# grub 2.06 reboots immediately when compiled with -O2,
# only affects legacy BIOS
export CFLAGS="${CFLAGS/-O2/-Os}"
export CXXFLAGS="${CXXFLAGS/-O2/-Os}"
unset CC AS LD RANLIB CPP
local freestanding_cflags="-fno-stack-protector"