aboutsummaryrefslogtreecommitdiff
path: root/arch/sandbox/Makefile
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2022-01-28 10:08:32 +0100
committerSimon Glass <sjg@chromium.org>2022-02-09 12:26:12 -0700
commitebc87d0dafd4ca7859c3b7d2b38430bc2669ee85 (patch)
tree61cb58c7bee43716d9f252837fb22bd2076fd408 /arch/sandbox/Makefile
parent3609e1dc5f4d4c238dcd23e045ba6223310feffa (diff)
downloadu-boot-ebc87d0dafd4ca7859c3b7d2b38430bc2669ee85.zip
u-boot-ebc87d0dafd4ca7859c3b7d2b38430bc2669ee85.tar.gz
u-boot-ebc87d0dafd4ca7859c3b7d2b38430bc2669ee85.tar.bz2
sandbox: fix build failure with musl and SDL
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@arvanta.net> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/sandbox/Makefile')
-rw-r--r--arch/sandbox/Makefile7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/sandbox/Makefile b/arch/sandbox/Makefile
index f6cf859..a335f8a 100644
--- a/arch/sandbox/Makefile
+++ b/arch/sandbox/Makefile
@@ -4,3 +4,10 @@ head-y := arch/sandbox/cpu/start.o arch/sandbox/cpu/os.o
head-$(CONFIG_SANDBOX_SDL) += arch/sandbox/cpu/sdl.o
libs-y += arch/sandbox/cpu/
libs-y += arch/sandbox/lib/
+
+# sdl.c fails to compile with -fshort-wchar using musl.
+cmd_cc_sdl.o = $(CC) $(filter-out -nostdinc -fshort-wchar, \
+ $(patsubst -I%,-idirafter%,$(c_flags))) -fno-lto -c -o $@ $<
+
+$(obj)/sdl.o: $(src)/sdl.c FORCE
+ $(call if_changed_dep,cc_sdl.o)