From patchwork Tue Oct 8 12:05:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 175478 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp5609892ill; Tue, 8 Oct 2019 05:06:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqyrpjXTve7HyCSuDaXGJjx0dEx5I91zuTsdqWeiYvuKEx4YBpT7nbYrmI6jxD3DLFigkicB X-Received: by 2002:a17:906:3486:: with SMTP id g6mr18764986ejb.262.1570536405573; Tue, 08 Oct 2019 05:06:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570536405; cv=none; d=google.com; s=arc-20160816; b=V16gmMx2uifl0OLfmO+mCa444hGfHKdSz7k59vexJwQnzwLbb3ePD73HMffaqT9If1 Jv1Ltkk3/Jh8B5otVKuiGOfqvdldjk31k85aGmNaa7wTv44KGfwNI1R086FWvL4uaEUO RpILKQzCPmooClRmwIsBL7z7y4buu/x9zitrwXK6Kr18O8fQquUEZYqinmadhEXJT7UQ IuZzsaiv6/2bVd6NDJAhnpojOpvjDqk3D7d4vOL7rGBQnOHXkdOmknPRiJmHQ/jKD5Ro ndBqWYspeNvLBuBVIM87nSxo9lxqoN7mS/ngUYAlPEb9/aIU9uqsRogbTbti3HupFp7G NScQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=ky+LkOLJvLz7GQrqNxbqax/IF2ZqOBtCIPZVaij14hc=; b=e37KdPp0BrV9epcWP0w360UrycYSl8ASGjJAmtcHrT1tXOTdF/XGCS5t4l2mxsUGIN wgHSTt0+OWN/0Q+jcc/o0pig1P/EcgKTnVYv1prfAfHOxA8daa2oULN4zibLPOk3QkAV 7tjZUMtXJ3x4AEF1G5qewsAxOLhR525gZyJ3QesUL2q87HSxiXkMjHlZmC08Qw30thsa NPN5LH6ownIRjD4J9neiD2yMQ0BW5ofDWu4wqISgvRPP4CoKdzcLtQOhtlOSloe8Kh2M AzogsHooSLYQnRX2Mem8wZPjn/Ao6F7K6T/CDVIP6zpxGDwnLbSc9b0oyuae2Aph2Jwm xKKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=CouozuWh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p23si7581617eju.435.2019.10.08.05.06.45; Tue, 08 Oct 2019 05:06:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=CouozuWh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730981AbfJHMGo (ORCPT + 26 others); Tue, 8 Oct 2019 08:06:44 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:28282 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730719AbfJHMGn (ORCPT ); Tue, 8 Oct 2019 08:06:43 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id x98C6135021176; Tue, 8 Oct 2019 21:06:03 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com x98C6135021176 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1570536363; bh=ky+LkOLJvLz7GQrqNxbqax/IF2ZqOBtCIPZVaij14hc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CouozuWhUbGuiISjMHzx2mHgMpE1ijsXTbEu0z88EKiN2NIg+GP4wXu7zejtJufXU VdslYdQ6cSgR1rY5hOEVSwTz1Abl5LdojENGoCg79DJjhwL2ni9zz7SlTUYnNdTfql ZgO3f+ze824TMw60Msc3GXYj9czZVPev3B1BVTtvqagNORSkHIcsC2nQztuDbU5V2i H8rUguRBm7+6f03ywI9FNe2Z1/hNTj0D6aWHZ3PVdHefZ485eX+RPIYh0zveXJlz8L SpQwkuXA+wRtsDlrYXJcMuesotxo/q+jFphzS2+7D6eB/u0kMDclL6GSCtgNVcJAqO rFFbYC5xduR8w== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Greg KH , Joel Fernandes , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 3/5] kheaders: optimize header copy for in-tree builds Date: Tue, 8 Oct 2019 21:05:54 +0900 Message-Id: <20191008120556.4263-3-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191008120556.4263-1-yamada.masahiro@socionext.com> References: <20191008120556.4263-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This script copies headers by the cpio command twice; first from srctree, and then from objtree. However, when we building in-tree, we know the srctree and the objtree are the same. That is, all the headers copied by the first cpio are overwritten by the second one. Skip the first cpio when we are building in-tree. Signed-off-by: Masahiro Yamada --- kernel/gen_kheaders.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) -- 2.17.1 diff --git a/kernel/gen_kheaders.sh b/kernel/gen_kheaders.sh index 5f8e664977f8..dd40a1b86f96 100755 --- a/kernel/gen_kheaders.sh +++ b/kernel/gen_kheaders.sh @@ -56,14 +56,16 @@ fi rm -rf $cpio_dir mkdir $cpio_dir -pushd $srctree > /dev/null -for f in $dir_list; - do find "$f" -name "*.h"; -done | cpio --quiet -pd $cpio_dir -popd > /dev/null +if [ "$building_out_of_srctree" ]; then + pushd $srctree > /dev/null + for f in $dir_list + do find "$f" -name "*.h"; + done | cpio --quiet -pd $cpio_dir + popd > /dev/null +fi -# The second CPIO can complain if files already exist which can -# happen with out of tree builds. Just silence CPIO for now. +# The second CPIO can complain if files already exist which can happen with out +# of tree builds having stale headers in srctree. Just silence CPIO for now. for f in $dir_list; do find "$f" -name "*.h"; done | cpio --quiet -pd $cpio_dir >/dev/null 2>&1