Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1633449 > unrolled thread

[PATCH] Makefile: evaluate LDFLAGS_BUILD_ID only once

Started byRabin Vincent <rabin@rab.in>
First post2017-04-30 18:20 +0200
Last post2017-05-03 06:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] Makefile: evaluate LDFLAGS_BUILD_ID only once Rabin Vincent <rabin@rab.in> - 2017-04-30 18:20 +0200
    Re: [PATCH] Makefile: evaluate LDFLAGS_BUILD_ID only once Masahiro Yamada <yamada.masahiro@socionext.com> - 2017-05-03 06:50 +0200

#1633449 — [PATCH] Makefile: evaluate LDFLAGS_BUILD_ID only once

FromRabin Vincent <rabin@rab.in>
Date2017-04-30 18:20 +0200
Subject[PATCH] Makefile: evaluate LDFLAGS_BUILD_ID only once
Message-ID<tBZJL-5nM-7@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1634734

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2017-05-03 06:50 +0200
Message-ID<tCUoF-8jC-1@gated-at.bofh.it>
In reply to#1633449
2017-05-01 1:16 GMT+09:00 Rabin Vincent <rabin@rab.in>:
> 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>


Applied to linux-kbuild/kbuild.  Thanks!


-- 
Best Regards
Masahiro Yamada

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web