diff mbox

build: avoid evaluating cc-ifversion for ever objtool invocation

Message ID 20180709082036.11190-1-johannes@sipsolutions.net (mailing list archive)
State New, archived
Headers show

Commit Message

Johannes Berg July 9, 2018, 8:20 a.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

To speed up the build a little bit, avoid evaluating cc-ifversion for
every objtool invocation. The variable needs to be evaluated every
time it's used because of the $(if $(part-of-module)...) in it, but
we don't need to call out to the compiler to get its version every
time.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 scripts/Makefile.build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index e7889f486ca1..4f4557bc96f0 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -257,7 +257,8 @@  endif
 ifdef CONFIG_GCOV_KERNEL
 objtool_args += --no-unreachable
 else
-objtool_args += $(call cc-ifversion, -lt, 0405, --no-unreachable)
+_no_unreachable_lt_0405 := $(call cc-ifversion, -lt, 0405, --no-unreachable)
+objtool_args += $(_no_unreachable_lt_0405)
 endif
 ifdef CONFIG_RETPOLINE
 ifneq ($(RETPOLINE_CFLAGS),)