Skip to content

Commit 665d92e

Browse files
masahir0ymichal42
authored andcommitted
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>
1 parent dd33c03 commit 665d92e

6 files changed

Lines changed: 10 additions & 13 deletions

File tree

‎Documentation/kbuild/makefiles.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ more details, with real examples.
524524
Example:
525525
#arch/x86/Makefile
526526
cflags-y += $(shell \
527-
if [ $(call cc-version) -ge 0300 ] ; then \
527+
if [ $(cc-version) -ge 0300 ] ; then \
528528
echo "-mregparm=3"; fi ;)
529529

530530
In the above example, -mregparm=3 is only used for gcc version greater
@@ -552,7 +552,7 @@ more details, with real examples.
552552

553553
Example:
554554
#arch/powerpc/Makefile
555-
$(Q)if test "$(call cc-fullversion)" = "040200" ; then \
555+
$(Q)if test "$(cc-fullversion)" = "040200" ; then \
556556
echo -n '*** GCC-4.2.0 cannot compile the 64-bit powerpc ' ; \
557557
false ; \
558558
fi

‎arch/parisc/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ endef
149149
# we require gcc 3.3 or above to compile the kernel
150150
archprepare: checkbin
151151
checkbin:
152-
@if test "$(call cc-version)" -lt "0303"; then \
152+
@if test "$(cc-version)" -lt "0303"; then \
153153
echo -n "Sorry, GCC v3.3 or above is required to build " ; \
154154
echo "the kernel." ; \
155155
false ; \

‎arch/powerpc/Makefile‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,21 +314,21 @@ TOUT := .tmp_gas_check
314314
# - Require gcc 4.0 or above on 64-bit
315315
# - gcc-4.2.0 has issues compiling modules on 64-bit
316316
checkbin:
317-
@if test "$(call cc-version)" = "0304" ; then \
317+
@if test "$(cc-version)" = "0304" ; then \
318318
if ! /bin/echo mftb 5 | $(AS) -v -mppc -many -o $(TOUT) >/dev/null 2>&1 ; then \
319319
echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build '; \
320320
echo 'correctly with gcc-3.4 and your version of binutils.'; \
321321
echo '*** Please upgrade your binutils or downgrade your gcc'; \
322322
false; \
323323
fi ; \
324324
fi
325-
@if test "$(call cc-version)" -lt "0400" \
325+
@if test "$(cc-version)" -lt "0400" \
326326
&& test "x${CONFIG_PPC64}" = "xy" ; then \
327327
echo -n "Sorry, GCC v4.0 or above is required to build " ; \
328328
echo "the 64-bit powerpc kernel." ; \
329329
false ; \
330330
fi
331-
@if test "$(call cc-fullversion)" = "040200" \
331+
@if test "$(cc-fullversion)" = "040200" \
332332
&& test "x${CONFIG_MODULES}${CONFIG_PPC64}" = "xyy" ; then \
333333
echo -n '*** GCC-4.2.0 cannot compile the 64-bit powerpc ' ; \
334334
echo 'kernel with modules enabled.' ; \

‎arch/x86/Makefile.um‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ cflags-y += -ffreestanding
3030
# Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc use
3131
# a lot more stack due to the lack of sharing of stacklots. Also, gcc
3232
# 4.3.0 needs -funit-at-a-time for extern inline functions.
33-
KBUILD_CFLAGS += $(shell if [ $(call cc-version) -lt 0400 ] ; then \
33+
KBUILD_CFLAGS += $(shell if [ $(cc-version) -lt 0400 ] ; then \
3434
echo $(call cc-option,-fno-unit-at-a-time); \
3535
else echo $(call cc-option,-funit-at-a-time); fi ;)
3636

‎kernel/gcov/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ else
2121
# is not available. We can probably move if-lt to Kbuild.include, so it's also
2222
# not defined during clean or to include Kbuild.include in
2323
# 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)
2525
endif
2626

2727
obj-$(CONFIG_GCOV_KERNEL) := base.o fs.o

‎scripts/Kbuild.include‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,17 +129,15 @@ cc-disable-warning = $(call try-run,\
129129
$(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1)))
130130

131131
# cc-version
132-
# Usage gcc-ver := $(call cc-version)
133132
cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC))
134133

135134
# cc-fullversion
136-
# Usage gcc-ver := $(call cc-fullversion)
137135
cc-fullversion = $(shell $(CONFIG_SHELL) \
138136
$(srctree)/scripts/gcc-version.sh -p $(CC))
139137

140138
# cc-ifversion
141139
# Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1)
142-
cc-ifversion = $(shell [ $(call cc-version) $(1) $(2) ] && echo $(3))
140+
cc-ifversion = $(shell [ $(cc-version) $(1) $(2) ] && echo $(3))
143141

144142
# cc-ldoption
145143
# Usage: ldflags += $(call cc-ldoption, -Wl$(comma)--hash-style=both)
@@ -157,13 +155,12 @@ ld-option = $(call try-run,\
157155
ar-option = $(call try-run, $(AR) rc$(1) "$$TMP",$(1),$(2))
158156

159157
# ld-version
160-
# Usage: $(call ld-version)
161158
# Note this is mainly for HJ Lu's 3 number binutil versions
162159
ld-version = $(shell $(LD) --version | $(srctree)/scripts/ld-version.sh)
163160

164161
# ld-ifversion
165162
# Usage: $(call ld-ifversion, -ge, 22252, y)
166-
ld-ifversion = $(shell [ $(call ld-version) $(1) $(2) ] && echo $(3))
163+
ld-ifversion = $(shell [ $(ld-version) $(1) $(2) ] && echo $(3))
167164

168165
######
169166

0 commit comments

Comments
 (0)