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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 660F8C433F5 for ; Thu, 7 Oct 2021 21:05:01 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 72A5A6103C for ; Thu, 7 Oct 2021 21:05:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 72A5A6103C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A6B5183538; Thu, 7 Oct 2021 23:04:57 +0200 (CEST) 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="pn3TgNrk"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D86D583538; Thu, 7 Oct 2021 23:04:55 +0200 (CEST) Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) (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 4452A831B0 for ; Thu, 7 Oct 2021 23:04:51 +0200 (CEST) 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-x830.google.com with SMTP id d8so7626507qtd.5 for ; Thu, 07 Oct 2021 14:04:51 -0700 (PDT) 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:user-agent; bh=jOwR8ayrefAwPO2IXBEED5HWszA+QqAgN3Lt0FVRSaQ=; b=pn3TgNrkcvheFvGsCd7e8W+pqKOp35i2FtDakTrqx1cC0aIKEq+/g4OEz6DdsWI2J1 wSqUPcXI3kELM+P25dN6xyB0ilaLZSErfx1LvCigEm5QZUjzoLNzRRK5u+1MC343oVzW yD5ncFsw220gY/TTpIixy593zjCJbwfGTBuSE= 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:user-agent; bh=jOwR8ayrefAwPO2IXBEED5HWszA+QqAgN3Lt0FVRSaQ=; b=zwAwWgGAvoS4cPyU6WgcsK33fb2aufvCZgOBj8J/RlOvLsTf6hkaDguZsd/HZHJZya sSGHI1mI7yJR4Q/M4t7DWsDuF9UfqYEWFKxv9wUTo6aWvLFJ6tOqcdSRDjr7y528SsKd OBRo6yDSVXggiuu06sdVcJ58cBWDXXPof/YrWzyto3NYZoRYGVqMM4qJ+9/0YXZjEI3P 9Y1EkJhwANLI93QEvZYqU1Q0czO859wYzMK1EEKuq2KNwhM/HBp4Brwmfi3DYFAeWwF+ W59WmotL/FW2NpGlHWtDfSkOAlO9NT2Xus8KUDcbOQQEw7PHmRpWphKg+LxRR/0iOHGk Hh5A== X-Gm-Message-State: AOAM533Jush1AHDKvk74yM1JXERdhIUusTNIn/bMgwfIrO5ay7jTLIX6 zcZkfOYund6l681fAUSvATVJDg== X-Google-Smtp-Source: ABdhPJzknvjO5PSw6UX9Bv8dk81EZQZOxMiYQu4TrMvVK54JTf8+XwjWbsPIFTP3M7OkKQSxp8gbFg== X-Received: by 2002:ac8:1c4:: with SMTP id b4mr7728398qtg.330.1633640689932; Thu, 07 Oct 2021 14:04:49 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-cc2f-6f95-d2e4-ed0f.res6.spectrum.com. [2603:6081:7b01:cbda:cc2f:6f95:d2e4:ed0f]) by smtp.gmail.com with ESMTPSA id az33sm561797qkb.53.2021.10.07.14.04.48 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Oct 2021 14:04:48 -0700 (PDT) Date: Thu, 7 Oct 2021 17:04:46 -0400 From: Tom Rini To: "Alex G." Cc: Simon Glass , U-Boot Mailing List , Andre Przywara , Rasmus Villemoes , Robert Marko , Masahiro Yamada , Masahiro Yamada Subject: Re: [PATCH v5 02/29] kconfig: Add tools support to CONFIG_IS_ENABLED() Message-ID: <20211007210446.GY31748@bill-the-cat> References: <20211007025226.GQ31748@bill-the-cat> <20211007134209.GS31748@bill-the-cat> <20211007183045.GV31748@bill-the-cat> <5cb30240-b726-72be-fa68-05ce174218a3@gmail.com> <20211007193943.GW31748@bill-the-cat> <35223dc3-4af4-f70d-00d0-14495426be3f@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="IGAojOc9HqRkqa3/" Content-Disposition: inline In-Reply-To: <35223dc3-4af4-f70d-00d0-14495426be3f@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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 --IGAojOc9HqRkqa3/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 07, 2021 at 03:33:32PM -0500, Alex G. wrote: >=20 >=20 > On 10/7/21 2:39 PM, Tom Rini wrote: > > On Thu, Oct 07, 2021 at 02:32:42PM -0500, Alex G. wrote: > > >=20 > > >=20 > > > On 10/7/21 1:50 PM, Simon Glass wrote: > > > > Hi Tom, > > > >=20 > > > > On Thu, 7 Oct 2021 at 12:30, Tom Rini wrote: > > > > >=20 > > > > > On Thu, Oct 07, 2021 at 12:02:24PM -0600, Simon Glass wrote: > > > > > > Hi Tom, > > > > > >=20 > > > > > > On Thu, 7 Oct 2021 at 07:42, Tom Rini wrot= e: > > > > > > >=20 > > > > > > > On Thu, Oct 07, 2021 at 07:32:04AM -0600, Simon Glass wrote: > > > > > > > > Hi Tom, > > > > > > > >=20 > > > > > > > > On Wed, 6 Oct 2021 at 20:52, Tom Rini = wrote: > > > > > > > > >=20 > > > > > > > > > On Wed, Oct 06, 2021 at 08:49:13PM -0600, Simon Glass wro= te: > > > > > > > > > > Hi Tom, > > > > > > > > > >=20 > > > > > > > > > > On Wed, 6 Oct 2021 at 18:26, Tom Rini wrote: > > > > > > > > > > >=20 > > > > > > > > > > > On Sat, Sep 25, 2021 at 07:43:15PM -0600, Simon Glass= wrote: > > > > > > > > > > >=20 > > > > > > > > > > > > At present we must separately test for the host bui= ld for many options, > > > > > > > > > > > > since we force them to be enabled. For example, CON= FIG_FIT is always > > > > > > > > > > > > enabled in the host tools, even if CONFIG_FIT is no= t enabled by the > > > > > > > > > > > > board itself. > > > > > > > > > > > >=20 > > > > > > > > > > > > It would be more convenient if we could use, for ex= ample, > > > > > > > > > > > > CONFIG_IS_ENABLED(FIT) and get CONFIG_HOST_FIT, whe= n building for the > > > > > > > > > > > > host. Add support for this. > > > > > > > > > > > >=20 > > > > > > > > > > > > With this and the tools_build() function, we should= be able to remove all > > > > > > > > > > > > the #ifdefs currently needed in code that is build = by tools and targets. > > > > > > > > > > > >=20 > > > > > > > > > > > > This will be even nicer when we move to using CONFI= G(xxx) everywhere, > > > > > > > > > > > > since all the #ifdef and IS_ENABLED/CONFIG_IS_ENABL= ED stuff will go away. > > > > > > > > > > > >=20 > > > > > > > > > > > > Signed-off-by: Simon Glass > > > > > > > > > > > > Suggested-by: Rasmus Villemoes # b4f73886 > > > > > > > > > > > > Reviewed-by: Alexandru Gagniuc > > > > > > > > > > >=20 > > > > > > > > > > > The problem here is we don't include automatically > > > > > > > > > > > when building host stuff, I believe. This is why doi= ng this breaks > > > > > > > > > > > test_mkimage_hashes for me on am335x_evm with: > > > > > > > > > > > /tmp/.bm-work/am335x_evm/tools/mkimage -D -I dts -O d= tb -i /tmp/.bm-work/am335x_evm -f /home/trini/work/u-boot/u-boot/test/py/te= sts/vboot//hash-images.its /tmp/.bm-work/am335x_evm/test.fit > > > > > > > > > > > *** stack smashing detected ***: terminated > > > > > > > > > >=20 > > > > > > > > > > Oh dear, and no CI coverage. > > > > > > > > > >=20 > > > > > > > > > > I was reluctant to include kconfig.h everywhere but per= haps that is > > > > > > > > > > the best approach. Will take a look ASAP. > > > > > > > > >=20 > > > > > > > > > Maybe we need to think a bit harder too about how we stru= cture > > > > > > > > > intentionally shared code. > > > > > > > > >=20 > > > > > > > > > Why not, for example, for these common algorithms, rely o= n typical > > > > > > > > > system headers/libraries in the tooling, which means we v= alidated U-Boot > > > > > > > > > vs common reference, rather than just our implementations? > > > > > > > >=20 > > > > > > > > Do you mean we use openssl for sha1, for example? > > > > > > >=20 > > > > > > > I guess, yes. Just flat out saying we require openssl for to= ols, and > > > > > > > doing our best to not make compatibility with libressl diffic= ult, seems > > > > > > > likely to cause less headaches for people than what we alread= y require > > > > > > > in terms of Python. > > > > > >=20 > > > > > > I'm OK with that, although I do think the problem identified he= re > > > > > > (CONFIG_SHA256 not enabled) is somewhat sideways from that. We = already > > > > >=20 > > > > > OK, I've taken what you posted on IRC and folded that in, continu= ing > > > > > tests now. > > > > >=20 > > > > > > use separate code paths to run hashing. Perhaps we could make it > > > > > > optional? > > > > > >=20 > > > > > > What about those people that complain about crypto libraries on= their systems? > > > > >=20 > > > > > I'm not sure how big a problem that really is, currently. I gues= s one > > > > > thing would be to make a separate thread on it, and put it in the= next > > > > > -rc email as well, for people to explain why it would be a hardsh= ip. > > > > > That in turn, I think, is coming down to modern vs very old opens= sl > > > > > support, rather than having any at all. > > > >=20 > > > > OK I'll take a look at some point. > > > >=20 > > > > Or perhaps Alex might like to? > > >=20 > > > We just got a complain about OpenSSL yesterday [1] > > >=20 > > > Alex > > >=20 > > > [1] https://lists.denx.de/pipermail/u-boot/2021-October/462728.html > >=20 > > Oh goodness, LibreELC is a custom build system... I'll have to chime in > > there, thanks. >=20 > I am in favor of keeping libcrapto separate. We still need our own code f= or > CRC32 and other weak or non-crypto hashes, a tidbit which makes me doubt = the > wisdom of relying entirely on an external lib. >=20 > I had to make a similar decision when writing the hashes test. Originally= , I > was going to use pyCrypto, crcelk, to re-hash everything and compare to > mkimage. It turned out to be neither necessarry nor efficient. Is there perhaps a happy medium? Or do we just need to think harder on how to make the code U-Boot needs shared between target and host tools clean and clear and obvious enough? --=20 Tom --IGAojOc9HqRkqa3/ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmFfYOcACgkQFHw5/5Y0 tyzj2Av+OHzKR/w77s1ask2QE0dRlcLEumzwtbtiFlwLFK7E+WlM9cCyBaa+nAn5 WrZdYycbT9IP033mAHN/0Fc7MLCWxnyeC9cTOhZxFTQG6GT0CerQkNMQbfDCBGav ZjHO6APWPnaJrq3qX+sqSHCJAHawb/gp8PFz3mVjDlydRDKDJH1uF43S/XSCFXon +gVsbw1jJ53b2ohj0DU/sQK5h2fn9ZxHlSbUuLEMMNF2g7uHDox5NjmfavNjduP5 b+gxkz7eAqGOM3P4Ya5iN5ibdFuqIQDEmT1mYi3ZZtqF03ptgPD4bBwjQrjOLLOh 5ryb+7sHJnCVvCT4ooXTZWxF9a1Rp+xbqBji7ChdUA8zr2vXuU2YStg9d+vJqoow un3SzF5xL6SKyzRid/8A1F5GJtUBrneBOd6an7WRvyte30S55WeXrjjCsIDvS9Uw 594PrFkXMSzkZS3gh2B9TDLMD5OwPK7lqNDNf3jOcs2bCd951SWSoHEOR5hG584b Yn22RkpQ =ne6k -----END PGP SIGNATURE----- --IGAojOc9HqRkqa3/--