Received: by 10.213.65.68 with SMTP id h4csp124414imn; Thu, 15 Mar 2018 19:52:33 -0700 (PDT) X-Google-Smtp-Source: AG47ELsxcxqf0NITeG97uWX1+Q/9tdcncXeRYKjVMuA3rECHsEzUAXIzTWl9xXsmI6C8chwWwwsa X-Received: by 10.101.101.217 with SMTP id y25mr142358pgv.165.1521168753058; Thu, 15 Mar 2018 19:52:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521168753; cv=none; d=google.com; s=arc-20160816; b=pqgJL/UZVXPhJSFG+YE68ZUSiWGDD9vMJLbBMno5MBPJPrWZGHYu3+StWcYZ74umjr 3UTErkGxpbPu+UG2JlaiQ6alLDV6V5MC2WFhCMmwHgE6/7u6VKEo8xbkJf1Y3bHCIAbd gEdUa49UaFIOKuYp6XT7lYPococtlhaG347Tupxd7sUfpGLxPsAA+9XAva/O+dxYYt9b 1xrAo32+rzQql3TSzQg9eSjX2JeZbQOtV49/7J2oe+1cSf7QnSFMzLFEELUMfiCXDFDJ xT46FYhsprUiShSQl9wuPBVd5fisVN0TWZxlcq+/+dKk7u5oM2jc7Wj9IY88/Cp2Ggbc NY2w== 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 a59-v6si5222930plc.123.2018.03.15.19.52.06; Thu, 15 Mar 2018 19:52:33 -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 S1752999AbeCPCUA (ORCPT + 99 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(-) 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): -- 2.7.4