[Buildroot] [git commit branch/2024.11.x] package/gnu-efi: fix build due to short-wchar

Peter Korsgaard peter at korsgaard.com
Fri Jan 31 16:21:44 UTC 2025


commit: https://git.buildroot.net/buildroot/commit/?id=279673a33780296a72ade3655ae9e07af8cf8c78
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/2024.11.x

The gnu-efi code base is so far built with -fshort-wchar:

‘-fshort-wchar’
     Override the underlying type for ‘wchar_t’ to be ‘short unsigned
     int’ instead of the default for the target.  This option is useful
     for building programs to run under WINE.

     *Warning:* the ‘-fshort-wchar’ switch causes GCC to generate code
     that is not binary compatible with code generated without that
     switch.  Use it to conform to a non-default application binary
     interface.

However, this is highly incompatible with the definitions of wchar_t
by musl, causing build issues:

/workdir/instance-0/output-1/build/gnu-efi-3.0.18//lib/console.c:84:68: error: passing argument 2 of 'ConOut->OutputString' from incompatible pointer type [-Werror=incompatible-pointer-types]
[...]
/workdir/instance-0/output-1/build/gnu-efi-3.0.18//lib/console.c:84:68: note: expected 'CHAR16 *' {aka 'int *'} but argument is of type 'short unsigned int *'

These have been addressed upstream by simply not using -fshort-wchar
anymore, so we backport the relevant patches.

The patch 0003-Use-char16_t-literals.patch was directly backported, it
was "redone" (it's a very mechanical patch) as backporting the patch
and fixing the conflicts was more effort than redoing the patch from
scratch. But in essence, it is the same patch as what is upstream.

Fixes:

  http://autobuild.buildroot.net/results/8b2f5b38284e70dde8c5619e5050e7f201a0bcc3/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
[Julien: fix patch 0003 EOL modified by the mailing list]
Signed-off-by: Julien Olivain <ju.o at free.fr>
(cherry picked from commit d4fa17f44128929970632e6703a49bc40eb0492f)
Signed-off-by: Peter Korsgaard <peter at korsgaard.com>
---
 .../gnu-efi/0002-Make-CHAR16-use-uint16_t.patch    |  164 ++
 package/gnu-efi/0003-Use-char16_t-literals.patch   | 2103 ++++++++++++++++++++
 2 files changed, 2267 insertions(+)

Patch is too large, so refusing to show it


More information about the buildroot mailing list