Skip to content

Commit

Permalink
Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/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
  • Loading branch information
torvalds committed Mar 25, 2016
2 parents 976fb3f + ea8daa7 commit 2162b80
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 9 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,9 @@ KBUILD_CFLAGS += $(call cc-option,-Werror=strict-prototypes)
# Prohibit date/time macros, which would make the build non-deterministic
KBUILD_CFLAGS += $(call cc-option,-Werror=date-time)

# enforce correct pointer usage
KBUILD_CFLAGS += $(call cc-option,-Werror=incompatible-pointer-types)

# use the deterministic mode of AR if available
KBUILD_ARFLAGS := $(call ar-option,D)

Expand Down
5 changes: 5 additions & 0 deletions include/linux/compiler-clang.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@
#undef uninitialized_var
#define uninitialized_var(x) x = *(&(x))
#endif

/* same as gcc, this was present in clang-2.6 so we can assume it works
* with any version that can compile the kernel
*/
#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
6 changes: 3 additions & 3 deletions scripts/Kbuild.include
Original file line number Diff line number Diff line change
Expand Up @@ -251,22 +251,22 @@ any-prereq = $(filter-out $(PHONY),$?) $(filter-out $(PHONY) $(wildcard $^),$^)
if_changed = $(if $(strip $(any-prereq) $(arg-check)), \
@set -e; \
$(echo-cmd) $(cmd_$(1)); \
printf '%s\n' 'cmd_$@ := $(make-cmd)' > $(dot-target).cmd)
printf '%s\n' 'cmd_$@ := $(make-cmd)' > $(dot-target).cmd, @:)

# Execute the command and also postprocess generated .d dependencies file.
if_changed_dep = $(if $(strip $(any-prereq) $(arg-check) ), \
@set -e; \
$(echo-cmd) $(cmd_$(1)); \
scripts/basic/fixdep $(depfile) $@ '$(make-cmd)' > $(dot-target).tmp;\
rm -f $(depfile); \
mv -f $(dot-target).tmp $(dot-target).cmd)
mv -f $(dot-target).tmp $(dot-target).cmd, @:)

# Usage: $(call if_changed_rule,foo)
# Will check if $(cmd_foo) or any of the prerequisites changed,
# and if so will execute $(rule_foo).
if_changed_rule = $(if $(strip $(any-prereq) $(arg-check) ), \
@set -e; \
$(rule_$(1)))
$(rule_$(1)), @:)

###
# why - tell why a a target got build
Expand Down
2 changes: 0 additions & 2 deletions scripts/Makefile.dtbinst
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ include $(src)/Makefile
PHONY += __dtbs_install_prep
__dtbs_install_prep:
ifeq ("$(dtbinst-root)", "$(obj)")
$(Q)if [ -d $(INSTALL_DTBS_PATH).old ]; then rm -rf $(INSTALL_DTBS_PATH).old; fi
$(Q)if [ -d $(INSTALL_DTBS_PATH) ]; then mv $(INSTALL_DTBS_PATH) $(INSTALL_DTBS_PATH).old; fi
$(Q)mkdir -p $(INSTALL_DTBS_PATH)
endif

Expand Down
6 changes: 5 additions & 1 deletion scripts/basic/fixdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,11 @@ static void do_config_file(const char *filename)
perror(filename);
exit(2);
}
fstat(fd, &st);
if (fstat(fd, &st) < 0) {
fprintf(stderr, "fixdep: error fstat'ing config file: ");
perror(filename);
exit(2);
}
if (st.st_size == 0) {
close(fd);
return;
Expand Down
7 changes: 4 additions & 3 deletions scripts/link-vmlinux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,10 @@ kallsyms()
local aflags="${KBUILD_AFLAGS} ${KBUILD_AFLAGS_KERNEL} \
${NOSTDINC_FLAGS} ${LINUXINCLUDE} ${KBUILD_CPPFLAGS}"

${NM} -n ${1} | \
scripts/kallsyms ${kallsymopt} | \
${CC} ${aflags} -c -o ${2} -x assembler-with-cpp -
local afile="`basename ${2} .o`.S"

${NM} -n ${1} | scripts/kallsyms ${kallsymopt} > ${afile}
${CC} ${aflags} -c -o ${2} ${afile}
}

# Create map file with all symbols from ${1}
Expand Down

0 comments on commit 2162b80

Please sign in to comment.