aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-07-07 17:09:24 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-07 17:09:24 -0400
commit58f051fc9828709e6c55803510761413d92c4e57 (patch)
tree8b92cf129f74105d9b17ada2b227aa45f2898d51
parentef3ad0898a60d30da7f170032992914998c366e5 (diff)
parentc4e6fff1ae5729c2af159008b13fca39fbbac70e (diff)
Merge tag 'kbuild-v4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull Kbuild updates from Masahiro Yamada: - Clean up Makefiles and scripts - Improve clang support - Remove unneeded genhdr-y syntax - Remove unneeded cc-option-align macro - Introduce __cc-option macro and use it to fix x86 boot code compiler flags * tag 'kbuild-v4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kbuild: improve comments on KBUILD_SRC x86/build: Specify stack alignment for clang x86/build: Use __cc-option for boot code compiler options kbuild: Add __cc-option macro kbuild: remove cc-option-align kbuild: replace genhdr-y with generated-y kbuild: clang: Disable 'address-of-packed-member' warning kbuild: remove duplicated arch/*/include/generated/uapi include path kbuild: speed up checksyscalls.sh kbuild: simplify silent build (-s) detection
-rw-r--r--Documentation/kbuild/makefiles.txt41
-rw-r--r--Makefile24
-rw-r--r--arch/arm/include/uapi/asm/Kbuild6
-rw-r--r--arch/x86/Makefile33
-rw-r--r--arch/x86/Makefile_32.cpu7
-rw-r--r--arch/x86/include/uapi/asm/Kbuild6
-rw-r--r--scripts/Kbuild.include19
-rw-r--r--scripts/Makefile.asm-generic2
-rw-r--r--scripts/Makefile.host6
-rwxr-xr-xscripts/checksyscalls.sh11
-rw-r--r--tools/build/Makefile.build8
-rw-r--r--tools/scripts/Makefile.include8
12 files changed, 67 insertions, 104 deletions
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt
index 659afd56ecdb..7003141a6d4f 100644
--- a/Documentation/kbuild/makefiles.txt
+++ b/Documentation/kbuild/makefiles.txt
@@ -45,10 +45,9 @@ This document describes the Linux kernel Makefiles.
45 45
46 === 7 Kbuild syntax for exported headers 46 === 7 Kbuild syntax for exported headers
47 --- 7.1 no-export-headers 47 --- 7.1 no-export-headers
48 --- 7.2 genhdr-y 48 --- 7.2 generic-y
49 --- 7.3 generic-y 49 --- 7.3 generated-y
50 --- 7.4 generated-y 50 --- 7.4 mandatory-y
51 --- 7.5 mandatory-y
52 51
53 === 8 Kbuild Variables 52 === 8 Kbuild Variables
54 === 9 Makefile language 53 === 9 Makefile language
@@ -487,22 +486,6 @@ more details, with real examples.
487 respectively. 486 respectively.
488 Note: cc-option-yn uses KBUILD_CFLAGS for $(CC) options 487 Note: cc-option-yn uses KBUILD_CFLAGS for $(CC) options
489 488
490 cc-option-align
491 gcc versions >= 3.0 changed the type of options used to specify
492 alignment of functions, loops etc. $(cc-option-align), when used
493 as prefix to the align options, will select the right prefix:
494 gcc < 3.00
495 cc-option-align = -malign
496 gcc >= 3.00
497 cc-option-align = -falign
498
499 Example:
500 KBUILD_CFLAGS += $(cc-option-align)-functions=4
501
502 In the above example, the option -falign-functions=4 is used for
503 gcc >= 3.00. For gcc < 3.00, -malign-functions=4 is used.
504 Note: cc-option-align uses KBUILD_CFLAGS for $(CC) options
505
506 cc-disable-warning 489 cc-disable-warning
507 cc-disable-warning checks if gcc supports a given warning and returns 490 cc-disable-warning checks if gcc supports a given warning and returns
508 the commandline switch to disable it. This special function is needed, 491 the commandline switch to disable it. This special function is needed,
@@ -1277,18 +1260,7 @@ See subsequent chapter for the syntax of the Kbuild file.
1277 avoid exporting specific headers (e.g. kvm.h) on architectures that do 1260 avoid exporting specific headers (e.g. kvm.h) on architectures that do
1278 not support it. It should be avoided as much as possible. 1261 not support it. It should be avoided as much as possible.
1279 1262
1280 --- 7.2 genhdr-y 1263 --- 7.2 generic-y
1281
1282 genhdr-y specifies asm files to be generated.
1283
1284 Example:
1285 #arch/x86/include/uapi/asm/Kbuild
1286 genhdr-y += unistd_32.h
1287 genhdr-y += unistd_64.h
1288 genhdr-y += unistd_x32.h
1289
1290
1291 --- 7.3 generic-y
1292 1264
1293 If an architecture uses a verbatim copy of a header from 1265 If an architecture uses a verbatim copy of a header from
1294 include/asm-generic then this is listed in the file 1266 include/asm-generic then this is listed in the file
@@ -1315,11 +1287,10 @@ See subsequent chapter for the syntax of the Kbuild file.
1315 Example: termios.h 1287 Example: termios.h
1316 #include <asm-generic/termios.h> 1288 #include <asm-generic/termios.h>
1317 1289
1318 --- 7.4 generated-y 1290 --- 7.3 generated-y
1319 1291
1320 If an architecture generates other header files alongside generic-y 1292 If an architecture generates other header files alongside generic-y
1321 wrappers, and not included in genhdr-y, then generated-y specifies 1293 wrappers, generated-y specifies them.
1322 them.
1323 1294
1324 This prevents them being treated as stale asm-generic wrappers and 1295 This prevents them being treated as stale asm-generic wrappers and
1325 removed. 1296 removed.
diff --git a/Makefile b/Makefile
index d7cb0372bed9..faea0e37c2f2 100644
--- a/Makefile
+++ b/Makefile
@@ -84,17 +84,10 @@ endif
84# If the user is running make -s (silent mode), suppress echoing of 84# If the user is running make -s (silent mode), suppress echoing of
85# commands 85# commands
86 86
87ifneq ($(filter 4.%,$(MAKE_VERSION)),) # make-4 87ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),)
88ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)
89 quiet=silent_ 88 quiet=silent_
90 tools_silent=s 89 tools_silent=s
91endif 90endif
92else # make-3.8x
93ifneq ($(filter s% -s%,$(MAKEFLAGS)),)
94 quiet=silent_
95 tools_silent=-s
96endif
97endif
98 91
99export quiet Q KBUILD_VERBOSE 92export quiet Q KBUILD_VERBOSE
100 93
@@ -113,8 +106,8 @@ export quiet Q KBUILD_VERBOSE
113# The O= assignment takes precedence over the KBUILD_OUTPUT environment 106# The O= assignment takes precedence over the KBUILD_OUTPUT environment
114# variable. 107# variable.
115 108
116# KBUILD_SRC is set on invocation of make in OBJ directory 109# KBUILD_SRC is not intended to be used by the regular user (for now),
117# KBUILD_SRC is not intended to be used by the regular user (for now) 110# it is set on invocation of make with KBUILD_OUTPUT or O= specified.
118ifeq ($(KBUILD_SRC),) 111ifeq ($(KBUILD_SRC),)
119 112
120# OK, Make called in directory where kernel src resides 113# OK, Make called in directory where kernel src resides
@@ -135,7 +128,6 @@ ifneq ($(words $(subst :, ,$(CURDIR))), 1)
135endif 128endif
136 129
137ifneq ($(KBUILD_OUTPUT),) 130ifneq ($(KBUILD_OUTPUT),)
138# Invoke a second make in the output directory, passing relevant variables
139# check that the output directory actually exists 131# check that the output directory actually exists
140saved-output := $(KBUILD_OUTPUT) 132saved-output := $(KBUILD_OUTPUT)
141KBUILD_OUTPUT := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) \ 133KBUILD_OUTPUT := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) \
@@ -148,6 +140,7 @@ PHONY += $(MAKECMDGOALS) sub-make
148$(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make 140$(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make
149 @: 141 @:
150 142
143# Invoke a second make in the output directory, passing relevant variables
151sub-make: 144sub-make:
152 $(Q)$(MAKE) -C $(KBUILD_OUTPUT) KBUILD_SRC=$(CURDIR) \ 145 $(Q)$(MAKE) -C $(KBUILD_OUTPUT) KBUILD_SRC=$(CURDIR) \
153 -f $(CURDIR)/Makefile $(filter-out _all sub-make,$(MAKECMDGOALS)) 146 -f $(CURDIR)/Makefile $(filter-out _all sub-make,$(MAKECMDGOALS))
@@ -303,7 +296,7 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
303 296
304HOSTCC = gcc 297HOSTCC = gcc
305HOSTCXX = g++ 298HOSTCXX = g++
306HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89 299HOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89
307HOSTCXXFLAGS = -O2 300HOSTCXXFLAGS = -O2
308 301
309ifeq ($(shell $(HOSTCC) -v 2>&1 | grep -c "clang version"), 1) 302ifeq ($(shell $(HOSTCC) -v 2>&1 | grep -c "clang version"), 1)
@@ -388,12 +381,10 @@ USERINCLUDE := \
388# Needed to be compatible with the O= option 381# Needed to be compatible with the O= option
389LINUXINCLUDE := \ 382LINUXINCLUDE := \
390 -I$(srctree)/arch/$(hdr-arch)/include \ 383 -I$(srctree)/arch/$(hdr-arch)/include \
391 -I$(objtree)/arch/$(hdr-arch)/include/generated/uapi \
392 -I$(objtree)/arch/$(hdr-arch)/include/generated \ 384 -I$(objtree)/arch/$(hdr-arch)/include/generated \
393 $(if $(KBUILD_SRC), -I$(srctree)/include) \ 385 $(if $(KBUILD_SRC), -I$(srctree)/include) \
394 -I$(objtree)/include 386 -I$(objtree)/include \
395 387 $(USERINCLUDE)
396LINUXINCLUDE += $(filter-out $(LINUXINCLUDE),$(USERINCLUDE))
397 388
398KBUILD_CPPFLAGS := -D__KERNEL__ 389KBUILD_CPPFLAGS := -D__KERNEL__
399 390
@@ -707,6 +698,7 @@ KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
707KBUILD_CFLAGS += $(call cc-disable-warning, unused-variable) 698KBUILD_CFLAGS += $(call cc-disable-warning, unused-variable)
708KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier) 699KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier)
709KBUILD_CFLAGS += $(call cc-disable-warning, gnu) 700KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
701KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
710# Quiet clang warning: comparison of unsigned expression < 0 is always false 702# Quiet clang warning: comparison of unsigned expression < 0 is always false
711KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare) 703KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare)
712# CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the 704# CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the
diff --git a/arch/arm/include/uapi/asm/Kbuild b/arch/arm/include/uapi/asm/Kbuild
index e9b098d6b766..5fb3368e70cb 100644
--- a/arch/arm/include/uapi/asm/Kbuild
+++ b/arch/arm/include/uapi/asm/Kbuild
@@ -1,8 +1,8 @@
1# UAPI Header export list 1# UAPI Header export list
2include include/uapi/asm-generic/Kbuild.asm 2include include/uapi/asm-generic/Kbuild.asm
3 3
4genhdr-y += unistd-common.h 4generated-y += unistd-common.h
5genhdr-y += unistd-oabi.h 5generated-y += unistd-oabi.h
6genhdr-y += unistd-eabi.h 6generated-y += unistd-eabi.h
7 7
8generic-y += siginfo.h 8generic-y += siginfo.h
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index ad2db82e9953..1e902f926be3 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -11,6 +11,14 @@ else
11 KBUILD_DEFCONFIG := $(ARCH)_defconfig 11 KBUILD_DEFCONFIG := $(ARCH)_defconfig
12endif 12endif
13 13
14# For gcc stack alignment is specified with -mpreferred-stack-boundary,
15# clang has the option -mstack-alignment for that purpose.
16ifneq ($(call cc-option, -mpreferred-stack-boundary=4),)
17 cc_stack_align_opt := -mpreferred-stack-boundary
18else ifneq ($(call cc-option, -mstack-alignment=4),)
19 cc_stack_align_opt := -mstack-alignment
20endif
21
14# How to compile the 16-bit code. Note we always compile for -march=i386; 22# How to compile the 16-bit code. Note we always compile for -march=i386;
15# that way we can complain to the user if the CPU is insufficient. 23# that way we can complain to the user if the CPU is insufficient.
16# 24#
@@ -24,10 +32,11 @@ REALMODE_CFLAGS := $(M16_CFLAGS) -g -Os -D__KERNEL__ \
24 -DDISABLE_BRANCH_PROFILING \ 32 -DDISABLE_BRANCH_PROFILING \
25 -Wall -Wstrict-prototypes -march=i386 -mregparm=3 \ 33 -Wall -Wstrict-prototypes -march=i386 -mregparm=3 \
26 -fno-strict-aliasing -fomit-frame-pointer -fno-pic \ 34 -fno-strict-aliasing -fomit-frame-pointer -fno-pic \
27 -mno-mmx -mno-sse \ 35 -mno-mmx -mno-sse
28 $(call cc-option, -ffreestanding) \ 36
29 $(call cc-option, -fno-stack-protector) \ 37REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), -ffreestanding)
30 $(call cc-option, -mpreferred-stack-boundary=2) 38REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), -fno-stack-protector)
39REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), $(cc_stack_align_opt)=2)
31export REALMODE_CFLAGS 40export REALMODE_CFLAGS
32 41
33# BITS is used as extension for files which are available in a 32 bit 42# BITS is used as extension for files which are available in a 32 bit
@@ -64,8 +73,10 @@ ifeq ($(CONFIG_X86_32),y)
64 # with nonstandard options 73 # with nonstandard options
65 KBUILD_CFLAGS += -fno-pic 74 KBUILD_CFLAGS += -fno-pic
66 75
67 # prevent gcc from keeping the stack 16 byte aligned 76 # Align the stack to the register width instead of using the default
68 KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2) 77 # alignment of 16 bytes. This reduces stack usage and the number of
78 # alignment instructions.
79 KBUILD_CFLAGS += $(call cc-option,$(cc_stack_align_opt)=2)
69 80
70 # Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc use 81 # Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc use
71 # a lot more stack due to the lack of sharing of stacklots: 82 # a lot more stack due to the lack of sharing of stacklots:
@@ -97,8 +108,14 @@ else
97 KBUILD_CFLAGS += $(call cc-option,-mno-80387) 108 KBUILD_CFLAGS += $(call cc-option,-mno-80387)
98 KBUILD_CFLAGS += $(call cc-option,-mno-fp-ret-in-387) 109 KBUILD_CFLAGS += $(call cc-option,-mno-fp-ret-in-387)
99 110
100 # Use -mpreferred-stack-boundary=3 if supported. 111 # By default gcc and clang use a stack alignment of 16 bytes for x86.
101 KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=3) 112 # However the standard kernel entry on x86-64 leaves the stack on an
113 # 8-byte boundary. If the compiler isn't informed about the actual
114 # alignment it will generate extra alignment instructions for the
115 # default alignment which keep the stack *mis*aligned.
116 # Furthermore an alignment to the register width reduces stack usage
117 # and the number of alignment instructions.
118 KBUILD_CFLAGS += $(call cc-option,$(cc_stack_align_opt)=3)
102 119
103 # Use -mskip-rax-setup if supported. 120 # Use -mskip-rax-setup if supported.
104 KBUILD_CFLAGS += $(call cc-option,-mskip-rax-setup) 121 KBUILD_CFLAGS += $(call cc-option,-mskip-rax-setup)
diff --git a/arch/x86/Makefile_32.cpu b/arch/x86/Makefile_32.cpu
index a45eb15b7cf2..f3717d36718a 100644
--- a/arch/x86/Makefile_32.cpu
+++ b/arch/x86/Makefile_32.cpu
@@ -9,7 +9,6 @@ else
9tune = $(call cc-option,-mcpu=$(1),$(2)) 9tune = $(call cc-option,-mcpu=$(1),$(2))
10endif 10endif
11 11
12align := $(cc-option-align)
13cflags-$(CONFIG_M486) += -march=i486 12cflags-$(CONFIG_M486) += -march=i486
14cflags-$(CONFIG_M586) += -march=i586 13cflags-$(CONFIG_M586) += -march=i586
15cflags-$(CONFIG_M586TSC) += -march=i586 14cflags-$(CONFIG_M586TSC) += -march=i586
@@ -24,11 +23,11 @@ cflags-$(CONFIG_MK6) += -march=k6
24# They make zero difference whatsosever to performance at this time. 23# They make zero difference whatsosever to performance at this time.
25cflags-$(CONFIG_MK7) += -march=athlon 24cflags-$(CONFIG_MK7) += -march=athlon
26cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8,-march=athlon) 25cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8,-march=athlon)
27cflags-$(CONFIG_MCRUSOE) += -march=i686 $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0 26cflags-$(CONFIG_MCRUSOE) += -march=i686 -falign-functions=0 -falign-jumps=0 -falign-loops=0
28cflags-$(CONFIG_MEFFICEON) += -march=i686 $(call tune,pentium3) $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0 27cflags-$(CONFIG_MEFFICEON) += -march=i686 $(call tune,pentium3) -falign-functions=0 -falign-jumps=0 -falign-loops=0
29cflags-$(CONFIG_MWINCHIPC6) += $(call cc-option,-march=winchip-c6,-march=i586) 28cflags-$(CONFIG_MWINCHIPC6) += $(call cc-option,-march=winchip-c6,-march=i586)
30cflags-$(CONFIG_MWINCHIP3D) += $(call cc-option,-march=winchip2,-march=i586) 29cflags-$(CONFIG_MWINCHIP3D) += $(call cc-option,-march=winchip2,-march=i586)
31cflags-$(CONFIG_MCYRIXIII) += $(call cc-option,-march=c3,-march=i486) $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0 30cflags-$(CONFIG_MCYRIXIII) += $(call cc-option,-march=c3,-march=i486) -falign-functions=0 -falign-jumps=0 -falign-loops=0
32cflags-$(CONFIG_MVIAC3_2) += $(call cc-option,-march=c3-2,-march=i686) 31cflags-$(CONFIG_MVIAC3_2) += $(call cc-option,-march=c3-2,-march=i686)
33cflags-$(CONFIG_MVIAC7) += -march=i686 32cflags-$(CONFIG_MVIAC7) += -march=i686
34cflags-$(CONFIG_MCORE2) += -march=i686 $(call tune,core2) 33cflags-$(CONFIG_MCORE2) += -march=i686 $(call tune,core2)
diff --git a/arch/x86/include/uapi/asm/Kbuild b/arch/x86/include/uapi/asm/Kbuild
index 83b6e9a0dce4..da1489cb64dc 100644
--- a/arch/x86/include/uapi/asm/Kbuild
+++ b/arch/x86/include/uapi/asm/Kbuild
@@ -1,6 +1,6 @@
1# UAPI Header export list 1# UAPI Header export list
2include include/uapi/asm-generic/Kbuild.asm 2include include/uapi/asm-generic/Kbuild.asm
3 3
4genhdr-y += unistd_32.h 4generated-y += unistd_32.h
5genhdr-y += unistd_64.h 5generated-y += unistd_64.h
6genhdr-y += unistd_x32.h 6generated-y += unistd_x32.h
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 61f87a99bf0a..dd8e2dde0b34 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -108,6 +108,11 @@ as-option = $(call try-run,\
108as-instr = $(call try-run,\ 108as-instr = $(call try-run,\
109 printf "%b\n" "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -x assembler -o "$$TMP" -,$(2),$(3)) 109 printf "%b\n" "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -x assembler -o "$$TMP" -,$(2),$(3))
110 110
111# __cc-option
112# Usage: MY_CFLAGS += $(call __cc-option,$(CC),$(MY_CFLAGS),-march=winchip-c6,-march=i586)
113__cc-option = $(call try-run,\
114 $(1) -Werror $(2) $(3) -c -x c /dev/null -o "$$TMP",$(3),$(4))
115
111# Do not attempt to build with gcc plugins during cc-option tests. 116# Do not attempt to build with gcc plugins during cc-option tests.
112# (And this uses delayed resolution so the flags will be up to date.) 117# (And this uses delayed resolution so the flags will be up to date.)
113CC_OPTION_CFLAGS = $(filter-out $(GCC_PLUGINS_CFLAGS),$(KBUILD_CFLAGS)) 118CC_OPTION_CFLAGS = $(filter-out $(GCC_PLUGINS_CFLAGS),$(KBUILD_CFLAGS))
@@ -115,19 +120,19 @@ CC_OPTION_CFLAGS = $(filter-out $(GCC_PLUGINS_CFLAGS),$(KBUILD_CFLAGS))
115# cc-option 120# cc-option
116# Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586) 121# Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586)
117 122
118cc-option = $(call try-run,\ 123cc-option = $(call __cc-option, $(CC),\
119 $(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2)) 124 $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS),$(1),$(2))
125
126# hostcc-option
127# Usage: cflags-y += $(call hostcc-option,-march=winchip-c6,-march=i586)
128hostcc-option = $(call __cc-option, $(HOSTCC),\
129 $(HOSTCFLAGS) $(HOST_EXTRACFLAGS),$(1),$(2))
120 130
121# cc-option-yn 131# cc-option-yn
122# Usage: flag := $(call cc-option-yn,-march=winchip-c6) 132# Usage: flag := $(call cc-option-yn,-march=winchip-c6)
123cc-option-yn = $(call try-run,\ 133cc-option-yn = $(call try-run,\
124 $(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n) 134 $(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n)
125 135
126# cc-option-align
127# Prefix align with either -falign or -malign
128cc-option-align = $(subst -functions=0,,\
129 $(call cc-option,-falign-functions=0,-malign-functions=0))
130
131# cc-disable-warning 136# cc-disable-warning
132# Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable) 137# Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable)
133cc-disable-warning = $(call try-run,\ 138cc-disable-warning = $(call try-run,\
diff --git a/scripts/Makefile.asm-generic b/scripts/Makefile.asm-generic
index e4d017d53819..95f7d8090152 100644
--- a/scripts/Makefile.asm-generic
+++ b/scripts/Makefile.asm-generic
@@ -15,7 +15,7 @@ _dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))
15 15
16# Stale wrappers when the corresponding files are removed from generic-y 16# Stale wrappers when the corresponding files are removed from generic-y
17# need removing. 17# need removing.
18generated-y := $(generic-y) $(genhdr-y) $(generated-y) 18generated-y := $(generic-y) $(generated-y)
19all-files := $(patsubst %, $(obj)/%, $(generated-y)) 19all-files := $(patsubst %, $(obj)/%, $(generated-y))
20old-headers := $(wildcard $(obj)/*.h) 20old-headers := $(wildcard $(obj)/*.h)
21unwanted := $(filter-out $(all-files),$(old-headers)) 21unwanted := $(filter-out $(all-files),$(old-headers))
diff --git a/scripts/Makefile.host b/scripts/Makefile.host
index 45b5b1aaedbd..9cfd5c84d76f 100644
--- a/scripts/Makefile.host
+++ b/scripts/Makefile.host
@@ -20,12 +20,6 @@
20# Will compile qconf as a C++ program, and menu as a C program. 20# Will compile qconf as a C++ program, and menu as a C program.
21# They are linked as C++ code to the executable qconf 21# They are linked as C++ code to the executable qconf
22 22
23# hostcc-option
24# Usage: cflags-y += $(call hostcc-option,-march=winchip-c6,-march=i586)
25
26hostcc-option = $(call try-run,\
27 $(HOSTCC) $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2))
28
29__hostprogs := $(sort $(hostprogs-y) $(hostprogs-m)) 23__hostprogs := $(sort $(hostprogs-y) $(hostprogs-m))
30host-cshlib := $(sort $(hostlibs-y) $(hostlibs-m)) 24host-cshlib := $(sort $(hostlibs-y) $(hostlibs-m))
31host-cxxshlib := $(sort $(hostcxxlibs-y) $(hostcxxlibs-m)) 25host-cxxshlib := $(sort $(hostcxxlibs-y) $(hostcxxlibs-m))
diff --git a/scripts/checksyscalls.sh b/scripts/checksyscalls.sh
index 116b7735ee9f..5a387a264201 100755
--- a/scripts/checksyscalls.sh
+++ b/scripts/checksyscalls.sh
@@ -202,15 +202,12 @@ EOF
202} 202}
203 203
204syscall_list() { 204syscall_list() {
205 grep '^[0-9]' "$1" | sort -n | ( 205 grep '^[0-9]' "$1" | sort -n |
206 while read nr abi name entry ; do 206 while read nr abi name entry ; do
207 cat <<EOF 207 echo "#if !defined(__NR_${name}) && !defined(__IGNORE_${name})"
208#if !defined(__NR_${name}) && !defined(__IGNORE_${name}) 208 echo "#warning syscall ${name} not implemented"
209#warning syscall ${name} not implemented 209 echo "#endif"
210#endif
211EOF
212 done 210 done
213 )
214} 211}
215 212
216(ignore_list && syscall_list $(dirname $0)/../arch/x86/entry/syscalls/syscall_32.tbl) | \ 213(ignore_list && syscall_list $(dirname $0)/../arch/x86/entry/syscalls/syscall_32.tbl) | \
diff --git a/tools/build/Makefile.build b/tools/build/Makefile.build
index e279a71c650d..c46b20e4ad87 100644
--- a/tools/build/Makefile.build
+++ b/tools/build/Makefile.build
@@ -19,15 +19,9 @@ else
19 Q=@ 19 Q=@
20endif 20endif
21 21
22ifneq ($(filter 4.%,$(MAKE_VERSION)),) # make-4 22ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),)
23ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)
24 quiet=silent_ 23 quiet=silent_
25endif 24endif
26else # make-3.8x
27ifneq ($(filter s% -s%,$(MAKEFLAGS)),)
28 quiet=silent_
29endif
30endif
31 25
32build-dir := $(srctree)/tools/build 26build-dir := $(srctree)/tools/build
33 27
diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include
index fc74db62fef4..ccad8ce925e4 100644
--- a/tools/scripts/Makefile.include
+++ b/tools/scripts/Makefile.include
@@ -58,15 +58,9 @@ else
58NO_SUBDIR = : 58NO_SUBDIR = :
59endif 59endif
60 60
61ifneq ($(filter 4.%,$(MAKE_VERSION)),) # make-4 61ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),)
62ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)
63 silent=1 62 silent=1
64endif 63endif
65else # make-3.8x
66ifneq ($(filter s% -s%,$(MAKEFLAGS)),)
67 silent=1
68endif
69endif
70 64
71# 65#
72# Define a callable command for descending to a new directory 66# Define a callable command for descending to a new directory