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 DF0A8C433EF for ; Thu, 3 Feb 2022 16:54:17 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 18620819A2; Thu, 3 Feb 2022 17:54:16 +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="iG0HBEF3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2F60B81DCA; Thu, 3 Feb 2022 17:54:14 +0100 (CET) Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) (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 6831E8197D for ; Thu, 3 Feb 2022 17:54:10 +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 mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (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-internal-1.canonical.com (Postfix) with ESMTPS id 38D793F1D9 for ; Thu, 3 Feb 2022 16:54:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1643907245; bh=/dNCaxYTKGXYid3viuZsiA8FIh1kXpFY5CRtKaDBti8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=iG0HBEF3BguOKeX30mSBcTlzy1KYwbPEyFTGb44CQ9g/YDts83/X7zohqnyEnsTEj 0k+BJZCps6QdVYlGEA+BhM3s+d6T9f+kvxC3bXlrLbIfFIQ0ScOprYLbJMvLJnMIv8 fi13OcW7ZCOjq27OxPIsDeGgab+EnJAdNHbuhpNojVuI1twWyj0El/PgwEs8guRUv5 ZnlDmX9Y4cxcFdBcXRBdEU9rdOpPEVnvhK+to/noKUulbv60E1sJGtZAXszYclFkOn BY19YOkWl7RhjJdZ/Nx4reGSpVrp3LRv0j2WxB9mjlML3D8K3VqCArq2k6EYBnqpbN mRa3/s0+8XlUg== Received: by mail-ed1-f71.google.com with SMTP id l16-20020aa7c3d0000000b004070ea10e7fso1770517edr.3 for ; Thu, 03 Feb 2022 08:54:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=/dNCaxYTKGXYid3viuZsiA8FIh1kXpFY5CRtKaDBti8=; b=tEC1rMnHSnGCWee25shlHOzs3sYVZzgBFrj3ELvLWLYGwi9PLSekTTUP3gV/KJ2aak lNW5AKru2PucjMAmBH0tEfcd2sChkbkQSojiHLd94WaSUNMMvIZ+KTI6H9sbOGc/VNjg AoEtD4pfkpy2aBwlwSXgT2kblJG9MpKxZTYLteY81ntJfxCG1NQ1Ay727VRA41GZozne SNR7jCUylNWMefkWbzOekzpYp2AhqvjCEJmG3sWL6Tc606mMqpgVzQrNtZNAIr2o82nT NPNB0mZNtPiI1D1dbxo4XkaP9ZCBftni/U532pz9jYKaYYXylHhlWcrixcN6LtgwusOW /Mdg== X-Gm-Message-State: AOAM53183SItLHSoOVJHgabuzorGjAefd5reQ3vKtbjN+odNeiuuHXI8 GcJWixMsZeSTNC6EvxoNutncreb4vWOpex6SyRcuoe/PQtnqka8PLEnjT8jAFHOWOP5mkdnp/K9 cJHHQpgqoDB/5/MoVujrMLAD98DywtUM= X-Received: by 2002:a05:6402:2681:: with SMTP id w1mr36631454edd.373.1643907244848; Thu, 03 Feb 2022 08:54:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJyPgBRgFMlkR/5FNOem6IFlJS48ei7pV9TTjDjLjiOTZFLXaQ9fEiJvlHplAPzASo0Of979Xg== X-Received: by 2002:a05:6402:2681:: with SMTP id w1mr36631431edd.373.1643907244485; Thu, 03 Feb 2022 08:54:04 -0800 (PST) Received: from [192.168.123.55] (ip-088-152-144-107.um26.pools.vodafone-ip.de. [88.152.144.107]) by smtp.gmail.com with ESMTPSA id lt2sm16848960ejb.50.2022.02.03.08.54.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Feb 2022 08:54:03 -0800 (PST) Message-ID: <6f75b218-c936-1e74-98da-14eb1842232d@canonical.com> Date: Thu, 3 Feb 2022 17:54:02 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: [PATCH] sandbox: fix build failure with musl and SDL Content-Language: en-US To: Simon Glass , Tom Rini Cc: U-Boot Mailing List , =?UTF-8?Q?Milan_P=2e_Stani=c4=87?= References: <20220121170003.363500-1-heinrich.schuchardt@canonical.com> <20220203164303.GU7515@bill-the-cat> From: Heinrich Schuchardt In-Reply-To: <20220203164303.GU7515@bill-the-cat> Content-Type: text/plain; charset=UTF-8; format=flowed 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 On 2/3/22 17:43, Tom Rini wrote: > On Thu, Feb 03, 2022 at 02:02:47PM +0100, Milan P. Stanić wrote: >> Hi, >> >> On Thu, 2022-01-27 at 14:35, Simon Glass wrote: >>> Hi, >>> >>> On Fri, 21 Jan 2022 at 13:11, Milan P. Stanić 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ć >>>>> Signed-off-by: Heinrich Schuchardt >>>> >>>> Tested-by: Milan P. Stanić >>>> >>>>> --- >>>>> 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 >>>>> >>> >>> 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 invocation) >>> +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? >> >> I tested with clang and lld, and clang ld.gold in lxc and bare metal >> build. didn't had this errors. >> >> Could be that this problem appears on docker only. > > Docker is just an Ubuntu/Focal environment, so gcc + ld.gold here. > Your are looking at an old version of the patch. [PATCH v2 1/1] sandbox: fix build failure with musl and SDL https://patchwork.ozlabs.org/project/uboot/patch/20220128090832.35509-1-heinrich.schuchardt@canonical.com/ @Simon Could you, please, review. Best regards Heinrich