From patchwork Wed Mar 14 16:44:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 131666 Delivered-To: patch@linaro.org Received: by 10.80.210.197 with SMTP id q5csp396769edg; Wed, 14 Mar 2018 09:46:32 -0700 (PDT) X-Google-Smtp-Source: AG47ELuam4StOxI5AJd8AQCtHqr38gsAyXFQQpaE99lYfQEiSRo4N07dkoHIuKFSW/LlnE4RatzP X-Received: by 10.101.77.201 with SMTP id q9mr4157277pgt.395.1521045992554; Wed, 14 Mar 2018 09:46:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521045992; cv=none; d=google.com; s=arc-20160816; b=VNFNwcnTiwz9RPmAEsKpAfkVVdXHzABpO4itojCXELqLXXpPPMgzOulCCED0m9YsSw 6cd8ZLTOmN+c71gETmG5frkplA6yKzM5Aslmf8KFfpZgLYtcHIpARW43egIb5N7dfyJU qV3Pcci0ymJft4rfDE6ZI0FJCFh6DeO/3oLq+u79wCqmJ9QO25A/Y5P4mqtB0ogXeYd8 A/nhVpyW1/69n1SH4Qj/FH8y/hFFJ6ORAQHinPp7+cxutHgJI982w63pYlupXZDslv81 BewkmYc7ipqXfKOaODPOPE13XHH6jx97haCEwLKuPWX7Q0AnhqIvlPiYMiFam84AYV4f cQxA== 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=TIXfCUdZkS5aRgqp+isLNSormzEPrcpuAah9T7fOvkQ=; b=DLu/HsWebCdfIFJjnTl0zDcmyN2J0Nqyj5mzJoFRyRclcpv+lutqG2/e/fKjipip0a tjTN39PsHoCUZ5ntGR3YeCY2X3Q6KAu+lceqD0FQxlHJb2lfMSU8xe7Wh1282IIE0aIl BbP2DhqFysPmrKXVI3ziCQfJPfqzD3WW/wdRac6XuEbbpG4rFCV0RZhebQlp21fOKT8e XyOowDvxH8D4R48tbGgSjtEDN4BsyJR9WWOch8nB0wah5d00ev1N7pIVQagVp5vy/gxw 2zT1jqUCGvqxXpLplANwiwJ8Cx3tQ8YdvxIuLs05OD1Ou7dGmGg3qXycTe6Me9GZ52h/ tWyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=woFL4XaZ; 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 z13si2300285pfh.217.2018.03.14.09.46.32; Wed, 14 Mar 2018 09:46:32 -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=woFL4XaZ; 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 S1751456AbeCNQpp (ORCPT + 28 others); Wed, 14 Mar 2018 12:45:45 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:38068 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752011AbeCNQou (ORCPT ); Wed, 14 Mar 2018 12:44:50 -0400 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-07.nifty.com with ESMTP id w2EGiSdU001049; Thu, 15 Mar 2018 01:44:31 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com w2EGiSdU001049 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1521045872; bh=TIXfCUdZkS5aRgqp+isLNSormzEPrcpuAah9T7fOvkQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=woFL4XaZpzRnO909Xx4xLprKvdYlnDO8uwuYyDA7MDTqfGnkBJafr4IMsGbBJ6kN/ eUBjLiJv5xchFY9DCUh4DX59i8nXdhHy0hCzCw89Wn+YmJoWmLtpMCgXBPG7qV3dPk a9Vru4bLP5dkS7wwi106mrBO3Q6oVuvkEpzZAz19M/Zrf9gx1WuydMlqzjszHANGpX ulNMgQESb9/TFJuMVqU3sV5+1ltVmqRSS1YIROkJ6ZOis0aUUnOWMMOIK9bdEEbRjj fE6zwKGL1ujN1IlYQupkAicoWaom2mrBeywVTx7GoCOS/fnp1KHD4YCdi6iqVFex38 CzZBUWzyTbOqw== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Nicolas Pitre , Jarod Wilson , Prarit Bhargava , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 5/7] kbuild: hide CONFIG_TRIM_UNUSED_KSYMS code from external module building Date: Thu, 15 Mar 2018 01:44:19 +0900 Message-Id: <1521045861-22418-6-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521045861-22418-1-git-send-email-yamada.masahiro@socionext.com> References: <1521045861-22418-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 If CONFIG_TRIM_UNUSED_KYMS is enabled, KBUILD_MODULES is set. This code is unneeded for external module building because KBUILD_MODULES is always set. Move this code inside "ifeq ($(KBUILD_EXTMOD),)" conditional. Signed-off-by: Masahiro Yamada --- Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) -- 2.7.4 Acked-by: Nicolas Pitre diff --git a/Makefile b/Makefile index decc870..e60b16f 100644 --- a/Makefile +++ b/Makefile @@ -603,13 +603,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 @@ -1010,6 +1003,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):