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 2FF33C433EF for ; Mon, 8 Nov 2021 08:46:46 +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 6041260FDA for ; Mon, 8 Nov 2021 08:46:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6041260FDA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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 9E48F8354D; Mon, 8 Nov 2021 09:46:43 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="bGrKjYN0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 10FC7835C0; Mon, 8 Nov 2021 09:46:41 +0100 (CET) Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) (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 93FA580303 for ; Mon, 8 Nov 2021 09:46:37 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pf1-x432.google.com with SMTP id o4so1250684pfp.13 for ; Mon, 08 Nov 2021 00:46:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=XZGGGS7qfKSB/TJwEV8W2djdhpMxOjEiVaFhFsEkbsI=; b=bGrKjYN0jXLwi0x/B7JlqGmvhlFPjCHFT/dmXPS0L56MrizUMWUul0Gio/w2Da62kc irDG+g/XygIdKfBHg0Y6V+yzih1H3a6ieyIQqjSGYhSMNAITodQPrzDVMwXxaC4pZEuG TFQJVGdn3h79F6Wc8xKQU6HiIUCxJuYfkpzjfWavHn3J8tAq1apfVv/TIYw7Vi12vo5f IJITAp5DsiNSKahiH8LcShtHHjR9nhf5MBZVtIe9lXeQSHhWtKB7eiLFhVAEKX0w1TeY umHj2KxugzmkDeBfgsqZfk3HKjhxgjilsQEHhgBGFV+LIJiuiBQPjx4sV7ZTkDxtN4bd Fd0A== 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 :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=XZGGGS7qfKSB/TJwEV8W2djdhpMxOjEiVaFhFsEkbsI=; b=1ix9I1YXAoaIzvnsfSYdplm9IJQ77TSwgHwIuIS4c5W8XgWaKwkT94wnJiCUct2cM1 0ixiNjvmqYOgDIE3LzccyFwshjkDwwR3gxdX5JLA7iLHyDAaADVMeapN25scgkSWM/xW bYKiTFvB1FPHxJ4uzEXf00XAfXrtQ+2XGY1Aqfnzf30A7pVaO7rLjndSts8+ICjOEpBt HJHEKUTvNhUH7UhpT20b6cjxPrLWIfkbKj0wcKMheUfO1dFrWoxip5tUgYrZniTzFyg+ vtJmwjooj53waBjUuePk0q+vne2h/l+RcLKEZJMAIgktqRv6k2wAmnfMUCd8eyLJiOQp +haQ== X-Gm-Message-State: AOAM530WZhfoPonoIBpBFP+Pv3eq3I3uQ/on9hsvIu4lKIQWDsZGu+SG hzrOa5KffFIikmo2Z0uVivUlCQ== X-Google-Smtp-Source: ABdhPJyardrnN3kiw0GCfvS07chDtGz8GI1CSEMNA7eTioFGPfXUx6rChTD9A+xezdeq6TPqZepPMA== X-Received: by 2002:a63:8a:: with SMTP id 132mr13205019pga.400.1636361195693; Mon, 08 Nov 2021 00:46:35 -0800 (PST) Received: from laputa ([2400:4050:c3e1:100:98bf:5be1:75ff:1c8a]) by smtp.gmail.com with ESMTPSA id lw1sm16774324pjb.38.2021.11.08.00.46.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Nov 2021 00:46:35 -0800 (PST) Date: Mon, 8 Nov 2021 17:46:30 +0900 From: AKASHI Takahiro To: Mark Kettenis Cc: Simon Glass , xypron.glpk@gmx.de, agraf@csgraf.de, ilias.apalodimas@linaro.org, sughosh.ganu@linaro.org, masami.hiramatsu@linaro.org, u-boot@lists.denx.de Subject: Re: [PATCH v5 02/11] tools: mkeficapsule: add firmwware image signing Message-ID: <20211108084630.GG16401@laputa> Mail-Followup-To: AKASHI Takahiro , Mark Kettenis , Simon Glass , xypron.glpk@gmx.de, agraf@csgraf.de, ilias.apalodimas@linaro.org, sughosh.ganu@linaro.org, masami.hiramatsu@linaro.org, u-boot@lists.denx.de References: <20211028062356.98224-1-takahiro.akashi@linaro.org> <20211028062356.98224-3-takahiro.akashi@linaro.org> <20211029045628.GA33977@laputa> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Hi Mark, On Thu, Nov 04, 2021 at 03:31:40PM +0100, Mark Kettenis wrote: > > From: Simon Glass > > Date: Wed, 3 Nov 2021 20:51:25 -0600 > > > > Hi Mark, > > > > On Tue, 2 Nov 2021 at 09:13, Mark Kettenis wrote: > > > > > > > From: Simon Glass > > > > Date: Tue, 2 Nov 2021 08:56:50 -0600 > > > > > > > > Hi Takahiro, > > > > > > > > > > - can we just build the tool always? > > > > > > > > > > This is one of my questions. > > > > > Why do you want to do so while there are bunch of tools that are > > > > > not always built. > > > > > > > > Because I think all tools should be built always. It is fine if that > > > > happens due to CONFIG options but we should try to avoid making it > > > > complicated. > > > > > > Well, unless this patchset fixes things, we can't, because > > > mkeficapsule doesn't build on OpenBSD. I tried looking into it, but I > > > can't figure out how this is even supposed to compile as a host tool: > > > > > > > > > In file included from tools/mkeficapsule.c:8: > > > In file included from include/malloc.h:369: > > > include/linux/string.h:15:24: error: conflicting types for 'strspn' > > > extern __kernel_size_t strspn(const char *,const char *); > > > ^ > > > /usr/include/string.h:88:9: note: previous declaration is here > > > size_t strspn(const char *, const char *); > > > > My guess is that linux/string.h should not be included, or perhaps > > __kernel_size_t should be defined to size_t. > > > > I doubt it would take an age to figure out, with a bit of fiddling. > > Well, I think the problem is quite fundamental. Indeed I agree that > linux/string.h shouldn't be included. It gets pulled in because the > tools include . Modern software really shouldn't include > that header anymore, and we removed it in OpenBSD some time ago. But > even with that fixed, things break since the same header gets pulled > in from . > > Redefining __kernel_size_t doesn't provide a way out: > > tools/mkeficapsule.c:23:16: error: typedef redefinition with different types ('size_t' (aka 'unsigned long') vs 'unsigned int') > typedef size_t __kernel_size_t; > ^ > ./arch/arm/include/asm/posix_types.h:37:23: note: previous definition is here > typedef unsigned int __kernel_size_t; > ^ > > This is on an amd64 host, so "unsigned int" clearly is the wrong type > for size_t. > > The fundamental problem seems to be that isn't safe to include > in a "host" tool because it includes "target" headers that > accidentally resolve to "system" headers on Linux systems. > > Maybe Takahiro or Heinrich have an idea how to fix that? But in the > meantime it would be good if building this tool would remain optional. Please let me confirm one thing; you can't build this tool even without my patch applied. Right? If so, we may want to discuss and figure out a solution after the patch is merged as long as the tool won't be built neither by Kconfig default nor by tools-only_defconfig. -Takahiro Akashi