From: Nicholas Piggin <npiggin@gmail.com>
To: Michal Marek <mmarek@suse.com>
Cc: Nicholas Piggin <npiggin@gmail.com>, linux-kbuild@vger.kernel.org
Subject: [PATCH 2/7] kbuild: thin archives for multi-y targets
Date: Thu, 24 Nov 2016 03:41:38 +1100 [thread overview]
Message-ID: <20161123164143.16839-3-npiggin@gmail.com> (raw)
In-Reply-To: <20161123164143.16839-1-npiggin@gmail.com>
THIN_ARCHIVES builds archives for built-in.o targets, have it build
multi-y targets as archives as well.
This saves another ~15% of the size of intermediate artifacts in the
build tree. After this patch, the linker is only used in final link,
and special cases like vdsos.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
scripts/Makefile.build | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 7675d11..41d2901 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -517,11 +517,18 @@ $($(subst $(obj)/,,$(@:.o=-objs))) \
$($(subst $(obj)/,,$(@:.o=-y))) \
$($(subst $(obj)/,,$(@:.o=-m)))), $^)
-quiet_cmd_link_multi-y = LD $@
-cmd_link_multi-y = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps) $(cmd_secanalysis)
+cmd_link_multi-link = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps) $(cmd_secanalysis)
+
+ifdef CONFIG_THIN_ARCHIVES
+ quiet_cmd_link_multi-y = AR $@
+ cmd_link_multi-y = rm -f $@; $(AR) rcST$(KBUILD_ARFLAGS) $@ $(link_multi_deps)
+else
+ quiet_cmd_link_multi-y = LD $@
+ cmd_link_multi-y = $(cmd_link_multi-link)
+endif
quiet_cmd_link_multi-m = LD [M] $@
-cmd_link_multi-m = $(cmd_link_multi-y)
+cmd_link_multi-m = $(cmd_link_multi-link)
$(multi-used-y): FORCE
$(call if_changed,link_multi-y)
--
2.10.2
next prev parent reply other threads:[~2016-11-23 16:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-23 16:41 [PATCH 0/7] kbuild patches for 4.10 Nicholas Piggin
2016-11-23 16:41 ` [PATCH 1/7] kbuild: kallsyms allow 3-pass generation if symbols size has changed Nicholas Piggin
2016-11-23 16:41 ` Nicholas Piggin [this message]
2016-11-23 16:41 ` [PATCH 3/7] kbuild/genksyms: handle va_list type Nicholas Piggin
2016-11-23 16:41 ` [PATCH 4/7] kbuild: improve linker compatibility with lib-ksyms.o build Nicholas Piggin
2016-11-23 16:41 ` [PATCH 5/7] kbuild: keep data tables through dead code elimination Nicholas Piggin
2016-11-23 16:41 ` [PATCH 6/7] kbuild: modpost warn if export version crc is missing Nicholas Piggin
2016-11-23 16:41 ` [PATCH 7/7] kbuild: minor improvement for thin archives build Nicholas Piggin
2016-11-29 21:25 ` [PATCH 0/7] kbuild patches for 4.10 Michal Marek
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=20161123164143.16839-3-npiggin@gmail.com \
--to=npiggin@gmail.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=mmarek@suse.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.