From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E7782C433F5 for ; Fri, 21 Jan 2022 17:00:25 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E90F4835B3; Fri, 21 Jan 2022 18:00:23 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.b="KcjFc+Z4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9CCE4835B3; Fri, 21 Jan 2022 18:00:22 +0100 (CET) Received: from smtp-relay-canonical-1.canonical.com (smtp-relay-canonical-1.canonical.com [185.125.188.121]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 254ED832E6 for ; Fri, 21 Jan 2022 18:00:20 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=heinrich.schuchardt@canonical.com Received: from workstation5.fritz.box (ip-088-152-144-107.um26.pools.vodafone-ip.de [88.152.144.107]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id 286493F339; Fri, 21 Jan 2022 17:00:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1642784417; bh=lv2eatI1rSrDD37dawLXTgKtgnnJnhP65Vl1XIA7P3Q=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type; b=KcjFc+Z4XCWdhyaF+02SJSqqB67ReAuYm2RdHAvPsdFTx7GQPypSzZNiGFCz1cbOX 6wx1Xj87gzuy8lzJnXis1BC4Ytm0ooS0bJ5i0RcBU0t5/QTUN8LS/ZLgNdUXVGnhv0 a8UrVc55spgB4dixX9gIaW+k6pBOh1RFybvmZ/5nconBNN58j7IWtLWcOADjeP3K34 kLrDdhKHGiQpK9y5TJr6MAgty1pMFeNHG3HEV0yigzr5UxlrvmodPSk9E7dP7Zj/Di M3K7EV9T93nvq26nVeUoBJggRgnLLBcyJYFX2v6UKsHCEsMJdXS0jfAcw3sovsFG1G YpLI8RazWYYsg== From: Heinrich Schuchardt To: Simon Glass Cc: u-boot@lists.denx.de, Heinrich Schuchardt , =?UTF-8?q?Milan=20P=20=2E=20Stani=C4=87?= Subject: [PATCH] sandbox: fix build failure with musl and SDL Date: Fri, 21 Jan 2022 18:00:03 +0100 Message-Id: <20220121170003.363500-1-heinrich.schuchardt@canonical.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean 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ć Signed-off-by: Heinrich Schuchardt --- arch/sandbox/Makefile | 7 +++++++ arch/sandbox/cpu/Makefile | 11 ++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/arch/sandbox/Makefile b/arch/sandbox/Makefile index f6cf859f24..0bdd322f12 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))) -c -o $@ $< + +$(obj)/sdl.o: $(src)/sdl.c FORCE + $(call if_changed_dep,cc_sdl.o) diff --git a/arch/sandbox/cpu/Makefile b/arch/sandbox/cpu/Makefile index de7fe7f391..b74c866e56 100644 --- a/arch/sandbox/cpu/Makefile +++ b/arch/sandbox/cpu/Makefile @@ -7,7 +7,7 @@ obj-y := cache.o cpu.o state.o extra-y := start.o os.o -extra-$(CONFIG_SANDBOX_SDL) += sdl.o +extra-$(CONFIG_SANDBOX_SDL) += sdl.o obj-$(CONFIG_SPL_BUILD) += spl.o obj-$(CONFIG_ETH_SANDBOX_RAW) += eth-raw-os.o @@ -19,8 +19,6 @@ cmd_cc_os.o = $(CC) $(filter-out -nostdinc, \ $(obj)/os.o: $(src)/os.c FORCE $(call if_changed_dep,cc_os.o) -$(obj)/sdl.o: $(src)/sdl.c FORCE - $(call if_changed_dep,cc_os.o) # eth-raw-os.c is built in the system env, so needs standard includes # CFLAGS_REMOVE_eth-raw-os.o cannot be used to drop header include path @@ -30,3 +28,10 @@ cmd_cc_eth-raw-os.o = $(CC) $(filter-out -nostdinc, \ $(obj)/eth-raw-os.o: $(src)/eth-raw-os.c FORCE $(call if_changed_dep,cc_eth-raw-os.o) + +# sdl.c fails to build with -fshort-wchar using musl +cmd_cc_sdl.o = $(CC) $(filter-out -nostdinc -fshort-wchar, \ + $(patsubst -I%,-idirafter%,$(c_flags))) -c -o $@ $< + +$(obj)/sdl.o: $(src)/sdl.c FORCE + $(call if_changed_dep,cc_sdl.o) -- 2.33.1