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

Heinrich Schuchardt heinrich.schuchardt at canonical.com
Sat Jan 29 15:16:53 CET 2022



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>
> ---
> 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