aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-10-28 14:01:57 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-10-28 14:01:57 -0400
commit25a5d23b47994cdb451dcd2bc8ac310a1492f71b (patch)
tree0f541556bb28c6bff38a7d6c9a40f3f66cc37ec1
parenta7d3e63f840c26e52f65d36de470d0b116014240 (diff)
parentbb3f38c3c5b759163e09b9152629cc789731de47 (diff)
Merge tag 'kbuild-fixes-v4.14-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull Kbuild fixes from Masahiro Yamada: - fix O= building on dash - remove unused dependency in Makefile - fix default of a choice in Kconfig - fix typos and documentation style - fix command options unrecognized by sparse * tag 'kbuild-fixes-v4.14-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kbuild: clang: fix build failures with sparse check kbuild doc: a bundle of fixes on makefiles.txt Makefile: kselftest: fix grammar typo kbuild: Fix optimization level choice default kbuild: drop unused symverfile in Makefile.modpost kbuild: revert $(realpath ...) to $(shell cd ... && /bin/pwd)
-rw-r--r--Documentation/kbuild/makefiles.txt31
-rw-r--r--Makefile10
-rw-r--r--init/Kconfig2
-rw-r--r--scripts/Makefile.modpost1
-rw-r--r--tools/power/cpupower/Makefile2
-rw-r--r--tools/scripts/Makefile.include6
6 files changed, 28 insertions, 24 deletions
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt
index 329e740adea7..f6f80380dff2 100644
--- a/Documentation/kbuild/makefiles.txt
+++ b/Documentation/kbuild/makefiles.txt
@@ -1108,14 +1108,6 @@ When kbuild executes, the following steps are followed (roughly):
1108 ld 1108 ld
1109 Link target. Often, LDFLAGS_$@ is used to set specific options to ld. 1109 Link target. Often, LDFLAGS_$@ is used to set specific options to ld.
1110 1110
1111 objcopy
1112 Copy binary. Uses OBJCOPYFLAGS usually specified in
1113 arch/$(ARCH)/Makefile.
1114 OBJCOPYFLAGS_$@ may be used to set additional options.
1115
1116 gzip
1117 Compress target. Use maximum compression to compress target.
1118
1119 Example: 1111 Example:
1120 #arch/x86/boot/Makefile 1112 #arch/x86/boot/Makefile
1121 LDFLAGS_bootsect := -Ttext 0x0 -s --oformat binary 1113 LDFLAGS_bootsect := -Ttext 0x0 -s --oformat binary
@@ -1139,6 +1131,19 @@ When kbuild executes, the following steps are followed (roughly):
1139 resulting in the target file being recompiled for no 1131 resulting in the target file being recompiled for no
1140 obvious reason. 1132 obvious reason.
1141 1133
1134 objcopy
1135 Copy binary. Uses OBJCOPYFLAGS usually specified in
1136 arch/$(ARCH)/Makefile.
1137 OBJCOPYFLAGS_$@ may be used to set additional options.
1138
1139 gzip
1140 Compress target. Use maximum compression to compress target.
1141
1142 Example:
1143 #arch/x86/boot/compressed/Makefile
1144 $(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) FORCE
1145 $(call if_changed,gzip)
1146
1142 dtc 1147 dtc
1143 Create flattened device tree blob object suitable for linking 1148 Create flattened device tree blob object suitable for linking
1144 into vmlinux. Device tree blobs linked into vmlinux are placed 1149 into vmlinux. Device tree blobs linked into vmlinux are placed
@@ -1219,7 +1224,7 @@ When kbuild executes, the following steps are followed (roughly):
1219 that may be shared between individual architectures. 1224 that may be shared between individual architectures.
1220 The recommended approach how to use a generic header file is 1225 The recommended approach how to use a generic header file is
1221 to list the file in the Kbuild file. 1226 to list the file in the Kbuild file.
1222 See "7.3 generic-y" for further info on syntax etc. 1227 See "7.2 generic-y" for further info on syntax etc.
1223 1228
1224--- 6.11 Post-link pass 1229--- 6.11 Post-link pass
1225 1230
@@ -1254,13 +1259,13 @@ A Kbuild file may be defined under arch/<arch>/include/uapi/asm/ and
1254arch/<arch>/include/asm/ to list asm files coming from asm-generic. 1259arch/<arch>/include/asm/ to list asm files coming from asm-generic.
1255See subsequent chapter for the syntax of the Kbuild file. 1260See subsequent chapter for the syntax of the Kbuild file.
1256 1261
1257 --- 7.1 no-export-headers 1262--- 7.1 no-export-headers
1258 1263
1259 no-export-headers is essentially used by include/uapi/linux/Kbuild to 1264 no-export-headers is essentially used by include/uapi/linux/Kbuild to
1260 avoid exporting specific headers (e.g. kvm.h) on architectures that do 1265 avoid exporting specific headers (e.g. kvm.h) on architectures that do
1261 not support it. It should be avoided as much as possible. 1266 not support it. It should be avoided as much as possible.
1262 1267
1263 --- 7.2 generic-y 1268--- 7.2 generic-y
1264 1269
1265 If an architecture uses a verbatim copy of a header from 1270 If an architecture uses a verbatim copy of a header from
1266 include/asm-generic then this is listed in the file 1271 include/asm-generic then this is listed in the file
@@ -1287,7 +1292,7 @@ See subsequent chapter for the syntax of the Kbuild file.
1287 Example: termios.h 1292 Example: termios.h
1288 #include <asm-generic/termios.h> 1293 #include <asm-generic/termios.h>
1289 1294
1290 --- 7.3 generated-y 1295--- 7.3 generated-y
1291 1296
1292 If an architecture generates other header files alongside generic-y 1297 If an architecture generates other header files alongside generic-y
1293 wrappers, generated-y specifies them. 1298 wrappers, generated-y specifies them.
@@ -1299,7 +1304,7 @@ See subsequent chapter for the syntax of the Kbuild file.
1299 #arch/x86/include/asm/Kbuild 1304 #arch/x86/include/asm/Kbuild
1300 generated-y += syscalls_32.h 1305 generated-y += syscalls_32.h
1301 1306
1302 --- 7.5 mandatory-y 1307--- 7.4 mandatory-y
1303 1308
1304 mandatory-y is essentially used by include/uapi/asm-generic/Kbuild.asm 1309 mandatory-y is essentially used by include/uapi/asm-generic/Kbuild.asm
1305 to define the minimum set of headers that must be exported in 1310 to define the minimum set of headers that must be exported in
diff --git a/Makefile b/Makefile
index 01875d606f44..2900c54f34ce 100644
--- a/Makefile
+++ b/Makefile
@@ -130,8 +130,8 @@ endif
130ifneq ($(KBUILD_OUTPUT),) 130ifneq ($(KBUILD_OUTPUT),)
131# check that the output directory actually exists 131# check that the output directory actually exists
132saved-output := $(KBUILD_OUTPUT) 132saved-output := $(KBUILD_OUTPUT)
133$(shell [ -d $(KBUILD_OUTPUT) ] || mkdir -p $(KBUILD_OUTPUT)) 133KBUILD_OUTPUT := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) \
134KBUILD_OUTPUT := $(realpath $(KBUILD_OUTPUT)) 134 && /bin/pwd)
135$(if $(KBUILD_OUTPUT),, \ 135$(if $(KBUILD_OUTPUT),, \
136 $(error failed to create output directory "$(saved-output)")) 136 $(error failed to create output directory "$(saved-output)"))
137 137
@@ -697,11 +697,11 @@ KBUILD_CFLAGS += $(stackp-flag)
697 697
698ifeq ($(cc-name),clang) 698ifeq ($(cc-name),clang)
699ifneq ($(CROSS_COMPILE),) 699ifneq ($(CROSS_COMPILE),)
700CLANG_TARGET := -target $(notdir $(CROSS_COMPILE:%-=%)) 700CLANG_TARGET := --target=$(notdir $(CROSS_COMPILE:%-=%))
701GCC_TOOLCHAIN := $(realpath $(dir $(shell which $(LD)))/..) 701GCC_TOOLCHAIN := $(realpath $(dir $(shell which $(LD)))/..)
702endif 702endif
703ifneq ($(GCC_TOOLCHAIN),) 703ifneq ($(GCC_TOOLCHAIN),)
704CLANG_GCC_TC := -gcc-toolchain $(GCC_TOOLCHAIN) 704CLANG_GCC_TC := --gcc-toolchain=$(GCC_TOOLCHAIN)
705endif 705endif
706KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) 706KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC)
707KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) 707KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC)
@@ -1399,7 +1399,7 @@ help:
1399 @echo ' Build, install, and boot kernel before' 1399 @echo ' Build, install, and boot kernel before'
1400 @echo ' running kselftest on it' 1400 @echo ' running kselftest on it'
1401 @echo ' kselftest-clean - Remove all generated kselftest files' 1401 @echo ' kselftest-clean - Remove all generated kselftest files'
1402 @echo ' kselftest-merge - Merge all the config dependencies of kselftest to existed' 1402 @echo ' kselftest-merge - Merge all the config dependencies of kselftest to existing'
1403 @echo ' .config.' 1403 @echo ' .config.'
1404 @echo '' 1404 @echo ''
1405 @echo 'Userspace tools targets:' 1405 @echo 'Userspace tools targets:'
diff --git a/init/Kconfig b/init/Kconfig
index 78cb2461012e..3c1faaa2af4a 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1033,7 +1033,7 @@ endif
1033 1033
1034choice 1034choice
1035 prompt "Compiler optimization level" 1035 prompt "Compiler optimization level"
1036 default CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE 1036 default CC_OPTIMIZE_FOR_PERFORMANCE
1037 1037
1038config CC_OPTIMIZE_FOR_PERFORMANCE 1038config CC_OPTIMIZE_FOR_PERFORMANCE
1039 bool "Optimize for performance" 1039 bool "Optimize for performance"
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index 16923ba4b5b1..756d14f0d763 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -97,7 +97,6 @@ vmlinux.o: FORCE
97 $(call cmd,kernel-mod) 97 $(call cmd,kernel-mod)
98 98
99# Declare generated files as targets for modpost 99# Declare generated files as targets for modpost
100$(symverfile): __modpost ;
101$(modules:.ko=.mod.c): __modpost ; 100$(modules:.ko=.mod.c): __modpost ;
102 101
103 102
diff --git a/tools/power/cpupower/Makefile b/tools/power/cpupower/Makefile
index 4c5a481a850c..d6e1c02ddcfe 100644
--- a/tools/power/cpupower/Makefile
+++ b/tools/power/cpupower/Makefile
@@ -26,7 +26,7 @@ endif
26 26
27ifneq ($(OUTPUT),) 27ifneq ($(OUTPUT),)
28# check that the output directory actually exists 28# check that the output directory actually exists
29OUTDIR := $(realpath $(OUTPUT)) 29OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd)
30$(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist)) 30$(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist))
31endif 31endif
32 32
diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include
index 9dc8f078a83c..1e8b6116ba3c 100644
--- a/tools/scripts/Makefile.include
+++ b/tools/scripts/Makefile.include
@@ -1,7 +1,7 @@
1ifneq ($(O),) 1ifneq ($(O),)
2ifeq ($(origin O), command line) 2ifeq ($(origin O), command line)
3 ABSOLUTE_O := $(realpath $(O)) 3 dummy := $(if $(shell test -d $(O) || echo $(O)),$(error O=$(O) does not exist),)
4 dummy := $(if $(ABSOLUTE_O),,$(error O=$(O) does not exist)) 4 ABSOLUTE_O := $(shell cd $(O) ; pwd)
5 OUTPUT := $(ABSOLUTE_O)/$(if $(subdir),$(subdir)/) 5 OUTPUT := $(ABSOLUTE_O)/$(if $(subdir),$(subdir)/)
6 COMMAND_O := O=$(ABSOLUTE_O) 6 COMMAND_O := O=$(ABSOLUTE_O)
7ifeq ($(objtree),) 7ifeq ($(objtree),)
@@ -12,7 +12,7 @@ endif
12 12
13# check that the output directory actually exists 13# check that the output directory actually exists
14ifneq ($(OUTPUT),) 14ifneq ($(OUTPUT),)
15OUTDIR := $(realpath $(OUTPUT)) 15OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd)
16$(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist)) 16$(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist))
17endif 17endif
18 18