Commit 665d92e3 authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Michal Marek

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: default avatarMasahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Helge Deller <deller@gmx.de> [parisc]
Signed-off-by: default avatarMichal Marek <mmarek@suse.cz>
parent dd33c03b
...@@ -524,7 +524,7 @@ more details, with real examples. ...@@ -524,7 +524,7 @@ more details, with real examples.
Example: Example:
#arch/x86/Makefile #arch/x86/Makefile
cflags-y += $(shell \ cflags-y += $(shell \
if [ $(call cc-version) -ge 0300 ] ; then \ if [ $(cc-version) -ge 0300 ] ; then \
echo "-mregparm=3"; fi ;) echo "-mregparm=3"; fi ;)
In the above example, -mregparm=3 is only used for gcc version greater In the above example, -mregparm=3 is only used for gcc version greater
...@@ -552,7 +552,7 @@ more details, with real examples. ...@@ -552,7 +552,7 @@ more details, with real examples.
Example: Example:
#arch/powerpc/Makefile #arch/powerpc/Makefile
$(Q)if test "$(call cc-fullversion)" = "040200" ; then \ $(Q)if test "$(cc-fullversion)" = "040200" ; then \
echo -n '*** GCC-4.2.0 cannot compile the 64-bit powerpc ' ; \ echo -n '*** GCC-4.2.0 cannot compile the 64-bit powerpc ' ; \
false ; \ false ; \
fi fi
......
...@@ -149,7 +149,7 @@ endef ...@@ -149,7 +149,7 @@ endef
# we require gcc 3.3 or above to compile the kernel # we require gcc 3.3 or above to compile the kernel
archprepare: checkbin archprepare: checkbin
checkbin: checkbin:
@if test "$(call cc-version)" -lt "0303"; then \ @if test "$(cc-version)" -lt "0303"; then \
echo -n "Sorry, GCC v3.3 or above is required to build " ; \ echo -n "Sorry, GCC v3.3 or above is required to build " ; \
echo "the kernel." ; \ echo "the kernel." ; \
false ; \ false ; \
......
...@@ -314,7 +314,7 @@ TOUT := .tmp_gas_check ...@@ -314,7 +314,7 @@ TOUT := .tmp_gas_check
# - Require gcc 4.0 or above on 64-bit # - Require gcc 4.0 or above on 64-bit
# - gcc-4.2.0 has issues compiling modules on 64-bit # - gcc-4.2.0 has issues compiling modules on 64-bit
checkbin: checkbin:
@if test "$(call cc-version)" = "0304" ; then \ @if test "$(cc-version)" = "0304" ; then \
if ! /bin/echo mftb 5 | $(AS) -v -mppc -many -o $(TOUT) >/dev/null 2>&1 ; then \ if ! /bin/echo mftb 5 | $(AS) -v -mppc -many -o $(TOUT) >/dev/null 2>&1 ; then \
echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build '; \ echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build '; \
echo 'correctly with gcc-3.4 and your version of binutils.'; \ echo 'correctly with gcc-3.4 and your version of binutils.'; \
...@@ -322,13 +322,13 @@ checkbin: ...@@ -322,13 +322,13 @@ checkbin:
false; \ false; \
fi ; \ fi ; \
fi fi
@if test "$(call cc-version)" -lt "0400" \ @if test "$(cc-version)" -lt "0400" \
&& test "x${CONFIG_PPC64}" = "xy" ; then \ && test "x${CONFIG_PPC64}" = "xy" ; then \
echo -n "Sorry, GCC v4.0 or above is required to build " ; \ echo -n "Sorry, GCC v4.0 or above is required to build " ; \
echo "the 64-bit powerpc kernel." ; \ echo "the 64-bit powerpc kernel." ; \
false ; \ false ; \
fi fi
@if test "$(call cc-fullversion)" = "040200" \ @if test "$(cc-fullversion)" = "040200" \
&& test "x${CONFIG_MODULES}${CONFIG_PPC64}" = "xyy" ; then \ && test "x${CONFIG_MODULES}${CONFIG_PPC64}" = "xyy" ; then \
echo -n '*** GCC-4.2.0 cannot compile the 64-bit powerpc ' ; \ echo -n '*** GCC-4.2.0 cannot compile the 64-bit powerpc ' ; \
echo 'kernel with modules enabled.' ; \ echo 'kernel with modules enabled.' ; \
......
...@@ -30,7 +30,7 @@ cflags-y += -ffreestanding ...@@ -30,7 +30,7 @@ cflags-y += -ffreestanding
# Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc use # Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc use
# a lot more stack due to the lack of sharing of stacklots. Also, gcc # a lot more stack due to the lack of sharing of stacklots. Also, gcc
# 4.3.0 needs -funit-at-a-time for extern inline functions. # 4.3.0 needs -funit-at-a-time for extern inline functions.
KBUILD_CFLAGS += $(shell if [ $(call cc-version) -lt 0400 ] ; then \ KBUILD_CFLAGS += $(shell if [ $(cc-version) -lt 0400 ] ; then \
echo $(call cc-option,-fno-unit-at-a-time); \ echo $(call cc-option,-fno-unit-at-a-time); \
else echo $(call cc-option,-funit-at-a-time); fi ;) else echo $(call cc-option,-funit-at-a-time); fi ;)
......
...@@ -21,7 +21,7 @@ else ...@@ -21,7 +21,7 @@ else
# is not available. We can probably move if-lt to Kbuild.include, so it's also # is not available. We can probably move if-lt to Kbuild.include, so it's also
# not defined during clean or to include Kbuild.include in # not defined during clean or to include Kbuild.include in
# scripts/Makefile.clean. But the following workaround seems least invasive. # scripts/Makefile.clean. But the following workaround seems least invasive.
cc-ver := $(if $(call cc-version),$(call cc-version),0) cc-ver := $(if $(cc-version),$(cc-version),0)
endif endif
obj-$(CONFIG_GCOV_KERNEL) := base.o fs.o obj-$(CONFIG_GCOV_KERNEL) := base.o fs.o
......
...@@ -129,17 +129,15 @@ cc-disable-warning = $(call try-run,\ ...@@ -129,17 +129,15 @@ cc-disable-warning = $(call try-run,\
$(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1))) $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1)))
# cc-version # cc-version
# Usage gcc-ver := $(call cc-version)
cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC)) cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC))
# cc-fullversion # cc-fullversion
# Usage gcc-ver := $(call cc-fullversion)
cc-fullversion = $(shell $(CONFIG_SHELL) \ cc-fullversion = $(shell $(CONFIG_SHELL) \
$(srctree)/scripts/gcc-version.sh -p $(CC)) $(srctree)/scripts/gcc-version.sh -p $(CC))
# cc-ifversion # cc-ifversion
# Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1) # Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1)
cc-ifversion = $(shell [ $(call cc-version) $(1) $(2) ] && echo $(3)) cc-ifversion = $(shell [ $(cc-version) $(1) $(2) ] && echo $(3))
# cc-ldoption # cc-ldoption
# Usage: ldflags += $(call cc-ldoption, -Wl$(comma)--hash-style=both) # Usage: ldflags += $(call cc-ldoption, -Wl$(comma)--hash-style=both)
...@@ -157,13 +155,12 @@ ld-option = $(call try-run,\ ...@@ -157,13 +155,12 @@ ld-option = $(call try-run,\
ar-option = $(call try-run, $(AR) rc$(1) "$$TMP",$(1),$(2)) ar-option = $(call try-run, $(AR) rc$(1) "$$TMP",$(1),$(2))
# ld-version # ld-version
# Usage: $(call ld-version)
# Note this is mainly for HJ Lu's 3 number binutil versions # Note this is mainly for HJ Lu's 3 number binutil versions
ld-version = $(shell $(LD) --version | $(srctree)/scripts/ld-version.sh) ld-version = $(shell $(LD) --version | $(srctree)/scripts/ld-version.sh)
# ld-ifversion # ld-ifversion
# Usage: $(call ld-ifversion, -ge, 22252, y) # Usage: $(call ld-ifversion, -ge, 22252, y)
ld-ifversion = $(shell [ $(call ld-version) $(1) $(2) ] && echo $(3)) ld-ifversion = $(shell [ $(ld-version) $(1) $(2) ] && echo $(3))
###### ######
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment