[PATCH v2 1/1] sandbox: fix build failure with musl and SDL

Simon Glass sjg at chromium.org
Tue Feb 8 16:16:46 CET 2022


On Sat, 29 Jan 2022 at 07:17, Heinrich Schuchardt
<heinrich.schuchardt at canonical.com> wrote:
>
>
>
> On 1/28/22 10:08, Heinrich Schuchardt wrote:
> > sdl.c is compiled against the SDL library.
> >
> > Trying to redefine wchar_t with -fshort-wchar is not necessary
> > and leads to build failures when compiling against musl.
> >
> > Cc: Milan P. Stanić <mps at arvanta.net>
> > Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
> > ---

Reviewed-by: Simon Glass <sjg at chromium.org>

How do I compile against musl?

Regards,
Simon

> > v2:
> >       fix a build error with clang by adding -fno-lto for building sdl.o
> >
> > A better longterm solution will be to eliminate -fshort-wchar completely.
> > This will require replacing %ls printf() codes by something that gcc does
> > not check, e.g. %pS. Further all L"" strings must be replaced by u""
> > strings.
>
> %p will not work as a replacement for %ls:
>
> warning: precision used with ‘%p’ gnu_printf format [-Wformat=]
>    298 |                 s += sprintf(s, "%-.*ps", slen, fp->str);
>        |                                      ^
>
> Best regards
>
> Heinrich


More information about the U-Boot mailing list