From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: linux-kbuild@vger.kernel.org
Cc: Nicolas Pitre <nicolas.pitre@linaro.org>,
Jarod Wilson <jarod@redhat.com>,
Prarit Bhargava <prarit@redhat.com>,
Masahiro Yamada <yamada.masahiro@socionext.com>,
Michal Marek <michal.lkml@markovi.net>,
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 [thread overview]
Message-ID: <1521045861-22418-6-git-send-email-yamada.masahiro@socionext.com> (raw)
In-Reply-To: <1521045861-22418-1-git-send-email-yamada.masahiro@socionext.com>
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 <yamada.masahiro@socionext.com>
---
Makefile | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
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):
--
2.7.4
next prev parent reply other threads:[~2018-03-14 16:44 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-14 16:44 [PATCH 0/7] kbuild: various fix, clean-up, improvements of CONFIG_TRIM_UNUSED_KSYMS Masahiro Yamada
2018-03-14 16:44 ` [PATCH 1/7] kbuild: clear LDFLAGS in the top Makefile Masahiro Yamada
2018-03-14 16:44 ` [PATCH 2/7] kbuild: touch autoksyms.h when it is really missing Masahiro Yamada
2018-03-14 17:26 ` Nicolas Pitre
2018-03-15 6:26 ` Masahiro Yamada
2018-03-14 16:44 ` [PATCH 3/7] kbuild: move 'scripts' target below Masahiro Yamada
2018-03-16 7:13 ` kbuild test robot
2018-03-16 7:20 ` Masahiro Yamada
2018-03-14 16:44 ` [PATCH 4/7] kbuild: restore touching autoksyms.h to the top Makefile Masahiro Yamada
2018-03-14 17:52 ` Nicolas Pitre
2018-03-14 16:44 ` Masahiro Yamada [this message]
2018-03-14 18:32 ` [PATCH 5/7] kbuild: hide CONFIG_TRIM_UNUSED_KSYMS code from external module building Nicolas Pitre
2018-03-15 6:36 ` Masahiro Yamada
2018-03-15 18:30 ` Nicolas Pitre
2018-03-14 16:44 ` [PATCH 6/7] kbuild: move include/config/ksym/* to include/ksym/* Masahiro Yamada
2018-03-14 18:47 ` Nicolas Pitre
2018-03-15 10:04 ` Masahiro Yamada
2018-03-15 11:01 ` Masahiro Yamada
2018-03-15 18:59 ` Nicolas Pitre
2018-03-14 16:44 ` [PATCH 7/7] kbuild: link vmlinux just once for CONFIG_TRIM_UNUSED_KSYMS Masahiro Yamada
2018-03-14 19:06 ` Nicolas Pitre
2018-03-15 8:00 ` Masahiro Yamada
2018-03-15 18:50 ` Nicolas Pitre
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1521045861-22418-6-git-send-email-yamada.masahiro@socionext.com \
--to=yamada.masahiro@socionext.com \
--cc=jarod@redhat.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.lkml@markovi.net \
--cc=nicolas.pitre@linaro.org \
--cc=prarit@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).