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 A542BC4332F for ; Thu, 27 Jan 2022 21:35:39 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0FE24833C2; Thu, 27 Jan 2022 22:35:38 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Xqkke0os"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 91F608349B; Thu, 27 Jan 2022 22:35:33 +0100 (CET) Received: from mail-vs1-xe30.google.com (mail-vs1-xe30.google.com [IPv6:2607:f8b0:4864:20::e30]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7EC3883388 for ; Thu, 27 Jan 2022 22:35:29 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-vs1-xe30.google.com with SMTP id g10so655667vss.1 for ; Thu, 27 Jan 2022 13:35:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=PDb6XtdwD6APd4duuCaTEn3t4qKrOOBlGt+Ly75L2cs=; b=Xqkke0osmVAoHACuGm7yp7fv49RzFCZhRZCHm01eoJC6hxPVTAfwyUXF+vhjBqba1j Yv7NTHWkN27GG/WQlRAjVa3/OY0AhkEVmt9X0hNx65+cR+Blte6zc6bKuocXRDhMg6zk fb8kXB/CnOlUqiwTFIqTGffDZuJcqAaPpG7zA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=PDb6XtdwD6APd4duuCaTEn3t4qKrOOBlGt+Ly75L2cs=; b=7BdhPEE+jrKcteLYndIAQJT6+SysiJhH3JACin2BEoubqPKOBrc2+P+nSSJ3dpi9aO UqeRi8VyWQaoMxr4XNps4ObSKj/zYFo0G+E2DMC3PPJA9Uq85+j0nOCwpALtxKTf7iIM mm+7gd2kpzM4DSpBLeTK665uuQXMMhd7IDTKh2oUf4tnzOj0em/Cu2QN/lFgNwY1LKD7 4rnLFfzNWmDVzYLxYLCnC29mykLFCWK6t676g3qbHO27TrzZxzYS7XKnEt4+tMsD0Y0E fBhZEudM9f0qQYHyRb6CGNqHcP8z9usdpQSXGDxE4HfjkW+FBLEgLmWz6H5OHGBDL+lP j5Qg== X-Gm-Message-State: AOAM532Ks/J0RWcqH7pAutpAYBt87vpBBkDWqC4zze+Xb7Q+PCPFp2xh Sm8m3jUrVLOn+N2Xb+ExrWl6W+cAKxUjGpLKAbL5gUwn/Ws= X-Google-Smtp-Source: ABdhPJzhseTge5lG4mI7KWoZQwbv3gdyFDxUSk94o4+HFS2CfToWEUiSsKAZYyDW9k+Z1NlG82mFxvMZfKlx5RH/FL0= X-Received: by 2002:a05:6102:5e6:: with SMTP id w6mr2834084vsf.71.1643319328091; Thu, 27 Jan 2022 13:35:28 -0800 (PST) MIME-Version: 1.0 References: <20220121170003.363500-1-heinrich.schuchardt@canonical.com> In-Reply-To: From: Simon Glass Date: Thu, 27 Jan 2022 14:35:17 -0700 Message-ID: Subject: Re: [PATCH] sandbox: fix build failure with musl and SDL To: =?UTF-8?Q?Milan_P=2E_Stani=C4=87?= Cc: Heinrich Schuchardt , U-Boot Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Hi, On Fri, 21 Jan 2022 at 13:11, Milan P. Stani=C4=87 wrote: > > Hi, > > it works and build pass without error or warning. > Tested on alpine edge aarch64 bare metal. > > Thank you > > On Fri, 2022-01-21 at 18:00, 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=C4=87 > > Signed-off-by: Heinrich Schuchardt > > Tested-by: Milan P. Stani=C4=87 > > > --- > > 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 :=3D arch/sandbox/cpu/start.o arch/sandbox/cpu/= os.o > > head-$(CONFIG_SANDBOX_SDL) +=3D arch/sandbox/cpu/sdl.o > > libs-y +=3D arch/sandbox/cpu/ > > libs-y +=3D arch/sandbox/lib/ > > + > > +# sdl.c fails to compile with -fshort-wchar using musl. > > +cmd_cc_sdl.o =3D $(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 :=3D cache.o cpu.o state.o > > extra-y :=3D start.o os.o > > -extra-$(CONFIG_SANDBOX_SDL) +=3D sdl.o > > +extra-$(CONFIG_SANDBOX_SDL) +=3D sdl.o > > obj-$(CONFIG_SPL_BUILD) +=3D spl.o > > obj-$(CONFIG_ETH_SANDBOX_RAW) +=3D eth-raw-os.o > > > > @@ -19,8 +19,6 @@ cmd_cc_os.o =3D $(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 pat= h > > @@ -30,3 +28,10 @@ cmd_cc_eth-raw-os.o =3D $(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 =3D $(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 > > This fails on gitlab. https://source.denx.de/u-boot/custodians/u-boot-dm/-/jobs/382812 $ tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -E -W -e --board ${TEST_PY_BD} ${OVERRIDE} Building current source for 1 boards (1 thread, 40 jobs per thread) sandbox: + sandbox +/usr/bin/ld: error: LLVM gold plugin: linking module flags 'wchar_size': IDs have conflicting values in 'arch/sandbox/cpu/sdl.o' and 'ld-temp.o' +clang: error: linker command failed with exit code 1 (use -v to see invoca= tion) +make[1]: *** [Makefile:1799: u-boot] Error 1 +make: *** [Makefile:177: sub-make] Error 2 0 0 1 /1 sandbox Completed: 1 total built, duration 0:00:22, rate 0.05 Running after_script Please can you take a look? Regards, Simon