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 97915C4332F for ; Mon, 18 Oct 2021 14:09:17 +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 AA25A60F36 for ; Mon, 18 Oct 2021 14:09:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AA25A60F36 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 95AE582C4C; Mon, 18 Oct 2021 16:09:14 +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="I/Qbh+Kb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 54C5082C4C; Mon, 18 Oct 2021 16:09:12 +0200 (CEST) Received: from mail-oi1-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) (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 74A4482C45 for ; Mon, 18 Oct 2021 16:09:07 +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-oi1-x235.google.com with SMTP id o83so24511033oif.4 for ; Mon, 18 Oct 2021 07:09:07 -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=IS6gzafBlJAStk4rnQw9x43ItcPoI12Cj9QFc2n9jPE=; b=I/Qbh+Kbx0GftnLv97qZEjN8t+EYDYYUaO6UJOCgijAgwRfNVjRejAW5kff/fnDRN/ c/I1AqKvmyOTALEdgJZvmkuhnwP6ItnoCnPm2s5LuxAojdQ3X1DUOnNDFT50enRxvIss O65RSs9nFU2oTkHYNwMUW44zQKtcFn9lMPFNVSTu0iwzpms0F1zakA41+Ioi8FC39HY4 Ej8rtw6Is6miqfHXJ1wMoZF+ImQ3QZj7x+6KK2u20Z77CF56Xy/CaflA9bh/vW47OHE2 EL5nRjedGjSJ0Dlh6JLj3aUtWSjnBW/+lWfbWwOx/AEAejlPkauK7io5rJNOM2Sd0SCR OzwA== 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=IS6gzafBlJAStk4rnQw9x43ItcPoI12Cj9QFc2n9jPE=; b=vHr2fGGNbtJ+TXAxacMgvw+J2IlhNxKcQN1of/GNTkW8EJrNy1ZFU351fu9uryxntJ TnJoX5aqvIExW4dr0oK/vTLRtl4J+bHOPavjV3Sx4yBm6fTuxlJkkOQw8lO2zXFPCWOO S24v0oFGFJxnnr+v/RHV2aSbpUnrDoAB/RwjnZoRmjpt9eOVH4/DgKA1weB4PjbHe6M0 M4hilKritik5QyKuGdIURTvV3VjwY1r85zP1QJCFrGs1gR94JYf3ugdVG5S/xrDywV6z 3c+qQEyRZ5bHHccdethtAtn+TRwWi78BgPA5+8yoeoAvcti7DjYtOUD4RVvRNum81DSH utlg== X-Gm-Message-State: AOAM530e91hqel/hROkoe+6Q3ZDYh8wSypelL8rYCXkPpqvN+GbdsD9S o34Or/pOU2hQ1OyjcRt8JHI= X-Google-Smtp-Source: ABdhPJzlY5+1eWOXffKWOUQpq9nMM89qeslfLth5xL0j6YNzqp0r7/mWENrTbB4KyOveSbR4C3sSJQ== X-Received: by 2002:a05:6808:2106:: with SMTP id r6mr14749oiw.72.1634566146088; Mon, 18 Oct 2021 07:09:06 -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 y12sm1452252otq.60.2021.10.18.07.09.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Oct 2021 07:09:05 -0700 (PDT) Subject: Re: [PATCH v3 1/4] tools: Separate image types which depend on OpenSSL To: Samuel Holland , u-boot@lists.denx.de, Jagan Teki , Andre Przywara Cc: =?UTF-8?Q?Pali_Roh=c3=a1r?= , Chris Packham , "NXP i.MX U-Boot Team" , Naoki Hayama , Joel Stanley References: <20211015031916.44461-1-samuel@sholland.org> <20211015031916.44461-2-samuel@sholland.org> From: "Alex G." Message-ID: <1a532861-99bd-241f-8551-65541fa58052@gmail.com> Date: Mon, 18 Oct 2021 09:09:04 -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: <20211015031916.44461-2-samuel@sholland.org> 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/14/21 10:19 PM, Samuel Holland wrote: > Some image types (kwbimage and mxsimage) always depend on OpenSSL, so > they can only be included in mkimage when TOOLS_LIBCRYPTO is selected. > Use Makefile logic to conditionally link the files. > > When building for platforms which use those image types, automatically > select TOOLS_LIBCRYPTO, since it is required for the build to complete. > > Signed-off-by: Samuel Holland NAK. The intent, as detailed in tools/Makefile, is to _NOT_ to conflate target options with tools options. Disabling openssl libs is purely at the user's discretion. If platforms can't build a usable image, I suggest just printing a loud warning instead of overriding the user. Alex > --- > > Changes in v3: > - Selected TOOLS_LIBCRYPTO on all platforms that use kwbimage (as best > as I can tell, using the suggestions from Pali Rohár) > > Changes in v2: > - Refactored the first patch on top of TOOLS_LIBCRYPTO > > arch/arm/Kconfig | 3 +++ > arch/arm/mach-imx/mxs/Kconfig | 2 ++ > scripts/config_whitelist.txt | 1 - > tools/Makefile | 19 +++++-------------- > tools/mxsimage.c | 3 --- > 5 files changed, 10 insertions(+), 18 deletions(-) > > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig > index d8c041a877..380ad4f670 100644 > --- a/arch/arm/Kconfig > +++ b/arch/arm/Kconfig > @@ -566,6 +566,7 @@ config ARCH_KIRKWOOD > select BOARD_EARLY_INIT_F > select CPU_ARM926EJS > select GPIO_EXTRA_HEADER > + select TOOLS_LIBCRYPTO > > config ARCH_MVEBU > bool "Marvell MVEBU family (Armada XP/375/38x/3700/7K/8K)" > @@ -580,12 +581,14 @@ config ARCH_MVEBU > select OF_CONTROL > select OF_SEPARATE > select SPI > + select TOOLS_LIBCRYPTO > imply CMD_DM > > config ARCH_ORION5X > bool "Marvell Orion" > select CPU_ARM926EJS > select GPIO_EXTRA_HEADER > + select TOOLS_LIBCRYPTO > > config TARGET_STV0991 > bool "Support stv0991" > diff --git a/arch/arm/mach-imx/mxs/Kconfig b/arch/arm/mach-imx/mxs/Kconfig > index b2026a3758..6f138d25e9 100644 > --- a/arch/arm/mach-imx/mxs/Kconfig > +++ b/arch/arm/mach-imx/mxs/Kconfig > @@ -3,6 +3,7 @@ if ARCH_MX23 > config MX23 > bool > default y > + select TOOLS_LIBCRYPTO > > choice > prompt "MX23 board select" > @@ -34,6 +35,7 @@ if ARCH_MX28 > config MX28 > bool > default y > + select TOOLS_LIBCRYPTO > > choice > prompt "MX28 board select" > diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt > index 3a6865dc70..bea6b6f83b 100644 > --- a/scripts/config_whitelist.txt > +++ b/scripts/config_whitelist.txt > @@ -838,7 +838,6 @@ CONFIG_MXC_UART_BASE > CONFIG_MXC_USB_FLAGS > CONFIG_MXC_USB_PORT > CONFIG_MXC_USB_PORTSC > -CONFIG_MXS > CONFIG_MXS_AUART > CONFIG_MXS_AUART_BASE > CONFIG_MXS_OCOTP > diff --git a/tools/Makefile b/tools/Makefile > index 999fd46531..a9b3d982d8 100644 > --- a/tools/Makefile > +++ b/tools/Makefile > @@ -94,9 +94,11 @@ ECDSA_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := $(addprefix lib/ecdsa/, ecdsa-libcrypto. > AES_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := $(addprefix lib/aes/, \ > aes-encrypt.o aes-decrypt.o) > > -# Cryptographic helpers that depend on openssl/libcrypto > -LIBCRYPTO_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := $(addprefix lib/, \ > - fdt-libcrypto.o) > +# Cryptographic helpers and image types that depend on openssl/libcrypto > +LIBCRYPTO_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := \ > + lib/fdt-libcrypto.o \ > + kwbimage.o \ > + mxsimage.o > > ROCKCHIP_OBS = lib/rc4.o rkcommon.o rkimage.o rksd.o rkspi.o > > @@ -118,10 +120,8 @@ dumpimage-mkimage-objs := aisimage.o \ > imximage.o \ > imx8image.o \ > imx8mimage.o \ > - kwbimage.o \ > lib/md5.o \ > lpc32xximage.o \ > - mxsimage.o \ > omapimage.o \ > os_support.o \ > pblimage.o \ > @@ -156,22 +156,13 @@ fit_info-objs := $(dumpimage-mkimage-objs) fit_info.o > fit_check_sign-objs := $(dumpimage-mkimage-objs) fit_check_sign.o > file2include-objs := file2include.o > > -ifneq ($(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_TOOLS_LIBCRYPTO),) > -# Add CONFIG_MXS into host CFLAGS, so we can check whether or not register > -# the mxsimage support within tools/mxsimage.c . > -HOSTCFLAGS_mxsimage.o += -DCONFIG_MXS > -endif > - > ifdef CONFIG_TOOLS_LIBCRYPTO > # This affects include/image.h, but including the board config file > # is tricky, so manually define this options here. > HOST_EXTRACFLAGS += -DCONFIG_FIT_SIGNATURE > 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),) > HOSTCFLAGS_kwbimage.o += \ > $(shell pkg-config --cflags libssl libcrypto 2> /dev/null || echo "") > HOSTLDLIBS_mkimage += \ > diff --git a/tools/mxsimage.c b/tools/mxsimage.c > index 002f4b525a..2bfbb421eb 100644 > --- a/tools/mxsimage.c > +++ b/tools/mxsimage.c > @@ -5,8 +5,6 @@ > * Copyright (C) 2012-2013 Marek Vasut > */ > > -#ifdef CONFIG_MXS > - > #include > #include > #include > @@ -2363,4 +2361,3 @@ U_BOOT_IMAGE_TYPE( > NULL, > mxsimage_generate > ); > -#endif >