aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.m@jp.panasonic.com>2014-12-25 00:31:24 -0500
committerMichal Marek <mmarek@suse.cz>2015-01-09 11:25:44 -0500
commit665d92e38f65d70796aad2b8e49e42e80815d4a4 (patch)
tree3328f014ac8a4a0a2ba9c24cdc1961d7407ef43a
parentdd33c03b18b3f2db791eb6a17c37d2de66e4de18 (diff)
kbuild: do not add $(call ...) to invoke cc-version or cc-fullversion
The macros cc-version, cc-fullversion and ld-version take no argument. It is not necessary to add $(call ...) to invoke them. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Helge Deller <deller@gmx.de> [parisc] Signed-off-by: Michal Marek <mmarek@suse.cz>
-rw-r--r--Documentation/kbuild/makefiles.txt4
-rw-r--r--arch/parisc/Makefile2
-rw-r--r--arch/powerpc/Makefile6
-rw-r--r--arch/x86/Makefile.um2
-rw-r--r--kernel/gcov/Makefile2
-rw-r--r--scripts/Kbuild.include7
6 files changed, 10 insertions, 13 deletions
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt
index a311db829e9b..7b3487a67476 100644
--- a/Documentation/kbuild/makefiles.txt
+++ b/Documentation/kbuild/makefiles.txt
@@ -524,7 +524,7 @@ more details, with real examples.
524 Example: 524 Example:
525 #arch/x86/Makefile 525 #arch/x86/Makefile
526 cflags-y += $(shell \ 526 cflags-y += $(shell \
527 if [ $(call cc-version) -ge 0300 ] ; then \ 527 if [ $(cc-version) -ge 0300 ] ; then \
528 echo "-mregparm=3"; fi ;) 528 echo "-mregparm=3"; fi ;)
529 529
530 In the above example, -mregparm=3 is only used for gcc version greater 530 In the above example, -mregparm=3 is only used for gcc version greater
@@ -552,7 +552,7 @@ more details, with real examples.
552 552
553 Example: 553 Example:
554 #arch/powerpc/Makefile 554 #arch/powerpc/Makefile
555 $(Q)if test "$(call cc-fullversion)" = "040200" ; then \ 555 $(Q)if test "$(cc-fullversion)" = "040200" ; then \
556 echo -n '*** GCC-4.2.0 cannot compile the 64-bit powerpc ' ; \ 556 echo -n '*** GCC-4.2.0 cannot compile the 64-bit powerpc ' ; \
557 false ; \ 557 false ; \
558 fi 558 fi
diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile
index 5db8882f732c..fc1aca379fe2 100644
--- a/arch/parisc/Makefile
+++ b/arch/parisc/Makefile
@@ -149,7 +149,7 @@ endef
149# we require gcc 3.3 or above to compile the kernel 149# we require gcc 3.3 or above to compile the kernel
150archprepare: checkbin 150archprepare: checkbin
151checkbin: 151checkbin:
152 @if test "$(call cc-version)" -lt "0303"; then \ 152 @if test "$(cc-version)" -lt "0303"; then \
153 echo -n "Sorry, GCC v3.3 or above is required to build " ; \ 153 echo -n "Sorry, GCC v3.3 or above is required to build " ; \
154 echo "the kernel." ; \ 154 echo "the kernel." ; \
155 false ; \ 155 false ; \
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 132d9c681d6a..fc502e042438 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -314,7 +314,7 @@ TOUT := .tmp_gas_check
314# - Require gcc 4.0 or above on 64-bit 314# - Require gcc 4.0 or above on 64-bit
315# - gcc-4.2.0 has issues compiling modules on 64-bit 315# - gcc-4.2.0 has issues compiling modules on 64-bit
316checkbin: 316checkbin:
317 @if test "$(call cc-version)" = "0304" ; then \ 317 @if test "$(cc-version)" = "0304" ; then \
318 if ! /bin/echo mftb 5 | $(AS) -v -mppc -many -o $(TOUT) >/dev/null 2>&1 ; then \ 318 if ! /bin/echo mftb 5 | $(AS) -v -mppc -many -o $(TOUT) >/dev/null 2>&1 ; then \
319 echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build '; \ 319 echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build '; \
320 echo 'correctly with gcc-3.4 and your version of binutils.'; \ 320 echo 'correctly with gcc-3.4 and your version of binutils.'; \
@@ -322,13 +322,13 @@ checkbin:
322 false; \ 322 false; \
323 fi ; \ 323 fi ; \
324 fi 324 fi
325 @if test "$(call cc-version)" -lt "0400" \ 325 @if test "$(cc-version)" -lt "0400" \
326 && test "x${CONFIG_PPC64}" = "xy" ; then \ 326 && test "x${CONFIG_PPC64}" = "xy" ; then \
327 echo -n "Sorry, GCC v4.0 or above is required to build " ; \ 327 echo -n "Sorry, GCC v4.0 or above is required to build " ; \
328 echo "the 64-bit powerpc kernel." ; \ 328 echo "the 64-bit powerpc kernel." ; \
329 false ; \ 329 false ; \
330 fi 330 fi
331 @if test "$(call cc-fullversion)" = "040200" \ 331 @if test "$(cc-fullversion)" = "040200" \
332 && test "x${CONFIG_MODULES}${CONFIG_PPC64}" = "xyy" ; then \ 332 && test "x${CONFIG_MODULES}${CONFIG_PPC64}" = "xyy" ; then \
333 echo -n '*** GCC-4.2.0 cannot compile the 64-bit powerpc ' ; \ 333 echo -n '*** GCC-4.2.0 cannot compile the 64-bit powerpc ' ; \
334 echo 'kernel with modules enabled.' ; \ 334 echo 'kernel with modules enabled.' ; \
diff --git a/arch/x86/Makefile.um b/arch/x86/Makefile.um
index 36b62bc52638..95eba554baf9 100644
--- a/arch/x86/Makefile.um
+++ b/arch/x86/Makefile.um
@@ -30,7 +30,7 @@ cflags-y += -ffreestanding
30# Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc use 30# Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc use
31# a lot more stack due to the lack of sharing of stacklots. Also, gcc 31# a lot more stack due to the lack of sharing of stacklots. Also, gcc
32# 4.3.0 needs -funit-at-a-time for extern inline functions. 32# 4.3.0 needs -funit-at-a-time for extern inline functions.
33KBUILD_CFLAGS += $(shell if [ $(call cc-version) -lt 0400 ] ; then \ 33KBUILD_CFLAGS += $(shell if [ $(cc-version) -lt 0400 ] ; then \
34 echo $(call cc-option,-fno-unit-at-a-time); \ 34 echo $(call cc-option,-fno-unit-at-a-time); \
35 else echo $(call cc-option,-funit-at-a-time); fi ;) 35 else echo $(call cc-option,-funit-at-a-time); fi ;)
36 36
diff --git a/kernel/gcov/Makefile b/kernel/gcov/Makefile
index 52aa7e8de927..6f01fa3d9ca1 100644
--- a/kernel/gcov/Makefile
+++ b/kernel/gcov/Makefile
@@ -21,7 +21,7 @@ else
21# is not available. We can probably move if-lt to Kbuild.include, so it's also 21# is not available. We can probably move if-lt to Kbuild.include, so it's also
22# not defined during clean or to include Kbuild.include in 22# not defined during clean or to include Kbuild.include in
23# scripts/Makefile.clean. But the following workaround seems least invasive. 23# scripts/Makefile.clean. But the following workaround seems least invasive.
24 cc-ver := $(if $(call cc-version),$(call cc-version),0) 24 cc-ver := $(if $(cc-version),$(cc-version),0)
25endif 25endif
26 26
27obj-$(CONFIG_GCOV_KERNEL) := base.o fs.o 27obj-$(CONFIG_GCOV_KERNEL) := base.o fs.o
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 34a87fc77f71..ddf0ebdc2ca8 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -129,17 +129,15 @@ cc-disable-warning = $(call try-run,\
129 $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1))) 129 $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1)))
130 130
131# cc-version 131# cc-version
132# Usage gcc-ver := $(call cc-version)
133cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC)) 132cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC))
134 133
135# cc-fullversion 134# cc-fullversion
136# Usage gcc-ver := $(call cc-fullversion)
137cc-fullversion = $(shell $(CONFIG_SHELL) \ 135cc-fullversion = $(shell $(CONFIG_SHELL) \
138 $(srctree)/scripts/gcc-version.sh -p $(CC)) 136 $(srctree)/scripts/gcc-version.sh -p $(CC))
139 137
140# cc-ifversion 138# cc-ifversion
141# Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1) 139# Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1)
142cc-ifversion = $(shell [ $(call cc-version) $(1) $(2) ] && echo $(3)) 140cc-ifversion = $(shell [ $(cc-version) $(1) $(2) ] && echo $(3))
143 141
144# cc-ldoption 142# cc-ldoption
145# Usage: ldflags += $(call cc-ldoption, -Wl$(comma)--hash-style=both) 143# Usage: ldflags += $(call cc-ldoption, -Wl$(comma)--hash-style=both)
@@ -157,13 +155,12 @@ ld-option = $(call try-run,\
157ar-option = $(call try-run, $(AR) rc$(1) "$$TMP",$(1),$(2)) 155ar-option = $(call try-run, $(AR) rc$(1) "$$TMP",$(1),$(2))
158 156
159# ld-version 157# ld-version
160# Usage: $(call ld-version)
161# Note this is mainly for HJ Lu's 3 number binutil versions 158# Note this is mainly for HJ Lu's 3 number binutil versions
162ld-version = $(shell $(LD) --version | $(srctree)/scripts/ld-version.sh) 159ld-version = $(shell $(LD) --version | $(srctree)/scripts/ld-version.sh)
163 160
164# ld-ifversion 161# ld-ifversion
165# Usage: $(call ld-ifversion, -ge, 22252, y) 162# Usage: $(call ld-ifversion, -ge, 22252, y)
166ld-ifversion = $(shell [ $(call ld-version) $(1) $(2) ] && echo $(3)) 163ld-ifversion = $(shell [ $(ld-version) $(1) $(2) ] && echo $(3))
167 164
168###### 165######
169 166