From patchwork Fri Mar 16 02:18:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 131892 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp179272ljb; Thu, 15 Mar 2018 19:20:17 -0700 (PDT) X-Google-Smtp-Source: AG47ELsYx3wYIVr7SVyEYy5Q9LciktVG79id3pQYt2NfL1Y+VNu63QITlDsQOARdcHt1tg2qW0gw X-Received: by 2002:a17:902:467:: with SMTP id 94-v6mr135313ple.57.1521166817695; Thu, 15 Mar 2018 19:20:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521166817; cv=none; d=google.com; s=arc-20160816; b=BBOtUPrk0RZQIZF5Yo2USrrJs7qlp/DhDQAaR3gPxo+V1qU+mM0d05HqubhFbTslm8 /QVkoc+OnZywMMIBctTfPfEruKi1snsaj2ZNDqGJCzDIltjfFc7BLD+tx5PU9a2mLbH8 e4gvHygy9xgf6WCkwmrNCDHrLJ/v1NhWZkZ1NJCAGfP5nAa6QtIWnOD1HPX65Y6gcQPA K9sKM6LSxlqq4c8xVR6nVMNgAe9dic7PjYd5JaThvkA8yfbgWuZ9zaNCq5wd2xqo9EYH fzGkNgNgJUfmIUjtxBK4DNJu9jsDlCGxGf/zaPuKb1/WGouDGw5N72CG77VbXggkNtEw ijgw== 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 :arc-authentication-results; bh=FMc5ISQq3Wqcof85BwCOVAnKD4mcS8lkRVtAQZaTko8=; b=uJnb6DnlNdsq+VNSUh8tWf7jSYUwkH8fsZ9Uu3MMbaXqjuYJ6zfGpOJ+hwIqgT23oW 1y97bzVXbjl9+sw9RTBcfVyAYgbHcbVp/f0Z4cQwb0T6UEGbegiKSW0SrDNtMsEzB1OL lNT56Cpca9j+8LH34FiT1cXVAXUDoitRtQqDAueCVfs57yD3qrmQgy4cVi1ypmnPukzA GwaU6/lgsH84CNo3uWTdJ90IBunbU/lkx/ZE4nbzK33Jif94Cnd/STJ+qDhrEvTuUMmJ 9a+FvJK82MYHs9P05zIAl/HeWGxUdRJP4dNfazsZ3mTUKaRicgTe7Jiwst2sy8dTwaTJ 2SPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=KaLOrag7; 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 c12-v6si5226852plo.278.2018.03.15.19.20.17; Thu, 15 Mar 2018 19:20:17 -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=KaLOrag7; 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 S1753002AbeCPCUA (ORCPT + 28 others); Thu, 15 Mar 2018 22:20:00 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:44537 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752816AbeCPCTM (ORCPT ); Thu, 15 Mar 2018 22:19:12 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id w2G2IoBQ003525; Fri, 16 Mar 2018 11:18:54 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com w2G2IoBQ003525 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1521166734; bh=FMc5ISQq3Wqcof85BwCOVAnKD4mcS8lkRVtAQZaTko8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KaLOrag77Rr5asTNF7iSMB7njEu3VDi1I7khGTgoSZ8vGQjop0Qr3LS+7DySQiirH TjCLqnl56RtncRjA7llW0rCAay7YluLqhNkEUGmU76Q4oqxdMvtgnjMj4Ebo16/WFu neMIkPHvt77GhlO/5D9VmpLi1ejT4BxZSdKJWLzR/ZKWzbF817b5dgRxKI0oA0PweI XcLoGhGOYrvVdf9i2i3AL/JRY/Rr4ybas5hAYIkskwx6bfliwSPFXjTjBvN5M2vzZr ZD2+oo3T5nRAwK0JRpSKpghjrMECntsvtXi3DLfA5lGI+wMTVubLfdFY1XBM+P87Ck tBLdGHVnFuSBQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Nicolas Pitre , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH v2 5/7] kbuild: move CONFIG_TRIM_UNUSED_KSYMS code unneeded for external module Date: Fri, 16 Mar 2018 11:18:42 +0900 Message-Id: <1521166725-24157-6-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521166725-24157-1-git-send-email-yamada.masahiro@socionext.com> References: <1521166725-24157-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The external module building does not need to parse this code because KBUILD_MODULES is always set anyway. Move this code inside the "ifeq ($(KBUILD_EXTMOD),) ... endif" block. Signed-off-by: Masahiro Yamada Acked-by: Nicolas Pitre --- Changes in v2: None Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) -- 2.7.4 diff --git a/Makefile b/Makefile index 0a3895c..ef42adb 100644 --- a/Makefile +++ b/Makefile @@ -614,13 +614,6 @@ else include/config/auto.conf: ; endif # $(dot-config) -# For the kernel to actually contain only the needed exported symbols, -# we have to build modules as well to determine what those symbols are. -# (this can be evaluated only once include/config/auto.conf has been included) -ifdef CONFIG_TRIM_UNUSED_KSYMS - KBUILD_MODULES := 1 -endif - # The all: target is the default when no target is given on the # command line. # This allow a user to issue only 'make' to build a kernel including modules @@ -1021,6 +1014,13 @@ ifdef CONFIG_TRIM_UNUSED_KSYMS "$(MAKE) -f $(srctree)/Makefile vmlinux" endif +# For the kernel to actually contain only the needed exported symbols, +# we have to build modules as well to determine what those symbols are. +# (this can be evaluated only once include/config/auto.conf has been included) +ifdef CONFIG_TRIM_UNUSED_KSYMS + KBUILD_MODULES := 1 +endif + autoksyms_h := $(if $(CONFIG_TRIM_UNUSED_KSYMS), include/generated/autoksyms.h) $(autoksyms_h):