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
This commit is contained in:
@@ -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,\
|
||||
|
@@ -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))
|
||||
|
@@ -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))
|
||||
|
@@ -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) | \
|
||||
|
Reference in New Issue
Block a user