linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kbuild: reuse vmlinux.o in vmlinux_link
@ 2020-05-21 20:27 Sami Tolvanen
  2020-05-21 22:08 ` Kees Cook
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Sami Tolvanen @ 2020-05-21 20:27 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek
  Cc: Kees Cook, linux-kbuild, linux-kernel, Sami Tolvanen

Instead of linking all compilation units again each time vmlinux_link is
called, reuse vmlinux.o from modpost_link.

With x86_64 allyesconfig, vmlinux_link is called three times and reusing
vmlinux.o reduces the build time ~38 seconds on my system (59% reduction
in the time spent in vmlinux_link).

Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
---
 scripts/link-vmlinux.sh | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
index d09ab4afbda4..c6cc4305950c 100755
--- a/scripts/link-vmlinux.sh
+++ b/scripts/link-vmlinux.sh
@@ -77,11 +77,8 @@ vmlinux_link()
 
 	if [ "${SRCARCH}" != "um" ]; then
 		objects="--whole-archive			\
-			${KBUILD_VMLINUX_OBJS}			\
+			vmlinux.o				\
 			--no-whole-archive			\
-			--start-group				\
-			${KBUILD_VMLINUX_LIBS}			\
-			--end-group				\
 			${@}"
 
 		${LD} ${KBUILD_LDFLAGS} ${LDFLAGS_vmlinux}	\

base-commit: b85051e755b0e9d6dd8f17ef1da083851b83287d
-- 
2.27.0.rc0.183.gde8f92d652-goog


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-06-16  3:23 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-21 20:27 [PATCH] kbuild: reuse vmlinux.o in vmlinux_link Sami Tolvanen
2020-05-21 22:08 ` Kees Cook
2020-05-22 18:16   ` Masahiro Yamada
2020-05-21 22:18 ` Kees Cook
2020-05-22 17:41 ` Masahiro Yamada
2020-05-22 17:44   ` Masahiro Yamada
2020-05-23 10:06     ` Nicholas Piggin
2020-05-23 15:12       ` Masahiro Yamada
2020-05-23 16:53         ` Sam Ravnborg
2020-05-25  6:13           ` Masahiro Yamada
2020-06-15 21:47         ` Sami Tolvanen
2020-06-16  3:22           ` Masahiro Yamada

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).