diff options
author | Linus Torvalds | 2017-07-07 14:09:24 -0700 |
---|---|---|
committer | Linus Torvalds | 2017-07-07 14:09:24 -0700 |
commit | 58f051fc9828709e6c55803510761413d92c4e57 (patch) | |
tree | 8b92cf129f74105d9b17ada2b227aa45f2898d51 /scripts | |
parent | ef3ad0898a60d30da7f170032992914998c366e5 (diff) | |
parent | c4e6fff1ae5729c2af159008b13fca39fbbac70e (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.include | 19 | ||||
-rw-r--r-- | scripts/Makefile.asm-generic | 2 | ||||
-rw-r--r-- | scripts/Makefile.host | 6 | ||||
-rwxr-xr-x | scripts/checksyscalls.sh | 11 |
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,\ as-instr = $(call try-run,\ printf "%b\n" "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -x assembler -o "$$TMP" -,$(2),$(3)) +# __cc-option +# Usage: MY_CFLAGS += $(call __cc-option,$(CC),$(MY_CFLAGS),-march=winchip-c6,-march=i586) +__cc-option = $(call try-run,\ + $(1) -Werror $(2) $(3) -c -x c /dev/null -o "$$TMP",$(3),$(4)) + # Do not attempt to build with gcc plugins during cc-option tests. # (And this uses delayed resolution so the flags will be up to date.) CC_OPTION_CFLAGS = $(filter-out $(GCC_PLUGINS_CFLAGS),$(KBUILD_CFLAGS)) @@ -115,19 +120,19 @@ CC_OPTION_CFLAGS = $(filter-out $(GCC_PLUGINS_CFLAGS),$(KBUILD_CFLAGS)) # cc-option # Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586) -cc-option = $(call try-run,\ - $(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2)) +cc-option = $(call __cc-option, $(CC),\ + $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS),$(1),$(2)) + +# hostcc-option +# Usage: cflags-y += $(call hostcc-option,-march=winchip-c6,-march=i586) +hostcc-option = $(call __cc-option, $(HOSTCC),\ + $(HOSTCFLAGS) $(HOST_EXTRACFLAGS),$(1),$(2)) # cc-option-yn # Usage: flag := $(call cc-option-yn,-march=winchip-c6) cc-option-yn = $(call try-run,\ $(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n) -# cc-option-align -# Prefix align with either -falign or -malign -cc-option-align = $(subst -functions=0,,\ - $(call cc-option,-falign-functions=0,-malign-functions=0)) - # cc-disable-warning # Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable) cc-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)) # Stale wrappers when the corresponding files are removed from generic-y # need removing. -generated-y := $(generic-y) $(genhdr-y) $(generated-y) +generated-y := $(generic-y) $(generated-y) all-files := $(patsubst %, $(obj)/%, $(generated-y)) old-headers := $(wildcard $(obj)/*.h) unwanted := $(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 @@ # Will compile qconf as a C++ program, and menu as a C program. # They are linked as C++ code to the executable qconf -# hostcc-option -# Usage: cflags-y += $(call hostcc-option,-march=winchip-c6,-march=i586) - -hostcc-option = $(call try-run,\ - $(HOSTCC) $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2)) - __hostprogs := $(sort $(hostprogs-y) $(hostprogs-m)) host-cshlib := $(sort $(hostlibs-y) $(hostlibs-m)) host-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 } syscall_list() { - grep '^[0-9]' "$1" | sort -n | ( + grep '^[0-9]' "$1" | sort -n | while read nr abi name entry ; do - cat <<EOF -#if !defined(__NR_${name}) && !defined(__IGNORE_${name}) -#warning syscall ${name} not implemented -#endif -EOF + echo "#if !defined(__NR_${name}) && !defined(__IGNORE_${name})" + echo "#warning syscall ${name} not implemented" + echo "#endif" done - ) } (ignore_list && syscall_list $(dirname $0)/../arch/x86/entry/syscalls/syscall_32.tbl) | \ |