From 1df68ce9e7755a6f862facbd92f1ed823181a6fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Wed, 17 Apr 2024 17:00:08 +0700 Subject: [PATCH] gummiboot: build without -nostdinc gnu-efi-libs needs stddef.h now. It should be ok to be included, even if in -ffreestanding, systemd-boot also dropped -nostdinc. Close: #49859 --- srcpkgs/gummiboot/patches/remove-nostdinc.patch | 14 ++++++++++++++ srcpkgs/gummiboot/patches/stub.patch | 9 ++++----- 2 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 srcpkgs/gummiboot/patches/remove-nostdinc.patch diff --git a/srcpkgs/gummiboot/patches/remove-nostdinc.patch b/srcpkgs/gummiboot/patches/remove-nostdinc.patch new file mode 100644 index 00000000000..e6318fe4aaa --- /dev/null +++ b/srcpkgs/gummiboot/patches/remove-nostdinc.patch @@ -0,0 +1,14 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -86,11 +86,9 @@ efi_cflags = \ + -Wall \ + -Wextra \ + -std=gnu90 \ +- -nostdinc \ + -ggdb -O0 \ + -fpic \ + -fshort-wchar \ +- -nostdinc \ + -ffreestanding \ + -fno-strict-aliasing \ + -fno-stack-protector \ diff --git a/srcpkgs/gummiboot/patches/stub.patch b/srcpkgs/gummiboot/patches/stub.patch index 1b0e3aab400..3d21c70234d 100644 --- a/srcpkgs/gummiboot/patches/stub.patch +++ b/srcpkgs/gummiboot/patches/stub.patch @@ -1,12 +1,11 @@ ---- a/src/efi/stub.c 2015-03-12 00:50:35.000000000 +0100 -+++ b/src/efi/stub.c 2020-07-06 12:32:55.985327487 +0200 -@@ -83,7 +83,7 @@ +--- a/src/efi/stub.c ++++ b/src/efi/stub.c +@@ -83,7 +83,7 @@ EFI_STATUS efi_main(EFI_HANDLE image, EF cmdline_len = szs[0]; - + /* if we are not in secure boot mode, accept a custom command line and replace the built-in one */ - if (!secure && loaded_image->LoadOptionsSize > 0) { + if ((!secure || cmdline_len == 0) && loaded_image->LoadOptionsSize > 0 && *(CHAR16 *)loaded_image->LoadOptions > 0x1F) { CHAR16 *options; CHAR8 *line; UINTN i; -