From: Linus Torvalds Date: Fri, 20 Sep 2019 15:36:47 +0000 (-0700) Subject: Merge tag 'kbuild-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy... X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=d7b0827f28ab3a4fd65864451ffefa695e3255fd;p=openwrt%2Fstaging%2Fblogic.git Merge tag 'kbuild-v5.4' of git://git./linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild updates from Masahiro Yamada: - add modpost warn exported symbols marked as 'static' because 'static' and EXPORT_SYMBOL is an odd combination - break the build early if gold linker is used - optimize the Bison rule to produce .c and .h files by a single pattern rule - handle PREEMPT_RT in the module vermagic and UTS_VERSION - warn CONFIG options leaked to the user-space except existing ones - make single targets work properly - rebuild modules when module linker scripts are updated - split the module final link stage into scripts/Makefile.modfinal - fix the missed error code in merge_config.sh - improve the error message displayed on the attempt of the O= build in unclean source tree - remove 'clean-dirs' syntax - disable -Wimplicit-fallthrough warning for Clang - add CONFIG_CC_OPTIMIZE_FOR_SIZE_O3 for ARC - remove ARCH_{CPP,A,C}FLAGS variables - add $(BASH) to run bash scripts - change *CFLAGS_.o to take the relative path to $(obj) instead of the basename - stop suppressing Clang's -Wunused-function warnings when W=1 - fix linux/export.h to avoid genksyms calculating CRC of trimmed exported symbols - misc cleanups * tag 'kbuild-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (63 commits) genksyms: convert to SPDX License Identifier for lex.l and parse.y modpost: use __section in the output to *.mod.c modpost: use MODULE_INFO() for __module_depends export.h, genksyms: do not make genksyms calculate CRC of trimmed symbols export.h: remove defined(__KERNEL__), which is no longer needed kbuild: allow Clang to find unused static inline functions for W=1 build kbuild: rename KBUILD_ENABLE_EXTRA_GCC_CHECKS to KBUILD_EXTRA_WARN kbuild: refactor scripts/Makefile.extrawarn merge_config.sh: ignore unwanted grep errors kbuild: change *FLAGS_.o to take the path relative to $(obj) modpost: add NOFAIL to strndup modpost: add guid_t type definition kbuild: add $(BASH) to run scripts with bash-extension kbuild: remove ARCH_{CPP,A,C}FLAGS kbuild,arc: add CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 for ARC kbuild: Do not enable -Wimplicit-fallthrough for clang for now kbuild: clean up subdir-ymn calculation in Makefile.clean kbuild: remove unneeded '+' marker from cmd_clean kbuild: remove clean-dirs syntax kbuild: check clean srctree even earlier ... --- d7b0827f28ab3a4fd65864451ffefa695e3255fd diff --cc arch/ia64/Kconfig index 9711cf730929,3dead116a6d7..685a3df126ca --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig @@@ -10,15 -10,14 +10,16 @@@ config IA6 bool select ARCH_MIGHT_HAVE_PC_PARPORT select ARCH_MIGHT_HAVE_PC_SERIO - select ACPI if (!IA64_HP_SIM) - select ARCH_SUPPORTS_ACPI if (!IA64_HP_SIM) + select ACPI + select ACPI_NUMA if NUMA + select ARCH_SUPPORTS_ACPI select ACPI_SYSTEM_POWER_STATES_SUPPORT if ACPI select ARCH_MIGHT_HAVE_ACPI_PDC if ACPI - select FORCE_PCI if (!IA64_HP_SIM) + select FORCE_PCI select PCI_DOMAINS if PCI + select PCI_MSI select PCI_SYSCALL if PCI + select HAVE_ASM_MODVERSIONS select HAVE_UNSTABLE_SCHED_CLOCK select HAVE_EXIT_THREAD select HAVE_IDE diff --cc arch/riscv/Makefile index 4f0a3d2018d2,426d989125a8..f5e914210245 --- a/arch/riscv/Makefile +++ b/arch/riscv/Makefile @@@ -52,11 -52,8 +52,11 @@@ ifeq ($(CONFIG_CMODEL_MEDANY),y KBUILD_CFLAGS += -mcmodel=medany endif ifeq ($(CONFIG_MODULE_SECTIONS),y) - KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/riscv/kernel/module.lds + KBUILD_LDS_MODULE += $(srctree)/arch/riscv/kernel/module.lds endif +ifeq ($(CONFIG_PERF_EVENTS),y) + KBUILD_CFLAGS += -fno-omit-frame-pointer +endif KBUILD_CFLAGS_MODULE += $(call cc-option,-mno-relax) diff --cc drivers/gpu/drm/amd/display/dc/calcs/Makefile index 16614d73a5fc,d930df63772c..985633c08a26 --- a/drivers/gpu/drm/amd/display/dc/calcs/Makefile +++ b/drivers/gpu/drm/amd/display/dc/calcs/Makefile @@@ -32,13 -32,9 +32,13 @@@ endi calcs_ccflags := -mhard-float -msse $(cc_stack_align) +ifdef CONFIG_CC_IS_CLANG +calcs_ccflags += -msse2 +endif + - CFLAGS_dcn_calcs.o := $(calcs_ccflags) - CFLAGS_dcn_calc_auto.o := $(calcs_ccflags) - CFLAGS_dcn_calc_math.o := $(calcs_ccflags) -Wno-tautological-compare + CFLAGS_$(AMDDALPATH)/dc/calcs/dcn_calcs.o := $(calcs_ccflags) + CFLAGS_$(AMDDALPATH)/dc/calcs/dcn_calc_auto.o := $(calcs_ccflags) + CFLAGS_$(AMDDALPATH)/dc/calcs/dcn_calc_math.o := $(calcs_ccflags) -Wno-tautological-compare BW_CALCS = dce_calcs.o bw_fixed.o custom_float.o diff --cc drivers/gpu/drm/amd/display/dc/dcn20/Makefile index f57a3b281408,83635ad9124e..ddb8d5649e79 --- a/drivers/gpu/drm/amd/display/dc/dcn20/Makefile +++ b/drivers/gpu/drm/amd/display/dc/dcn20/Makefile @@@ -16,12 -16,8 +16,12 @@@ else ifneq ($(call cc-option, -mstack-a cc_stack_align := -mstack-alignment=16 endif - CFLAGS_dcn20_resource.o := -mhard-float -msse $(cc_stack_align) + CFLAGS_$(AMDDALPATH)/dc/dcn20/dcn20_resource.o := -mhard-float -msse $(cc_stack_align) +ifdef CONFIG_CC_IS_CLANG - CFLAGS_dcn20_resource.o += -msse2 ++CFLAGS_$(AMDDALPATH)/dc/dcn20/dcn20_resource.o += -msse2 +endif + AMD_DAL_DCN20 = $(addprefix $(AMDDALPATH)/dc/dcn20/,$(DCN20)) AMD_DISPLAY_FILES += $(AMD_DAL_DCN20) diff --cc drivers/gpu/drm/amd/display/dc/dcn21/Makefile index b2b39090fb57,000000000000..8cd9de8b1a7a mode 100644,000000..100644 --- a/drivers/gpu/drm/amd/display/dc/dcn21/Makefile +++ b/drivers/gpu/drm/amd/display/dc/dcn21/Makefile @@@ -1,10 -1,0 +1,10 @@@ +# +# Makefile for DCN21. + +DCN21 = dcn21_hubp.o dcn21_hubbub.o dcn21_resource.o + - CFLAGS_dcn21_resource.o := -mhard-float -msse -mpreferred-stack-boundary=4 ++CFLAGS_$(AMDDALPATH)/dc/dcn21/dcn21_resource.o := -mhard-float -msse -mpreferred-stack-boundary=4 + +AMD_DAL_DCN21 = $(addprefix $(AMDDALPATH)/dc/dcn21/,$(DCN21)) + +AMD_DISPLAY_FILES += $(AMD_DAL_DCN21) diff --cc drivers/gpu/drm/amd/display/dc/dml/Makefile index af2a864a6da0,83792e2c0f0e..5b2a65b42403 --- a/drivers/gpu/drm/amd/display/dc/dml/Makefile +++ b/drivers/gpu/drm/amd/display/dc/dml/Makefile @@@ -32,29 -32,16 +32,26 @@@ endi dml_ccflags := -mhard-float -msse $(cc_stack_align) +ifdef CONFIG_CC_IS_CLANG +dml_ccflags += -msse2 +endif + - CFLAGS_display_mode_lib.o := $(dml_ccflags) + CFLAGS_$(AMDDALPATH)/dc/dml/display_mode_lib.o := $(dml_ccflags) ifdef CONFIG_DRM_AMD_DC_DCN2_0 - CFLAGS_display_mode_vba.o := $(dml_ccflags) - CFLAGS_display_mode_vba_20.o := $(dml_ccflags) - CFLAGS_display_rq_dlg_calc_20.o := $(dml_ccflags) - CFLAGS_display_mode_vba_20v2.o := $(dml_ccflags) - CFLAGS_display_rq_dlg_calc_20v2.o := $(dml_ccflags) + CFLAGS_$(AMDDALPATH)/dc/dml/display_mode_vba.o := $(dml_ccflags) + CFLAGS_$(AMDDALPATH)/dc/dml/dcn20/display_mode_vba_20.o := $(dml_ccflags) + CFLAGS_$(AMDDALPATH)/dc/dml/dcn20/display_rq_dlg_calc_20.o := $(dml_ccflags) ++CFLAGS_$(AMDDALPATH)/dc/dml/dcn20/display_mode_vba_20v2.o := $(dml_ccflags) ++CFLAGS_$(AMDDALPATH)/dc/dml/dcn20/display_rq_dlg_calc_20v2.o := $(dml_ccflags) +endif +ifdef CONFIG_DRM_AMD_DC_DCN2_1 - CFLAGS_display_mode_vba_21.o := $(dml_ccflags) - CFLAGS_display_rq_dlg_calc_21.o := $(dml_ccflags) ++CFLAGS_$(AMDDALPATH)/dc/dml/dcn21/display_mode_vba_21.o := $(dml_ccflags) ++CFLAGS_$(AMDDALPATH)/dc/dml/dcn21/display_rq_dlg_calc_21.o := $(dml_ccflags) endif - ifdef CONFIG_DRM_AMD_DCN3AG - CFLAGS_display_mode_vba_3ag.o := $(dml_ccflags) - endif - CFLAGS_dml1_display_rq_dlg_calc.o := $(dml_ccflags) - CFLAGS_display_rq_dlg_helpers.o := $(dml_ccflags) - CFLAGS_dml_common_defs.o := $(dml_ccflags) + CFLAGS_$(AMDDALPATH)/dc/dml/dml1_display_rq_dlg_calc.o := $(dml_ccflags) + CFLAGS_$(AMDDALPATH)/dc/dml/display_rq_dlg_helpers.o := $(dml_ccflags) + CFLAGS_$(AMDDALPATH)/dc/dml/dml_common_defs.o := $(dml_ccflags) DML = display_mode_lib.o display_rq_dlg_helpers.o dml1_display_rq_dlg_calc.o \ dml_common_defs.o diff --cc drivers/gpu/drm/amd/display/dc/dsc/Makefile index 17db603f2d1f,c3922d6e7696..b456cd23c6fa --- a/drivers/gpu/drm/amd/display/dc/dsc/Makefile +++ b/drivers/gpu/drm/amd/display/dc/dsc/Makefile @@@ -9,14 -9,9 +9,13 @@@ endi dsc_ccflags := -mhard-float -msse $(cc_stack_align) +ifdef CONFIG_CC_IS_CLANG +dsc_ccflags += -msse2 +endif + - CFLAGS_rc_calc.o := $(dsc_ccflags) - CFLAGS_rc_calc_dpi.o := $(dsc_ccflags) - CFLAGS_codec_main_amd.o := $(dsc_ccflags) - CFLAGS_dc_dsc.o := $(dsc_ccflags) + CFLAGS_$(AMDDALPATH)/dc/dsc/rc_calc.o := $(dsc_ccflags) + CFLAGS_$(AMDDALPATH)/dc/dsc/rc_calc_dpi.o := $(dsc_ccflags) + CFLAGS_$(AMDDALPATH)/dc/dsc/dc_dsc.o := $(dsc_ccflags) DSC = dc_dsc.o rc_calc.o rc_calc_dpi.o diff --cc scripts/link-vmlinux.sh index 8c59970a09dc,2438a9faf3f1..06495379fcd8 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh @@@ -56,17 -56,14 +56,19 @@@ modpost_link( } # Link of vmlinux -# ${1} - optional extra .o files -# ${2} - output file +# ${1} - output file +# ${2}, ${3}, ... - optional extra .o files vmlinux_link() { - info LD ${2} local lds="${objtree}/${KBUILD_LDS}" + local output=${1} local objects ++ info LD ${output} ++ + # skip output file argument + shift + if [ "${SRCARCH}" != "um" ]; then objects="--whole-archive \ ${KBUILD_VMLINUX_OBJS} \ @@@ -157,6 -139,18 +159,18 @@@ kallsyms( ${CC} ${aflags} -c -o ${2} ${afile} } + # Perform one step in kallsyms generation, including temporary linking of + # vmlinux. + kallsyms_step() + { + kallsymso_prev=${kallsymso} + kallsymso=.tmp_kallsyms${1}.o + kallsyms_vmlinux=.tmp_vmlinux${1} + - vmlinux_link "${kallsymso_prev}" ${kallsyms_vmlinux} ++ vmlinux_link ${kallsyms_vmlinux} "${kallsymso_prev}" ${btf_vmlinux_bin_o} + kallsyms ${kallsyms_vmlinux} ${kallsymso} + } + # Create map file with all symbols from ${1} # See mksymap for additional details mksysmap() @@@ -235,14 -228,8 +249,15 @@@ ${MAKE} -f "${srctree}/scripts/Makefile info MODINFO modules.builtin.modinfo ${OBJCOPY} -j .modinfo -O binary vmlinux.o modules.builtin.modinfo +btf_vmlinux_bin_o="" +if [ -n "${CONFIG_DEBUG_INFO_BTF}" ]; then + if gen_btf .tmp_vmlinux.btf .btf.vmlinux.bin.o ; then + btf_vmlinux_bin_o=.btf.vmlinux.bin.o + fi +fi + kallsymso="" + kallsymso_prev="" kallsyms_vmlinux="" if [ -n "${CONFIG_KALLSYMS}" ]; then @@@ -293,8 -268,11 +296,7 @@@ fi fi - info LD vmlinux - vmlinux_link vmlinux "${kallsymso}" "${btf_vmlinux_bin_o}" -vmlinux_link "${kallsymso}" vmlinux - -if [ -n "${CONFIG_DEBUG_INFO_BTF}" ]; then - gen_btf vmlinux -fi ++vmlinux_link vmlinux "${kallsymso}" ${btf_vmlinux_bin_o} if [ -n "${CONFIG_BUILDTIME_EXTABLE_SORT}" ]; then info SORTEX vmlinux