diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-03-24 22:26:47 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-03-24 22:26:47 -0400 |
commit | 2162b80fcadf5b0afff08b540bd141f8a5ff5ed1 (patch) | |
tree | 61fa829c78e1850e35946db3f794c9f320c4a906 | |
parent | 976fb3f7b92e91aeccb87de60128a1e65edd676f (diff) | |
parent | ea8daa7b97842aab8507b5b5b1e3226cf2d514a6 (diff) |
Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Pull kbuild updates from Michal Marek:
- make dtbs_install fix
- Error handling fix fixdep and link-vmlinux.sh
- __UNIQUE_ID fix for clang
- Fix for if_changed_* to suppress the "is up to date." message
- The kernel is built with -Werror=incompatible-pointer-types
* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
kbuild: Add option to turn incompatible pointer check into error
kbuild: suppress annoying "... is up to date." message
kbuild: fixdep: Check fstat(2) return value
scripts/link-vmlinux.sh: force error on kallsyms failure
Kbuild: provide a __UNIQUE_ID for clang
dtbsinstall: don't move target directory out of the way
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | include/linux/compiler-clang.h | 5 | ||||
-rw-r--r-- | scripts/Kbuild.include | 6 | ||||
-rw-r--r-- | scripts/Makefile.dtbinst | 2 | ||||
-rw-r--r-- | scripts/basic/fixdep.c | 6 | ||||
-rwxr-xr-x | scripts/link-vmlinux.sh | 7 |
6 files changed, 20 insertions, 9 deletions
@@ -782,6 +782,9 @@ KBUILD_CFLAGS += $(call cc-option,-Werror=strict-prototypes) | |||
782 | # Prohibit date/time macros, which would make the build non-deterministic | 782 | # Prohibit date/time macros, which would make the build non-deterministic |
783 | KBUILD_CFLAGS += $(call cc-option,-Werror=date-time) | 783 | KBUILD_CFLAGS += $(call cc-option,-Werror=date-time) |
784 | 784 | ||
785 | # enforce correct pointer usage | ||
786 | KBUILD_CFLAGS += $(call cc-option,-Werror=incompatible-pointer-types) | ||
787 | |||
785 | # use the deterministic mode of AR if available | 788 | # use the deterministic mode of AR if available |
786 | KBUILD_ARFLAGS := $(call ar-option,D) | 789 | KBUILD_ARFLAGS := $(call ar-option,D) |
787 | 790 | ||
diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h index d1e49d52b640..de179993e039 100644 --- a/include/linux/compiler-clang.h +++ b/include/linux/compiler-clang.h | |||
@@ -10,3 +10,8 @@ | |||
10 | #undef uninitialized_var | 10 | #undef uninitialized_var |
11 | #define uninitialized_var(x) x = *(&(x)) | 11 | #define uninitialized_var(x) x = *(&(x)) |
12 | #endif | 12 | #endif |
13 | |||
14 | /* same as gcc, this was present in clang-2.6 so we can assume it works | ||
15 | * with any version that can compile the kernel | ||
16 | */ | ||
17 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) | ||
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index 1db6d73c8dd2..b2ab2a92a375 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include | |||
@@ -251,7 +251,7 @@ any-prereq = $(filter-out $(PHONY),$?) $(filter-out $(PHONY) $(wildcard $^),$^) | |||
251 | if_changed = $(if $(strip $(any-prereq) $(arg-check)), \ | 251 | if_changed = $(if $(strip $(any-prereq) $(arg-check)), \ |
252 | @set -e; \ | 252 | @set -e; \ |
253 | $(echo-cmd) $(cmd_$(1)); \ | 253 | $(echo-cmd) $(cmd_$(1)); \ |
254 | printf '%s\n' 'cmd_$@ := $(make-cmd)' > $(dot-target).cmd) | 254 | printf '%s\n' 'cmd_$@ := $(make-cmd)' > $(dot-target).cmd, @:) |
255 | 255 | ||
256 | # Execute the command and also postprocess generated .d dependencies file. | 256 | # Execute the command and also postprocess generated .d dependencies file. |
257 | if_changed_dep = $(if $(strip $(any-prereq) $(arg-check) ), \ | 257 | if_changed_dep = $(if $(strip $(any-prereq) $(arg-check) ), \ |
@@ -259,14 +259,14 @@ if_changed_dep = $(if $(strip $(any-prereq) $(arg-check) ), \ | |||
259 | $(echo-cmd) $(cmd_$(1)); \ | 259 | $(echo-cmd) $(cmd_$(1)); \ |
260 | scripts/basic/fixdep $(depfile) $@ '$(make-cmd)' > $(dot-target).tmp;\ | 260 | scripts/basic/fixdep $(depfile) $@ '$(make-cmd)' > $(dot-target).tmp;\ |
261 | rm -f $(depfile); \ | 261 | rm -f $(depfile); \ |
262 | mv -f $(dot-target).tmp $(dot-target).cmd) | 262 | mv -f $(dot-target).tmp $(dot-target).cmd, @:) |
263 | 263 | ||
264 | # Usage: $(call if_changed_rule,foo) | 264 | # Usage: $(call if_changed_rule,foo) |
265 | # Will check if $(cmd_foo) or any of the prerequisites changed, | 265 | # Will check if $(cmd_foo) or any of the prerequisites changed, |
266 | # and if so will execute $(rule_foo). | 266 | # and if so will execute $(rule_foo). |
267 | if_changed_rule = $(if $(strip $(any-prereq) $(arg-check) ), \ | 267 | if_changed_rule = $(if $(strip $(any-prereq) $(arg-check) ), \ |
268 | @set -e; \ | 268 | @set -e; \ |
269 | $(rule_$(1))) | 269 | $(rule_$(1)), @:) |
270 | 270 | ||
271 | ### | 271 | ### |
272 | # why - tell why a a target got build | 272 | # why - tell why a a target got build |
diff --git a/scripts/Makefile.dtbinst b/scripts/Makefile.dtbinst index 1c15717e0d56..a1be75d0a5fd 100644 --- a/scripts/Makefile.dtbinst +++ b/scripts/Makefile.dtbinst | |||
@@ -23,8 +23,6 @@ include $(src)/Makefile | |||
23 | PHONY += __dtbs_install_prep | 23 | PHONY += __dtbs_install_prep |
24 | __dtbs_install_prep: | 24 | __dtbs_install_prep: |
25 | ifeq ("$(dtbinst-root)", "$(obj)") | 25 | ifeq ("$(dtbinst-root)", "$(obj)") |
26 | $(Q)if [ -d $(INSTALL_DTBS_PATH).old ]; then rm -rf $(INSTALL_DTBS_PATH).old; fi | ||
27 | $(Q)if [ -d $(INSTALL_DTBS_PATH) ]; then mv $(INSTALL_DTBS_PATH) $(INSTALL_DTBS_PATH).old; fi | ||
28 | $(Q)mkdir -p $(INSTALL_DTBS_PATH) | 26 | $(Q)mkdir -p $(INSTALL_DTBS_PATH) |
29 | endif | 27 | endif |
30 | 28 | ||
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index 5b327c67a828..caef815d1743 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c | |||
@@ -274,7 +274,11 @@ static void do_config_file(const char *filename) | |||
274 | perror(filename); | 274 | perror(filename); |
275 | exit(2); | 275 | exit(2); |
276 | } | 276 | } |
277 | fstat(fd, &st); | 277 | if (fstat(fd, &st) < 0) { |
278 | fprintf(stderr, "fixdep: error fstat'ing config file: "); | ||
279 | perror(filename); | ||
280 | exit(2); | ||
281 | } | ||
278 | if (st.st_size == 0) { | 282 | if (st.st_size == 0) { |
279 | close(fd); | 283 | close(fd); |
280 | return; | 284 | return; |
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh index 453ede9d2f3d..49d61ade9425 100755 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh | |||
@@ -97,9 +97,10 @@ kallsyms() | |||
97 | local aflags="${KBUILD_AFLAGS} ${KBUILD_AFLAGS_KERNEL} \ | 97 | local aflags="${KBUILD_AFLAGS} ${KBUILD_AFLAGS_KERNEL} \ |
98 | ${NOSTDINC_FLAGS} ${LINUXINCLUDE} ${KBUILD_CPPFLAGS}" | 98 | ${NOSTDINC_FLAGS} ${LINUXINCLUDE} ${KBUILD_CPPFLAGS}" |
99 | 99 | ||
100 | ${NM} -n ${1} | \ | 100 | local afile="`basename ${2} .o`.S" |
101 | scripts/kallsyms ${kallsymopt} | \ | 101 | |
102 | ${CC} ${aflags} -c -o ${2} -x assembler-with-cpp - | 102 | ${NM} -n ${1} | scripts/kallsyms ${kallsymopt} > ${afile} |
103 | ${CC} ${aflags} -c -o ${2} ${afile} | ||
103 | } | 104 | } |
104 | 105 | ||
105 | # Create map file with all symbols from ${1} | 106 | # Create map file with all symbols from ${1} |