From 1d3ebb0be61db5f464423f84c7ed97fafce44dc3 Mon Sep 17 00:00:00 2001 From: Ophidiophobia Date: Sun, 4 Jul 2021 19:04:01 +0200 Subject: [PATCH] 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] --- srcpkgs/grub/template | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/srcpkgs/grub/template b/srcpkgs/grub/template index bf10fc66348..b1826c38a88 100644 --- a/srcpkgs/grub/template +++ b/srcpkgs/grub/template @@ -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"