From: Rabin Vincent <rabin@rab.in>
To: yamada.masahiro@socionext.com, mmarek@suse.com
Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
Rabin Vincent <rabin@rab.in>
Subject: [PATCH] Makefile: evaluate LDFLAGS_BUILD_ID only once
Date: Sun, 30 Apr 2017 18:16:00 +0200 [thread overview]
Message-ID: <20170430161600.15845-1-rabin@rab.in> (raw)
Evaluate LDFLAGS_BUILD_ID (which involves invoking the compiler) only
once instead of over and over.
This provides a ~20% reduction in null build time with x86 allnoconfig:
$ make allnoconfig && make -j8
$ perf stat -r5 -e sched:sched_process_exec make -j8
- 2 119 sched:sched_process_exec
+ 1 878 sched:sched_process_exec
- 1,238817018 seconds time elapsed
+ 0,971020553 seconds time elapsed
Signed-off-by: Rabin Vincent <rabin@rab.in>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 779302695453..c78a266594c1 100644
--- a/Makefile
+++ b/Makefile
@@ -815,7 +815,7 @@ KBUILD_AFLAGS += $(ARCH_AFLAGS) $(KAFLAGS)
KBUILD_CFLAGS += $(ARCH_CFLAGS) $(KCFLAGS)
# Use --build-id when available.
-LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\
+LDFLAGS_BUILD_ID := $(patsubst -Wl$(comma)%,%,\
$(call cc-ldoption, -Wl$(comma)--build-id,))
KBUILD_LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID)
LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID)
--
2.11.0
next reply other threads:[~2017-04-30 16:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-30 16:16 Rabin Vincent [this message]
2017-05-03 4:49 ` [PATCH] Makefile: evaluate LDFLAGS_BUILD_ID only once Masahiro Yamada
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=20170430161600.15845-1-rabin@rab.in \
--to=rabin@rab.in \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mmarek@suse.com \
--cc=yamada.masahiro@socionext.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.