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 E12DCC433EF for ; Mon, 18 Oct 2021 14:04:40 +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 3671360555 for ; Mon, 18 Oct 2021 14:04:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3671360555 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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 D522F82BC7; Mon, 18 Oct 2021 16:04:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.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=gmail.com header.i=@gmail.com header.b="BoTVrxjG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 57D2980735; Mon, 18 Oct 2021 16:04:35 +0200 (CEST) Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) (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 85D8480735 for ; Mon, 18 Oct 2021 16:04:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=mr.nuke.me@gmail.com Received: by mail-ot1-x332.google.com with SMTP id e59-20020a9d01c1000000b00552c91a99f7so1323450ote.6 for ; Mon, 18 Oct 2021 07:04:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=SQiMU5zGrStAClKX+8PcbHRAq4xNfq5kZO76AzLwP5U=; b=BoTVrxjGRsQafT6Sn0fERjhgh4Wck1fRyf7AsqX2UuqJBUpxxe9Dg4+AABcuqjBQXs 4oWKr/7PJsmCjdnJNcMjqT0OIAe9ioiqtIiyactdub+EHCpRYucZK5qvSkqW/oW9v1xl Tzm1XJfzykb9MMDFbgw5Uxt+rKXbJfgWNMn+JJz6KoM7nunKsw64OJ1QeLj85IJ7g5dS gPOEhtLSP1ChVFmXYttdiy8G/sCWxqok83Ykxv32ytSl3ysajnQZ6Mue/g5u+L9uE+bz NkgcYpN20a81Zb3b3TBVDeTPQ3YuVCohUEqnFyjKpTewqVcmW7IDeeiY1FznsxZP7iMA 0vWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=SQiMU5zGrStAClKX+8PcbHRAq4xNfq5kZO76AzLwP5U=; b=I5bYB4NKpW9wPSJXiDOR+ip0TFm/mCMO/Thrc0T/QyBDPaWSgZ2FAd6a5dRp+lSFpN Ci1LoQqpWv847pP0uXotS+H+zanzAv71Wq4CbBxRWDFM3gL+zB9mhs2GzTEXAFukZAoH bBRK5Bz8pfFrkqjx+eVaV9jEmk5sQ4trJC4hOr4cL1pM8SV0mttW44BzcXpSr0J4/6F7 S7CZSQdee+Mig0BNjxEywgS+bOgrVQcT64BoXpuMEnh005YGckzTXHOXdwy3lwac+2UQ LC83vbawKO0KP5MEMe+cDw/MFETCQoTmfYFJr5/6k4xE1hLZaVyrQsZBPX2Vlf8W9lYS L1wQ== X-Gm-Message-State: AOAM531OjD/j8O3D/wrWzulSI7npVJPayhzGDBS/AkZwR8bbXkNkYTJ2 KmY/IBz4JIQAko/YgUz7nQXeWouzniQ= X-Google-Smtp-Source: ABdhPJwl0730sO2ze/0tcs960hysYnFziyD5GcjCkOcKU87we/F+fYI3v+Rthg968tCrLwRNKNPCOA== X-Received: by 2002:a05:6830:31a8:: with SMTP id q8mr21743557ots.156.1634565867596; Mon, 18 Oct 2021 07:04:27 -0700 (PDT) Received: from nuclearis3.gtech (c-98-195-139-126.hsd1.tx.comcast.net. [98.195.139.126]) by smtp.gmail.com with ESMTPSA id a2sm334656otf.46.2021.10.18.07.04.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Oct 2021 07:04:26 -0700 (PDT) Subject: Re: Broken build with disabling OpenSSL crypto To: =?UTF-8?Q?Pali_Roh=c3=a1r?= Cc: =?UTF-8?Q?Jernej_=c5=a0krabec?= , u-boot@lists.denx.de References: <18564205.Z0HQFNUZ9R@kista> <544c0c86-ca3f-036e-2523-3f973105410a@gmail.com> <20211015113411.t2jltrmjggw7arb2@pali> <04979a7d-3f1b-9493-ba8c-39a0d893e5b4@gmail.com> <20211015203049.kaky7lbffbgh2fvx@pali> From: "Alex G." Message-ID: <10b5a16f-9aa3-38f6-0bd7-cc9df5f38e0b@gmail.com> Date: Mon, 18 Oct 2021 09:04:26 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20211015203049.kaky7lbffbgh2fvx@pali> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit 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 On 10/15/21 3:30 PM, Pali Rohár wrote: > On Friday 15 October 2021 09:35:43 Alex G. wrote: >> On 10/15/21 6:34 AM, Pali Rohár wrote: >>> On Wednesday 06 October 2021 17:05:24 Alex G. wrote: >>>> Hi Jernej, >>>> >>>> On 10/6/21 4:27 PM, Jernej Škrabec wrote: >>>>> Hi everyone! >>>>> >>>>> Commit cb9faa6f98ae ("tools: Use a single target-independent config to enable >>>>> OpenSSL") recently introduced option to disable usage of OpenSSL via >>>>> CONFIG_TOOLS_LIBCRYPTO. However, just a bit later, another commit b4f3cc2c42d9 >>>>> ("tools: kwbimage: Do not hide usage of secure header under >>>>> CONFIG_ARMADA_38X") made U-Boot tools hard dependent on OpenSSL. That totally >>>>> defeats the purpose of first commit. I suggest that it gets reverted. >>>>> >>>>> I would like disable OpenSSL for my usage, since it gives me troubles when >>>>> cross-compiling U-Boot inside LibreELEC build system. It's not needed for our >>>>> case anyway. >>>>> >>>>> Best regards, >>>>> >>>> >>>> Can you please give the following diff a try, and if it works for you, submit as patch? >>> >>> This change is incorrect and will break mvebu builds. mvebu requires >>> kwbimage for building boot images and so you cannot disable it or make >>> it optional. >>> >> >> If kwbimage is required and missing the CI builds and tests don't catch >> that. I ran buildman with the change, and nothing broke. Sounds like that >> needs to be addressed. > > It is possible that tests do not covert all scenarios. > >> That being said, I'm not okay with making everyone a slave to OpenSSL >> because of any given platform. >> >> I propose to revert commit b4f3cc2c42d9 ("tools: kwbimage: Do not hide usage >> of secure header under CONFIG_ARMADA_38X"), and rework it such that it >> doesn't force libcrypto on everyone. And we very likely need a CI test >> against libcrypto linkage when TOOLS_LIBCRYPTO is not set. > > Reverting that commit is not a solution as it can lead to broken > kwbimage (when crypto stuff is not enabled). Plus there is lot of other > changes and fixes in kwboot and kwbimage... There are lots of CI tests that do not build usable images. I caution against conflating testability with usability, as anyone who intends to run images on hardware will likely have done their diligence and enabled TOOLS_LIBCRYPTO. Alex > Some information with another approach how to solve build issues are in > this email: > https://lore.kernel.org/u-boot/20211015114735.rig3e4cuc7mn6a7e@pali/ > >> Alex >> >>>> >>>> diff --git a/tools/Makefile b/tools/Makefile >>>> index 4a86321f64..7f72ff9645 100644 >>>> --- a/tools/Makefile >>>> +++ b/tools/Makefile >>>> @@ -96,7 +96,8 @@ AES_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := $(addprefix lib/aes/, \ >>>> >>>> # Cryptographic helpers that depend on openssl/libcrypto >>>> LIBCRYPTO_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := $(addprefix lib/, \ >>>> - fdt-libcrypto.o) >>>> + fdt-libcrypto.o) \ >>>> + kwbimage.o >>>> >>>> ROCKCHIP_OBS = lib/rc4.o rkcommon.o rkimage.o rksd.o rkspi.o >>>> >>>> @@ -117,7 +118,6 @@ dumpimage-mkimage-objs := aisimage.o \ >>>> imximage.o \ >>>> imx8image.o \ >>>> imx8mimage.o \ >>>> - kwbimage.o \ >>>> lib/md5.o \ >>>> lpc32xximage.o \ >>>> mxsimage.o \ >>>> @@ -169,8 +169,8 @@ HOST_EXTRACFLAGS += -DCONFIG_FIT_SIGNATURE_MAX_SIZE=0xffffffff >>>> HOST_EXTRACFLAGS += -DCONFIG_FIT_CIPHER >>>> endif >>>> >>>> -# MXSImage needs LibSSL >>>> -ifneq ($(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_ARMADA_38X)$(CONFIG_TOOLS_LIBCRYPTO),) >>>> +# MXSImage needs LibSSL <- Nope! Read the frogging notice at the top >>>> +ifneq ($(CONFIG_TOOLS_LIBCRYPTO),) >>>> HOSTCFLAGS_kwbimage.o += \ >>>> $(shell pkg-config --cflags libssl libcrypto 2> /dev/null || echo "") >>>> HOSTLDLIBS_mkimage += \