From ad07bcbb0299dd8057178b3cf86c3c45fc347bcb Mon Sep 17 00:00:00 2001 From: Ophidiophobia Date: Sun, 4 Jul 2021 19:04:01 +0200 Subject: [PATCH] grub: compile with -Os Avoids being stuck at "GRUB loading." when booting through legacy BIOS --- srcpkgs/grub/template | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/srcpkgs/grub/template b/srcpkgs/grub/template index bf10fc663483..d9680429250b 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 effects legacy BIOS + export CFLAGS="${CFLAGS/-O2/-Os}" + export CXXFLAGS="${CXXFLAGS/-O2/-Os}" + unset CC AS LD RANLIB CPP local freestanding_cflags="-fno-stack-protector"