From 2fb11652381c199ad19bb469e530543366d99dd4 Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Sat, 6 Aug 2022 09:07:47 +0200 Subject: [PATCH] boot: Build with at least -O1 as workaround Fixes: #24202 --- src/boot/efi/meson.build | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build index 83f7384530b..127b4e17a3a 100644 --- a/src/boot/efi/meson.build +++ b/src/boot/efi/meson.build @@ -199,6 +199,12 @@ efi_cflags = [ ] ) +# On some distros, sd-boot/-stub may trigger some bug somewhere that will cause +# kernel execution to fail. The cause seems to be purely based on code size and +# always compiling with at least -O1 will work around that. +# https://github.com/systemd/systemd/issues/24202 +efi_cflags += '-O1' + efi_cflags += cc.get_supported_arguments({ 'ia32': ['-mno-sse', '-mno-mmx'], 'x86_64': ['-mno-red-zone', '-mno-sse', '-mno-mmx'], -- 2.47.3