blob: 43173ac32db912316d840226472d11ac4a2a6b6e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
From a4ff7772acf1d983921833aa20ccd7c4d5e59a1c Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex@linutronix.de>
Date: Mon, 6 Mar 2023 15:24:49 +0100
Subject: [PATCH] src/boot/efi/efi-string.c: define wchar_t from __WCHAR_TYPE__
systemd-boot relies on wchar_t being 16 bit, and breaks at build time otherwise.
To set wchar_t to 16 bit it is passing -fshort-wchar to gcc; this has the
desired effect on glibc (which sets wchar_t from __WCHAR_TYPE__) but not on
musl (which hardcodes it to 32 bit).
This patch ensures wchar_t is set from the compiler flags on all systems; note
that systemd-boot is not actually using functions from musl or other libc, just their headers.
Meanwhile upstream has refactored the code to not rely on libc headers at all;
however this will not be backported to v253 and we need a different fix.
Upstream-Status: Inappropriate [fixed differently in trunk according to https://github.com/systemd/systemd/pull/26689]
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
src/boot/efi/efi-string.c | 5 +++++
1 file changed, 5 insertions(+)
--- a/src/boot/efi/efi-string.c
+++ b/src/boot/efi/efi-string.c
@@ -2,7 +2,13 @@
#include <stdbool.h>
#include <stdint.h>
+
+#if SD_BOOT
+typedef __WCHAR_TYPE__ wchar_t;
+#define __DEFINED_wchar_t
+#else
#include <wchar.h>
+#endif
#include "efi-string.h"
|