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 700FAC433EF for ; Tue, 11 Jan 2022 21:14:37 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B52D583022; Tue, 11 Jan 2022 22:14:34 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com 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=konsulko.com header.i=@konsulko.com header.b="VUAg/8ae"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D70698302C; Tue, 11 Jan 2022 22:14:32 +0100 (CET) Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) (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 38FCC811DE for ; Tue, 11 Jan 2022 22:14:29 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qt1-x82a.google.com with SMTP id f17so709750qtf.8 for ; Tue, 11 Jan 2022 13:14:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=OmTnS8heB61CcnZHH+xURqtMpAtYZQjn3suBRuIjrO4=; b=VUAg/8aeYysaigZeuUvuBx5U0idd4KyyeyCg9nNZ4is4x5od6Xp+SNsDX3su5GwOn9 vkFuxVancQ49qACI/xswEwAEjrHbq+ViZNMZtRt6WAwT/Fhk91Sp1PVTRByFAzkGgnNI OEbx+eGQ6u9bAPo/rCyW+b7aOr3QZU50I1vvk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=OmTnS8heB61CcnZHH+xURqtMpAtYZQjn3suBRuIjrO4=; b=Ti2R+F1l1huWZpotHoxWcHweUKVUB3m+Xo32WBZLjx5ogS/YeUmhL0U9Iyx0PbbL/U TkakSKLzPeJvrG4ejSsrF+3jcFSVIouNrKubYqzH3Mr2a26yhDo/9rFgeuVcy8R/I2B8 b2VXISWBtxL23W6k6An0fXV/usahCvZC0kn6sJlCmCoq1Jfot3Kf/SLTvFA8aQbH0NEf 0wLbydiluhWK8cmLHd4cCs6uMNPpB45tV3lSuydDf8NgF8PlPzHMl1dsLEXA/R3ksE4s DRVm6rzoR9I4fssK3iJNv0BfMl0m82CYL4PvQm5ORnV/YWm+YP/QIdj5Y82ZUID4/t2w nncw== X-Gm-Message-State: AOAM53009cd6q5MWfEJm+aYKnCUr2hQF9Zv43ilij/4cmFuaJ0y89g9n JYueJVxNdQh3Kx/SgX0p0f//hQ== X-Google-Smtp-Source: ABdhPJwXdCeRtPbY5yxMNlfaO6Gs1kd0BN7DJABEstplq5x3IXA/nqnROauc2GKRa+5XS7ETwgM83g== X-Received: by 2002:ac8:5dca:: with SMTP id e10mr5305519qtx.558.1641935667826; Tue, 11 Jan 2022 13:14:27 -0800 (PST) Received: from bill-the-cat (2603-6081-7b01-cbda-456a-4482-4d5b-efcf.res6.spectrum.com. [2603:6081:7b01:cbda:456a:4482:4d5b:efcf]) by smtp.gmail.com with ESMTPSA id h20sm7083974qka.126.2022.01.11.13.14.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jan 2022 13:14:26 -0800 (PST) Date: Tue, 11 Jan 2022 16:14:25 -0500 From: Tom Rini To: Pali =?iso-8859-1?Q?Roh=E1r?= Cc: "Alex G." , Marek Vasut , u-boot@lists.denx.de, Heinrich Schuchardt , Marek =?iso-8859-1?Q?Beh=FAn?= , Stefan Roese Subject: Re: [PATCH] tools: Do not build kwbimage if CONFIG_TOOLS_LIBCRYPTO=n Message-ID: <20220111211425.GN2773246@bill-the-cat> References: <20220111153120.1276641-1-marex@denx.de> <20220111153634.k5ajrgf2orzdhnar@pali> <20220111161647.GF2773246@bill-the-cat> <20220111190917.GM2773246@bill-the-cat> <7608c558-0d3c-19c4-083d-9b15fd3298d0@gmail.com> <20220111204410.up5mp6uv5macj5wo@pali> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="R73qF6UOoHzMotJv" Content-Disposition: inline In-Reply-To: <20220111204410.up5mp6uv5macj5wo@pali> X-Clacks-Overhead: GNU Terry Pratchett 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.2 at phobos.denx.de X-Virus-Status: Clean --R73qF6UOoHzMotJv Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 11, 2022 at 09:44:10PM +0100, Pali Roh=E1r wrote: > On Tuesday 11 January 2022 14:22:43 Alex G. wrote: > > On 1/11/22 13:09, Tom Rini wrote: > > > On Tue, Jan 11, 2022 at 07:58:05PM +0100, Marek Vasut wrote: > > > > On 1/11/22 17:16, Tom Rini wrote: > > > > > On Tue, Jan 11, 2022 at 04:36:34PM +0100, Pali Roh=E1r wrote: > > > > > > On Tuesday 11 January 2022 16:31:20 Marek Vasut wrote: > > > > > > > The kwbimage has hard dependency on OpenSSL, do not build it > > > > > > > in case TOOLS_LIBCRYPTO is disabled. > > > > > >=20 > > > > > > This patch does not work as kwbimage is required for 32-bit Arm= ada > > > > > > platforms. So kwbimage.o cannot be disabled on these platforms. > > > > > >=20 > > > > > > There is already proposal for fixing this issue: > > > > > > https://patchwork.ozlabs.org/project/uboot/patch/20211021093304= =2E25399-1-pali@kernel.org/ > > > > >=20 > > > > > And needs to be respun to not have Kconfig issues. To answer som= ething > > > > > noted in that thread, yes, it would be good if Kconfig did, or ha= d an > > > > > option to make WARNING like that fatal. Or is the problem really= that > > > > > no, it's non-optional, really, to have OpenSSL installed? > > > >=20 > > > > OpenSSL should be optional, I got this bug report where someone tri= ed to > > > > build u-boot on ancient debian oldoldstable with openssl 1.1.0 (wit= hout > > > > ecdsa support), for a platform which doesn't need any of this crypt= o stuff. > > > > So, disabling TOOLS_LIBCRYPTO was a sufficient for that platform to= build in > > > > that setup (with this patch). And there are plenty of such platform= s in the > > > > U-Boot tree (all that are not marvell I think). > > >=20 > > > Right. So your patch is a step in the right direction, but we also n= eed > > > to have the appropriate platforms depend'ing on TOOLS_LIBCRYPTO and > > > updating the help to note that some platforms require it as well, to > > > build their images. > >=20 > > I did not intend for TOOLS_LIBCRYPTO to be used beyond an on/off toggle= for > > the user. > >=20 > > My suggestion is to allow platforms to build irrespective of > > TOOLS_LIBCRYPTO, and print a warning if for some reason we can't genera= te a > > bootable image. I see quite a few ARMv8 platforms throw such warnings on > > gitlab-ci. We can compile an elf, right? Any good reason why kwbimage s= hould > > be different? > >=20 > > Alex >=20 > For me: >=20 > build =3D generate a bootable image >=20 > or at least I do not see a reason why an end user should be able to > generate e.g. cmd/common.o object file without having working full > toolchain for successful generation of final executable. >=20 > Some platforms (e.g. that Marvell) are not ELF-based, so compiling ELF > means nothing. Almost nothing is ELF based. So yes, Alex's point is right, in many respects this is no different than the common ARMv8 case of needing something we can't / don't provide to make a functional image. Just building u-boot (and spl/u-boot and/or tpl/u-boot) isn't enough and isn't what's booted on the platform as-is. > kwbimage for these Marvell platforms is what generates final > "executable" image and it does also other checks and tests. It is > possible that build process generates SPL ELF binary but kwbimage refuse > it. In most cases it means that user chose .config options unusable for > booting, but it could mean also other issues. And this is something > which CI tests can detect... if some patch is doing to break U-Boot on > Marvell platforms. On mailing list are pending other patches which > extends those kwbimage checks to prevent generating broken images > (e.g. chosen SPL load address cannot be set into kwbimage). >=20 > So printing a warning does not solve anything because warnings are > ignored. Lot of packaging tools and also CI tests pass successfully if > build process throw a warning. >=20 > And if some platforms are throwing warnings on CI, is not this an issue > which somebody should care about? What makes kwbimage different from the ARMv8 case is that in this case we're talking about building the tool to make the image and in the other case we're talking about using our tooling to generate (or be unable to generate) a functional image. We cannot ship TF-A or other assorted external projects and their build outputs, so we throw a non-fatal but obvious to anyone reading warning message out. CI isn't even the issue for kwbimage as we just include openssl-dev in the base. The issues are: - How do we handle non-kwbimage platforms? Especially since the general expectation is that mkimage will work for pretty much anything. And not all distros / distro builders (OE) use tools-only_defconfig to configure their build of mkimage. - How do we handle the case of kwbimage platforms on hosts that don't have openssl-dev? This I think should be a build time error. Failing to build over missing ssl headers should be a fairly easy to diagnose problem, and also should be documented as appropriate under doc/board/ --=20 Tom --R73qF6UOoHzMotJv Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmHd8y0ACgkQFHw5/5Y0 tyyACwwAr4owaRVFFdJ2tiNDlwpizm//rRb/6Pj1/IIG2NccOP9AYhOP7Yis++Bv blEoUFTELVDpX0dLNrXdJQxU2CnPxcdB81DmnHv6wsII/Q3ztRwRteugSz7Vuouo /30ajQSc979v1uN2zsVvV7DbcPHst5kTnGAfdz18pLgEcDpcHaOjYSSqdnWX2vpl J5YEVejdYKC/A5i4moLJJVRRLTF+7EJpJFeeDwim4uuteL0WmEA2kHmzE8bmi/Se dmaxDoK5olBxVjIG8H/gHUs4pThJJXtjuyeO4zVz39lM8Nj21PttI9iSreAQkhIw ioTGuPGbkcFkfMtXJIe8D+31ukXbVJ4nW1RB6496ophhL2A92XWO8WlCMJoESeSu d0Xr0TIdd6tc+SoWjCH5IiDFTIgys4B35QjKEkN4+OW17tywSqb+y+lhLZP52vJf QiWApBECGlfuD07phek/aY6diNhWZYDWFqY2AMJym4aXDi80qSuRIfp/hcbwpbDB O6UXXJLA =3HeQ -----END PGP SIGNATURE----- --R73qF6UOoHzMotJv--