diff options
author | Nicolas Iooss | 2021-03-14 12:06:50 +0100 |
---|---|---|
committer | Nicolas Iooss | 2021-03-14 16:30:28 +0100 |
commit | ad77fca24af2b712e13e900ed9ae0a12f35069cd (patch) | |
tree | 1b9308e4feccbf80e7e70e071003c4aa395adef2 | |
parent | df26a7dedbaea5d1f206796dbdafb5f885154e71 (diff) | |
download | aur-ad77fca24af2b712e13e900ed9ae0a12f35069cd.tar.gz |
systemd-selinux: fix build with gnu-efi 3.0.13-1
gnu-efi 3.0.13 broken systemd build (cf.
https://github.com/fishilico/arch-selinux/runs/2105907768).
cc -c ../systemd-stable/src/boot/efi/console.c -o src/boot/efi/console.c.o
-Wall -Wextra -std=gnu90 -nostdinc -fpic -fshort-wchar -ffreestanding
-fno-strict-aliasing -fno-stack-protector -Wsign-compare
-Wno-missing-field-initializers -isystem /usr/include/efi -isystem
/usr/include/efi/x86_64 -include src/boot/efi/efi_config.h -include
version.h -mno-red-zone -mno-sse -mno-mmx -DEFI_FUNCTION_WRAPPER
-DGNU_EFI_USE_MS_ABI -O2
../systemd-stable/src/boot/efi/console.c:12: warning:
"EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID" redefined
12 | #define EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID \
|
In file included from /usr/include/efi/efi.h:63,
from ../systemd-stable/src/boot/efi/console.c:3:
/usr/include/efi/eficonex.h:22: note: this is the location of the
previous definition
22 | #define EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID \
|
../systemd-stable/src/boot/efi/console.c:27:3: error: conflicting
types for ‘EFI_KEY_STATE’
27 | } EFI_KEY_STATE;
| ^~~~~~~~~~~~~
In file included from /usr/include/efi/efi.h:63,
from ../systemd-stable/src/boot/efi/console.c:3:
/usr/include/efi/eficonex.h:32:3: note: previous declaration of
‘EFI_KEY_STATE’ was here
32 | } EFI_KEY_STATE;
| ^~~~~~~~~~~~~
This was reported and fixed in systemd in
https://github.com/systemd/systemd/pull/18987, but not backported in
systemd-stable.
Create a patch in order to build system on systems with gnu-efi 3.0.13.
Do not bump pkgrel as the runtime dependencies did not change.
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | 0002-PR-18987-boot-Move-console-declarations-to-missing_efi.h.patch | 216 | ||||
-rw-r--r-- | PKGBUILD | 6 |
3 files changed, 224 insertions, 0 deletions
@@ -42,6 +42,7 @@ pkgbase = systemd-selinux source = git+https://github.com/systemd/systemd-stable#tag=5ca6cc7f6e95bd98bb014126040d4a5fae541511?signed source = git+https://github.com/systemd/systemd#tag=v247?signed source = 0001-Use-Arch-Linux-device-access-groups.patch + source = 0002-PR-18987-boot-Move-console-declarations-to-missing_efi.h.patch source = initcpio-hook-udev source = initcpio-install-systemd source = initcpio-install-udev @@ -64,6 +65,7 @@ pkgbase = systemd-selinux sha512sums = SKIP sha512sums = SKIP sha512sums = e38c7c422c82953f9c2476a5ab8009d614cbec839e4088bff5db7698ddc84e3d8ed64f32ed323f57b1913c5c9703546f794996cb415ed7cdda930b627962a3c4 + sha512sums = 235e7f48e7e76cfa87f5e31022df17a18600055ede0aa173e8274042ebac463e27a4693aba7aa0b48e774e01af34ad497cdbcfaed17e71c702e3ff41832ecabd sha512sums = f0d933e8c6064ed830dec54049b0a01e27be87203208f6ae982f10fb4eddc7258cb2919d594cbfb9a33e74c3510cfd682f3416ba8e804387ab87d1a217eb4b73 sha512sums = 8e76f8334b95ce7fee9190f4a1016b16109f3a75b68635fc227b2b4791cf8179ef09b532b66b4ed885ddf98ed76befed3106f3c3088f1819ed8cdf4c13e0805a sha512sums = a25b28af2e8c516c3a2eec4e64b8c7f70c21f974af4a955a4a9d45fd3e3ff0d2a98b4419fe425d47152d5acae77d64e69d8d014a7209524b75a81b0edb10bf3a diff --git a/0002-PR-18987-boot-Move-console-declarations-to-missing_efi.h.patch b/0002-PR-18987-boot-Move-console-declarations-to-missing_efi.h.patch new file mode 100644 index 000000000000..6d2810500338 --- /dev/null +++ b/0002-PR-18987-boot-Move-console-declarations-to-missing_efi.h.patch @@ -0,0 +1,216 @@ +From 7d2ebb6f85cdeb0c4ddcdf08004f0547cad5cfe9 Mon Sep 17 00:00:00 2001 +From: Daan De Meyer <daan.j.demeyer@gmail.com> +Date: Sat, 30 Jan 2021 23:10:13 +0000 +Subject: [PATCH] boot: Turn all guid constants into C99 compound initializers + +Avoids having to use the address operator all the time and +avoids having to cast or do other unintuitive stuff. + +[ Patch truncated to backport changes to src/boot/efi/console.c only] + +diff --git a/src/boot/efi/console.c b/src/boot/efi/console.c +index 2dd4543d515..e3de27fee5c 100644 +--- a/src/boot/efi/console.c ++++ b/src/boot/efi/console.c +@@ -9,8 +9,8 @@ + #define SYSTEM_FONT_WIDTH 8 + #define SYSTEM_FONT_HEIGHT 19 + +-#define EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID \ +- { 0xdd9e7534, 0x7762, 0x4698, { 0x8c, 0x14, 0xf5, 0x85, 0x17, 0xa6, 0x25, 0xaa } } ++#define EFI_SIMPLE_TEXT_INPUT_EX_GUID \ ++ &(EFI_GUID) { 0xdd9e7534, 0x7762, 0x4698, { 0x8c, 0x14, 0xf5, 0x85, 0x17, 0xa6, 0x25, 0xaa } } + + struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL; + +@@ -67,7 +67,6 @@ typedef struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL { + } EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL; + + EFI_STATUS console_key_read(UINT64 *key, BOOLEAN wait) { +- EFI_GUID EfiSimpleTextInputExProtocolGuid = EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID; + static EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *TextInputEx; + static BOOLEAN checked; + UINTN index; +@@ -75,7 +74,7 @@ EFI_STATUS console_key_read(UINT64 *key, BOOLEAN wait) { + EFI_STATUS err; + + if (!checked) { +- err = LibLocateProtocol(&EfiSimpleTextInputExProtocolGuid, (VOID **)&TextInputEx); ++ err = LibLocateProtocol(EFI_SIMPLE_TEXT_INPUT_EX_GUID, (VOID **)&TextInputEx); + if (EFI_ERROR(err)) + TextInputEx = NULL; + +From 252bcf48f31c1ea7aa8dfbd51a353e2a1eddc94c Mon Sep 17 00:00:00 2001 +From: Daan De Meyer <daan.j.demeyer@gmail.com> +Date: Fri, 12 Mar 2021 22:09:44 +0000 +Subject: [PATCH] boot: Move console declarations to missing_efi.h + +These were added to eficonex.h in gnu-efi 3.0.13. Let's move them +to missing_efi.h behind an appropriate guard to fix the build with +recent versions of gnu-efi. +--- + src/boot/efi/console.c | 57 +------------------------------- + src/boot/efi/console.h | 6 +--- + src/boot/efi/missing_efi.h | 67 ++++++++++++++++++++++++++++++++++++++ + 3 files changed, 69 insertions(+), 61 deletions(-) + +diff --git a/src/boot/efi/console.c b/src/boot/efi/console.c +index e3de27fee5c..83619d2147f 100644 +--- a/src/boot/efi/console.c ++++ b/src/boot/efi/console.c +@@ -9,62 +9,7 @@ + #define SYSTEM_FONT_WIDTH 8 + #define SYSTEM_FONT_HEIGHT 19 + +-#define EFI_SIMPLE_TEXT_INPUT_EX_GUID \ +- &(EFI_GUID) { 0xdd9e7534, 0x7762, 0x4698, { 0x8c, 0x14, 0xf5, 0x85, 0x17, 0xa6, 0x25, 0xaa } } +- +-struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL; +- +-typedef EFI_STATUS (EFIAPI *EFI_INPUT_RESET_EX)( +- struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, +- BOOLEAN ExtendedVerification +-); +- +-typedef UINT8 EFI_KEY_TOGGLE_STATE; +- +-typedef struct { +- UINT32 KeyShiftState; +- EFI_KEY_TOGGLE_STATE KeyToggleState; +-} EFI_KEY_STATE; +- +-typedef struct { +- EFI_INPUT_KEY Key; +- EFI_KEY_STATE KeyState; +-} EFI_KEY_DATA; +- +-typedef EFI_STATUS (EFIAPI *EFI_INPUT_READ_KEY_EX)( +- struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, +- EFI_KEY_DATA *KeyData +-); +- +-typedef EFI_STATUS (EFIAPI *EFI_SET_STATE)( +- struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, +- EFI_KEY_TOGGLE_STATE *KeyToggleState +-); +- +-typedef EFI_STATUS (EFIAPI *EFI_KEY_NOTIFY_FUNCTION)( +- EFI_KEY_DATA *KeyData +-); +- +-typedef EFI_STATUS (EFIAPI *EFI_REGISTER_KEYSTROKE_NOTIFY)( +- struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, +- EFI_KEY_DATA KeyData, +- EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction, +- VOID **NotifyHandle +-); +- +-typedef EFI_STATUS (EFIAPI *EFI_UNREGISTER_KEYSTROKE_NOTIFY)( +- struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, +- VOID *NotificationHandle +-); +- +-typedef struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL { +- EFI_INPUT_RESET_EX Reset; +- EFI_INPUT_READ_KEY_EX ReadKeyStrokeEx; +- EFI_EVENT WaitForKeyEx; +- EFI_SET_STATE SetState; +- EFI_REGISTER_KEYSTROKE_NOTIFY RegisterKeyNotify; +- EFI_UNREGISTER_KEYSTROKE_NOTIFY UnregisterKeyNotify; +-} EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL; ++#define EFI_SIMPLE_TEXT_INPUT_EX_GUID &(EFI_GUID) EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID + + EFI_STATUS console_key_read(UINT64 *key, BOOLEAN wait) { + static EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *TextInputEx; +diff --git a/src/boot/efi/console.h b/src/boot/efi/console.h +index 41df3a406e0..2c69af552a6 100644 +--- a/src/boot/efi/console.h ++++ b/src/boot/efi/console.h +@@ -1,11 +1,7 @@ + /* SPDX-License-Identifier: LGPL-2.1-or-later */ + #pragma once + +-#define EFI_SHIFT_STATE_VALID 0x80000000 +-#define EFI_RIGHT_CONTROL_PRESSED 0x00000004 +-#define EFI_LEFT_CONTROL_PRESSED 0x00000008 +-#define EFI_RIGHT_ALT_PRESSED 0x00000010 +-#define EFI_LEFT_ALT_PRESSED 0x00000020 ++#include "missing_efi.h" + + #define EFI_CONTROL_PRESSED (EFI_RIGHT_CONTROL_PRESSED|EFI_LEFT_CONTROL_PRESSED) + #define EFI_ALT_PRESSED (EFI_RIGHT_ALT_PRESSED|EFI_LEFT_ALT_PRESSED) +diff --git a/src/boot/efi/missing_efi.h b/src/boot/efi/missing_efi.h +index 1b838af2a4e..b983931348b 100644 +--- a/src/boot/efi/missing_efi.h ++++ b/src/boot/efi/missing_efi.h +@@ -53,3 +53,70 @@ typedef struct _EFI_RNG_PROTOCOL { + } EFI_RNG_PROTOCOL; + + #endif ++ ++#ifndef EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID ++ ++#define EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID \ ++ { 0xdd9e7534, 0x7762, 0x4698, {0x8c, 0x14, 0xf5, 0x85, 0x17, 0xa6, 0x25, 0xaa} } ++ ++#define EFI_SHIFT_STATE_VALID 0x80000000 ++#define EFI_RIGHT_CONTROL_PRESSED 0x00000004 ++#define EFI_LEFT_CONTROL_PRESSED 0x00000008 ++#define EFI_RIGHT_ALT_PRESSED 0x00000010 ++#define EFI_LEFT_ALT_PRESSED 0x00000020 ++ ++struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL; ++ ++typedef EFI_STATUS (EFIAPI *EFI_INPUT_RESET_EX)( ++ struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, ++ BOOLEAN ExtendedVerification ++); ++ ++typedef UINT8 EFI_KEY_TOGGLE_STATE; ++ ++typedef struct { ++ UINT32 KeyShiftState; ++ EFI_KEY_TOGGLE_STATE KeyToggleState; ++} EFI_KEY_STATE; ++ ++typedef struct { ++ EFI_INPUT_KEY Key; ++ EFI_KEY_STATE KeyState; ++} EFI_KEY_DATA; ++ ++typedef EFI_STATUS (EFIAPI *EFI_INPUT_READ_KEY_EX)( ++ struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, ++ EFI_KEY_DATA *KeyData ++); ++ ++typedef EFI_STATUS (EFIAPI *EFI_SET_STATE)( ++ struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, ++ EFI_KEY_TOGGLE_STATE *KeyToggleState ++); ++ ++typedef EFI_STATUS (EFIAPI *EFI_KEY_NOTIFY_FUNCTION)( ++ EFI_KEY_DATA *KeyData ++); ++ ++typedef EFI_STATUS (EFIAPI *EFI_REGISTER_KEYSTROKE_NOTIFY)( ++ struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, ++ EFI_KEY_DATA KeyData, ++ EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction, ++ VOID **NotifyHandle ++); ++ ++typedef EFI_STATUS (EFIAPI *EFI_UNREGISTER_KEYSTROKE_NOTIFY)( ++ struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, ++ VOID *NotificationHandle ++); ++ ++typedef struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL { ++ EFI_INPUT_RESET_EX Reset; ++ EFI_INPUT_READ_KEY_EX ReadKeyStrokeEx; ++ EFI_EVENT WaitForKeyEx; ++ EFI_SET_STATE SetState; ++ EFI_REGISTER_KEYSTROKE_NOTIFY RegisterKeyNotify; ++ EFI_UNREGISTER_KEYSTROKE_NOTIFY UnregisterKeyNotify; ++} EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL; ++ ++#endif @@ -38,6 +38,7 @@ validpgpkeys=('63CDA1E5D3FC22B998D20DD6327F26951A015CC4' # Lennart Poettering < source=("git+https://github.com/systemd/systemd-stable#tag=${_tag}?signed" "git+https://github.com/systemd/systemd#tag=v${pkgver%.*}?signed" '0001-Use-Arch-Linux-device-access-groups.patch' + '0002-PR-18987-boot-Move-console-declarations-to-missing_efi.h.patch' 'initcpio-hook-udev' 'initcpio-install-systemd' 'initcpio-install-udev' @@ -58,6 +59,7 @@ source=("git+https://github.com/systemd/systemd-stable#tag=${_tag}?signed" sha512sums=('SKIP' 'SKIP' 'e38c7c422c82953f9c2476a5ab8009d614cbec839e4088bff5db7698ddc84e3d8ed64f32ed323f57b1913c5c9703546f794996cb415ed7cdda930b627962a3c4' + '235e7f48e7e76cfa87f5e31022df17a18600055ede0aa173e8274042ebac463e27a4693aba7aa0b48e774e01af34ad497cdbcfaed17e71c702e3ff41832ecabd' 'f0d933e8c6064ed830dec54049b0a01e27be87203208f6ae982f10fb4eddc7258cb2919d594cbfb9a33e74c3510cfd682f3416ba8e804387ab87d1a217eb4b73' '8e76f8334b95ce7fee9190f4a1016b16109f3a75b68635fc227b2b4791cf8179ef09b532b66b4ed885ddf98ed76befed3106f3c3088f1819ed8cdf4c13e0805a' 'a25b28af2e8c516c3a2eec4e64b8c7f70c21f974af4a955a4a9d45fd3e3ff0d2a98b4419fe425d47152d5acae77d64e69d8d014a7209524b75a81b0edb10bf3a' @@ -100,6 +102,10 @@ prepare() { # Replace cdrom/dialout/tape groups with optical/uucp/storage patch -Np1 -i ../0001-Use-Arch-Linux-device-access-groups.patch + + # Fix build with gnu-efi 3.0.13 + # https://github.com/systemd/systemd/pull/18987 + patch -Np1 -i ../0002-PR-18987-boot-Move-console-declarations-to-missing_efi.h.patch } build() { |