From patchwork Fri Mar 16 07:37:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 131909 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp410927ljb; Fri, 16 Mar 2018 00:38:24 -0700 (PDT) X-Google-Smtp-Source: AG47ELseNB6Q4/oxADmAl6SHyS7/L7eMb+4IpaCi82tKBc9EmfMJB0zdHdBqHNtDrR4TApDV6/6I X-Received: by 2002:a17:902:9883:: with SMTP id s3-v6mr1008516plp.96.1521185904321; Fri, 16 Mar 2018 00:38:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521185904; cv=none; d=google.com; s=arc-20160816; b=DXresgh2ljVAB7kW5SwJvlqJJp59+/eGyh1dNWMJqLS5PSyGiU5aJiCY9gKbR2g83Y rQtdBgavTK19QNKAa73dsfP0KmEpsfJd0jiIYfWDCfP6pg42z7urQI21iy7P+QibkgX8 w9Uhs/aJ8kazVTLdhy3IkzYeAxlcpkRX/NdG8L7Opjh1UbzZJDvN7kwuej4f9sHAWLyU nYySY9lYzkjZt0O/7PvqlAePbIPK39s2T5SFsK0YJxmw5z8tDlkThsac5oBGCtBepF/n QEeeM8ovI2MXrTZMjoUhNOIXqJdK8Hm0B+nSDyw5bRKwcs5Gz0sF1M0zXZDQaHTYmXlj OxHQ== 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=LTTmDVWw9/LAG4oNtj9HKP8SIxORv/BrT22sC5t44AI=; b=KXN+cJN4/xKLg/yIDpv6hwmRtUj4nfB2VeWWbgCGzW6CR8IFb9ah8mNJ+LDEX3xGiX vZWEIi/B8dXTe5HaHCSlimGayj97wtPHeHzJ301LAe/w088Bj3Qe+uXSuHOyImKzkVAu IlfldfJyCZHfIoXhyda8lmLD+xSZGApWHureALcztMu/t/DfLZC43som47C8Fkn2E7R5 1i/fFf7nkn9PCwiQG/5D0rx4I1LY9xnTy1+Tx4FCYKRCohgvaRPYP+Bn2U5kdtggeNsm ZchkVPA6axMc/Sk7BpDgbp/EVWdHAzgmT4LztGeNymC06sLlO56hRlxJw3zlz/wHtdk+ uzIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=w68Fdzqh; 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 n27si5163422pfg.102.2018.03.16.00.38.24; Fri, 16 Mar 2018 00:38:24 -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=w68Fdzqh; 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 S1753423AbeCPHiU (ORCPT + 28 others); Fri, 16 Mar 2018 03:38:20 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:20830 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753209AbeCPHhs (ORCPT ); Fri, 16 Mar 2018 03:37:48 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id w2G7bOa8029139; Fri, 16 Mar 2018 16:37:29 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com w2G7bOa8029139 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1521185850; bh=LTTmDVWw9/LAG4oNtj9HKP8SIxORv/BrT22sC5t44AI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w68FdzqhF2AUX3l9P6Pp4Znh2DvQu4jpzfu7SuX4LTButiHlJw83fyr5DkcF5xcsC ZWrsvur0ZVmwQrhZINrL+P0ZtLUVo2rXUFU31GrjBUDWg30Slxgy5gQCQT5lRHnAHf XeEDsdoOO5M+L1r5SxPVv4L6r9ShRrKlFqYb/r+h9jQkq+QwmcWPf3qXvJ27OTRrBF qWKHyHXvox2qROokPPdptfQc15t9zhYEQXhCpwo28oVDxZz1BG+tErp8+akA1wkPGV X6aJPxbNCnHyvGSpZDk5NDEEYnQRjpzFPMLFmr7mjfvciyzQysw1apjvAum+VIt+n+ JxZAMv9Bmirzw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Michal Marek , Nicolas Pitre , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH v4 5/7] kbuild: move CONFIG_TRIM_UNUSED_KSYMS code unneeded for external module Date: Fri, 16 Mar 2018 16:37:13 +0900 Message-Id: <1521185836-19120-6-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521185836-19120-1-git-send-email-yamada.masahiro@socionext.com> References: <1521185836-19120-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 v4: None Changes in v3: None 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):