Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp880629ybv; Fri, 7 Feb 2020 10:09:30 -0800 (PST) X-Google-Smtp-Source: APXvYqyp/yHiGHFRDVei3XnXhB9H28KW8xN4HnoctnvZwU/hlTWD01METaLUd9hLeMfNTUcC4gky X-Received: by 2002:a05:6830:1e64:: with SMTP id m4mr501329otr.244.1581098970023; Fri, 07 Feb 2020 10:09:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581098970; cv=none; d=google.com; s=arc-20160816; b=KG7+nwy/lbJLmwj3wxJt+/qLsYxf4O2TqyXqPEjBEd9JOmeJHoLtA9ZlIWTGChRNkC 6uYE9WnA1rziBk/aEubkG8af86PrJxgA80NV0rGq1gbUckEXXfXW+I6sGJp/gcqt5i5I sAj6JCHamyaXKfsIX+BWt0/40PSa2ns5V0HuyukeKrLGSQdumBgyyAf58GlJzZiiJWVn Z5I7WN3x929iQoWZGQmQLGqM2yY+6VtP4Ty+rBOCYYXOTNRjbSYJSomBNfSECXOVXAIU A97GDk7C+Z3CWQ4n7LIoi2L72OsMIKdwP9wj3AIX9TDP94b2ksD6KJHXUFTm3xCHzz3R 5ZQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:references :mime-version:message-id:in-reply-to:date:dkim-signature; bh=Wx4Lk/qcxkAc1kcfbOM2JJx2GgJH5oSaDPZKdVYKXDQ=; b=ecOgsSB4va9cSWfIP+sJ85Ikc5dq8RS/8dYcoKAuatU0JRF5OuNg7idz6GmkDr/HAW ZNlHSPieVfGqOK50d2TTYbUXvYhyoFdoZxgggTy25gd4yEexN5ynDMV20HHrHH4qugr3 KfnnE2J8JJSg4RLnyOXhRkFXzIcoQ+HFzsABsgkEh6+7Kp5MpM6ufGlUNrUG/syo6jlw zeI00xYcR5B4Tl3BfKeM4+Y2rEiMNOzJ7mZG+oAyp1T+8cNuNVY1O4404VPc+RbbKGyu w5aY0UolQPtmXTuDULNzKMfurAzgD57UWth6hwxrsN4Ij7zjmlm0gJAc1U7+XRWtFIG2 C3yQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=hsaTlcgJ; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a14si26312otk.2.2020.02.07.10.09.17; Fri, 07 Feb 2020 10:09:30 -0800 (PST) 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=@google.com header.s=20161025 header.b=hsaTlcgJ; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727514AbgBGSIM (ORCPT + 99 others); Fri, 7 Feb 2020 13:08:12 -0500 Received: from mail-wr1-f74.google.com ([209.85.221.74]:53663 "EHLO mail-wr1-f74.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726900AbgBGSIJ (ORCPT ); Fri, 7 Feb 2020 13:08:09 -0500 Received: by mail-wr1-f74.google.com with SMTP id n23so31107wra.20 for ; Fri, 07 Feb 2020 10:08:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=Wx4Lk/qcxkAc1kcfbOM2JJx2GgJH5oSaDPZKdVYKXDQ=; b=hsaTlcgJklMNfzJzHRvB7XaB+Bo8T0xIMM7/acRqZePCPIKvupjLpYefjqxv9yoFO6 WWiTwjuMre7mvLufstCGVegdG6Aj+4LcNyaePrMvemmZWU1G++lXYPVvZ7I9uwMOEz/H tEJ32T7SwGkHfktmjDK+BUOPHj0o5Q9YDdefdBJrpfsf6D8suxdXEMRC5HDIQWgzCYyQ U35j+tIlY1gOzgnZjn/gv5S9dKbVG1nz0Y7iNE1t0AwhHb8zVb22XlytQDFTBIV6GB+o CAPI45vnT/YOqcP+luRy1W9yjxhSYcQN8hLJrszPQt91NXkUgQwZN0ao2jLoFBXt3LQN FctQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=Wx4Lk/qcxkAc1kcfbOM2JJx2GgJH5oSaDPZKdVYKXDQ=; b=rXS4j+wO+HBskQhq3HO82DtFurmqIpca+FaTZ5LTpN6MABmN4ro/FT4Vr2PB2rhktQ pSYhQ/+heKM0VpLnnqlD3jO2nW/dmfMjun0AQihy8OKG8wDQ2wyBgKVyv3jQddyQACl8 SVdtf0r9wpCgysGZCsf6q+JNGO2QNj3+IdIcrsecinzJ5zfHDfusE1xl54I1zC+ePz5E QZRz319aabwmYEH6QvLvGaLiQlHxuI7RTurKMJqE9q9mXDVpSz1QrU/xNWFAhrOZjXy9 Pf+BiyBMJ/fUjg7OmfhXy+WbtE6qPnhneT8HVYtaH50rEIS325d+Oe/bYf1OSS78mGAv 2Jfg== X-Gm-Message-State: APjAAAUtEU4JL2WTcCqZGUN9Of+oxqCu8EdqyuS6F0ugkPzs/nyjip9J BY7a0IZRbMYNU1v4O05LUsnWb9NWIgHh X-Received: by 2002:a5d:540f:: with SMTP id g15mr258451wrv.86.1581098887238; Fri, 07 Feb 2020 10:08:07 -0800 (PST) Date: Fri, 7 Feb 2020 18:07:55 +0000 In-Reply-To: <20200207180755.100561-1-qperret@google.com> Message-Id: <20200207180755.100561-4-qperret@google.com> Mime-Version: 1.0 References: <20200207180755.100561-1-qperret@google.com> X-Mailer: git-send-email 2.25.0.341.g760bfbb309-goog Subject: [PATCH v3 3/3] kbuild: generate autoksyms.h early From: Quentin Perret To: masahiroy@kernel.org, nico@fluxnic.net Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, maennich@google.com, kernel-team@android.com, jeyu@kernel.org, hch@infradead.org, qperret@google.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When doing a cold build, autoksyms.h starts empty, and is updated late in the build process to have visibility over the symbols used by in-tree drivers. But since the symbol whitelist is known upfront, it can be used to pre-populate autoksyms.h and maximize the amount of code that can be compiled to its final state in a single pass, hence reducing build time. Do this by using gen_autoksyms.sh to initialize autoksyms.h instead of creating an empty file. Signed-off-by: Quentin Perret --- Makefile | 2 +- scripts/gen_autoksyms.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 6a01b073915e..e5c389d189f7 100644 --- a/Makefile +++ b/Makefile @@ -1065,7 +1065,7 @@ autoksyms_h := $(if $(CONFIG_TRIM_UNUSED_KSYMS), include/generated/autoksyms.h) $(autoksyms_h): $(Q)mkdir -p $(dir $@) - $(Q)touch $@ + $(Q)$(CONFIG_SHELL) $(srctree)/scripts/gen_autoksyms.sh $@ ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink) diff --git a/scripts/gen_autoksyms.sh b/scripts/gen_autoksyms.sh index ce0919c3791a..ae033ab03a4a 100755 --- a/scripts/gen_autoksyms.sh +++ b/scripts/gen_autoksyms.sh @@ -32,7 +32,8 @@ cat > "$output_file" << EOT EOT -sed 's/ko$/mod/' modules.order | +[[ -f modules.order ]] && modlist=modules.order || modlist=/dev/null +sed 's/ko$/mod/' $modlist | xargs -n1 sed -n -e '2{s/ /\n/g;/^$/!p;}' -- | cat - "$ksym_wl" | sort -u | -- 2.25.0.341.g760bfbb309-goog