mirror of
https://github.com/morgan9e/systemd
synced 2026-04-15 00:47:10 +09:00
musl: meson: make musl not define wchar_t in their header
Otherwise, musl defines wchar_t as int, which conflicts with the
assumption by sd-boot, i.e. wchar_t is 2 bytes.
Fixes the following build error:
```
In file included from ../src/boot/efi-log.h:4,
from ../src/boot/linux_x86.c:13:
../src/boot/efi.h:19:24: error: conflicting types for 'wchar_t'; have 'short unsigned int'
19 | typedef __WCHAR_TYPE__ wchar_t;
| ^~~~~~~
In file included from /usr/include/stddef.h:19,
from ../src/boot/efi.h:9:
/usr/include/bits/alltypes.h:10:13: note: previous declaration of 'wchar_t' with type 'wchar_t' {aka 'int'}
10 | typedef int wchar_t;
| ^~~~~~~
```
This commit is contained in:
@@ -182,6 +182,11 @@ if get_option('mode') == 'developer' and get_option('debug')
|
||||
efi_c_args += '-DEFI_DEBUG'
|
||||
endif
|
||||
|
||||
if get_option('libc') == 'musl'
|
||||
# To make musl not define wchar_t as int, rather than short.
|
||||
efi_c_args += '-D__DEFINED_wchar_t'
|
||||
endif
|
||||
|
||||
efi_c_ld_args = [
|
||||
'-nostdlib',
|
||||
'-static-pie',
|
||||
|
||||
Reference in New Issue
Block a user