From: Chris Coulson Date: Tue, 11 Oct 2022 12:26:33 +0000 (+0100) Subject: efi: Compile kernel.img with -fshort-wchar on all EFI targets X-Git-Tag: grub-2.12-rc1~250 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62149e090f5212af8205d28eabcbf5a59d7f0b2d;p=thirdparty%2Fgrub.git efi: Compile kernel.img with -fshort-wchar on all EFI targets The stack check logs a console message on failure, and the EFI API expects a NULL terminated UCS-2 string. In order to define a UCS-2 string literal, kernel.img on amd64 and i386 EFI targets is built with -fshort-wchar. Also compile kernel.img on other EFI targets with -fshort-wchar. Fixes: 37ddd94 (kern/efi/init: Log a console error during a stack check failure) Reported-by: Glenn Washburn Signed-off-by: Chris Coulson Reviewed-by: Daniel Kiper --- diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def index 5212dfab1..98714c68d 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -61,15 +61,19 @@ kernel = { ia64_efi_ldflags = '-Wl,-r'; ia64_efi_stripflags = '--strip-unneeded -K start -R .note -R .comment -R .note.gnu.gold-version'; + arm_efi_cflags = '-fshort-wchar'; arm_efi_ldflags = '-Wl,-r'; arm_efi_stripflags = '--strip-unneeded -K start -R .note -R .comment -R .note.gnu.gold-version'; + arm64_efi_cflags = '-fshort-wchar'; arm64_efi_ldflags = '-Wl,-r'; arm64_efi_stripflags = '--strip-unneeded -K start -R .note -R .comment -R .note.gnu.gold-version -R .eh_frame'; + riscv32_efi_cflags = '-fshort-wchar'; riscv32_efi_ldflags = '-Wl,-r'; riscv32_efi_stripflags = '--strip-unneeded -K start -R .note -R .comment -R .note.gnu.gold-version -R .eh_frame'; + riscv64_efi_cflags = '-fshort-wchar'; riscv64_efi_ldflags = '-Wl,-r'; riscv64_efi_stripflags = '--strip-unneeded -K start -R .note -R .comment -R .note.gnu.gold-version -R .eh_frame';