aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
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 /scripts
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
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Kbuild.include19
-rw-r--r--scripts/Makefile.asm-generic2
-rw-r--r--scripts/Makefile.host6
-rwxr-xr-xscripts/checksyscalls.sh11
4 files changed, 17 insertions, 21 deletions
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) | \