Skip to content

Commit

Permalink
Merge tag 'kbuild-v6.10' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/masahiroy/linux-kbuild

Pull Kbuild updates from Masahiro Yamada:

 - Avoid 'constexpr', which is a keyword in C23

 - Allow 'dtbs_check' and 'dt_compatible_check' run independently of
   'dt_binding_check'

 - Fix weak references to avoid GOT entries in position-independent code
   generation

 - Convert the last use of 'optional' property in arch/sh/Kconfig

 - Remove support for the 'optional' property in Kconfig

 - Remove support for Clang's ThinLTO caching, which does not work with
   the .incbin directive

 - Change the semantics of $(src) so it always points to the source
   directory, which fixes Makefile inconsistencies between upstream and
   downstream

 - Fix 'make tar-pkg' for RISC-V to produce a consistent package

 - Provide reasonable default coverage for objtool, sanitizers, and
   profilers

 - Remove redundant OBJECT_FILES_NON_STANDARD, KASAN_SANITIZE, etc.

 - Remove the last use of tristate choice in drivers/rapidio/Kconfig

 - Various cleanups and fixes in Kconfig

* tag 'kbuild-v6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (46 commits)
  kconfig: use sym_get_choice_menu() in sym_check_prop()
  rapidio: remove choice for enumeration
  kconfig: lxdialog: remove initialization with A_NORMAL
  kconfig: m/nconf: merge two item_add_str() calls
  kconfig: m/nconf: remove dead code to display value of bool choice
  kconfig: m/nconf: remove dead code to display children of choice members
  kconfig: gconf: show checkbox for choice correctly
  kbuild: use GCOV_PROFILE and KCSAN_SANITIZE in scripts/Makefile.modfinal
  Makefile: remove redundant tool coverage variables
  kbuild: provide reasonable defaults for tool coverage
  modules: Drop the .export_symbol section from the final modules
  kconfig: use menu_list_for_each_sym() in sym_check_choice_deps()
  kconfig: use sym_get_choice_menu() in conf_write_defconfig()
  kconfig: add sym_get_choice_menu() helper
  kconfig: turn defaults and additional prompt for choice members into error
  kconfig: turn missing prompt for choice members into error
  kconfig: turn conf_choice() into void function
  kconfig: use linked list in sym_set_changed()
  kconfig: gconf: use MENU_CHANGED instead of SYMBOL_CHANGED
  kconfig: gconf: remove debug code
  ...
  • Loading branch information
torvalds committed May 18, 2024
2 parents 0cc6f45 + 6ffe4fd commit ff9a793
Show file tree
Hide file tree
Showing 177 changed files with 611 additions and 946 deletions.
8 changes: 4 additions & 4 deletions Documentation/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,22 @@ loop_cmd = $(echo-cmd) $(cmd_$(1)) || exit;
# * dest folder relative to $(BUILDDIR) and
# * cache folder relative to $(BUILDDIR)/.doctrees
# $4 dest subfolder e.g. "man" for man pages at userspace-api/media/man
# $5 reST source folder relative to $(srctree)/$(src),
# $5 reST source folder relative to $(src),
# e.g. "userspace-api/media" for the linux-tv book-set at ./Documentation/userspace-api/media

quiet_cmd_sphinx = SPHINX $@ --> file://$(abspath $(BUILDDIR)/$3/$4)
cmd_sphinx = $(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/userspace-api/media $2 && \
PYTHONDONTWRITEBYTECODE=1 \
BUILDDIR=$(abspath $(BUILDDIR)) SPHINX_CONF=$(abspath $(srctree)/$(src)/$5/$(SPHINX_CONF)) \
BUILDDIR=$(abspath $(BUILDDIR)) SPHINX_CONF=$(abspath $(src)/$5/$(SPHINX_CONF)) \
$(PYTHON3) $(srctree)/scripts/jobserver-exec \
$(CONFIG_SHELL) $(srctree)/Documentation/sphinx/parallel-wrapper.sh \
$(SPHINXBUILD) \
-b $2 \
-c $(abspath $(srctree)/$(src)) \
-c $(abspath $(src)) \
-d $(abspath $(BUILDDIR)/.doctrees/$3) \
-D version=$(KERNELVERSION) -D release=$(KERNELRELEASE) \
$(ALLSPHINXOPTS) \
$(abspath $(srctree)/$(src)/$5) \
$(abspath $(src)/$5) \
$(abspath $(BUILDDIR)/$3/$4) && \
if [ "x$(DOCS_CSS)" != "x" ]; then \
cp $(if $(patsubst /%,,$(DOCS_CSS)),$(abspath $(srctree)/$(DOCS_CSS)),$(DOCS_CSS)) $(BUILDDIR)/$3/_static/; \
Expand Down
36 changes: 21 additions & 15 deletions Documentation/devicetree/bindings/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,36 +25,32 @@ quiet_cmd_extract_ex = DTEX $@
$(obj)/%.example.dts: $(src)/%.yaml check_dtschema_version FORCE
$(call if_changed,extract_ex)

find_all_cmd = find $(srctree)/$(src) \( -name '*.yaml' ! \
find_all_cmd = find $(src) \( -name '*.yaml' ! \
-name 'processed-schema*' \)

find_cmd = $(find_all_cmd) | \
sed 's|^$(srctree)/||' | \
grep -F -e "$(subst :," -e ",$(DT_SCHEMA_FILES))" | \
sed 's|^|$(srctree)/|'
CHK_DT_DOCS := $(shell $(find_cmd))
CHK_DT_EXAMPLES := $(patsubst $(srctree)/%.yaml,%.example.dtb, $(shell $(find_cmd)))

quiet_cmd_yamllint = LINT $(src)
cmd_yamllint = ($(find_cmd) | \
xargs -n200 -P$$(nproc) \
$(DT_SCHEMA_LINT) -f parsable -c $(srctree)/$(src)/.yamllint >&2) || true
$(DT_SCHEMA_LINT) -f parsable -c $(src)/.yamllint >&2) \
&& touch $@ || true

quiet_cmd_chk_bindings = CHKDT $@
quiet_cmd_chk_bindings = CHKDT $(src)
cmd_chk_bindings = ($(find_cmd) | \
xargs -n200 -P$$(nproc) $(DT_DOC_CHECKER) -u $(srctree)/$(src)) || true
xargs -n200 -P$$(nproc) $(DT_DOC_CHECKER) -u $(src)) \
&& touch $@ || true

quiet_cmd_mk_schema = SCHEMA $@
cmd_mk_schema = f=$$(mktemp) ; \
$(find_all_cmd) > $$f ; \
$(DT_MK_SCHEMA) -j $(DT_MK_SCHEMA_FLAGS) @$$f > $@ ; \
rm -f $$f

define rule_chkdt
$(if $(DT_SCHEMA_LINT),$(call cmd,yamllint),)
$(call cmd,chk_bindings)
$(call cmd,mk_schema)
endef

DT_DOCS = $(patsubst $(srctree)/%,%,$(shell $(find_all_cmd)))

override DTC_FLAGS := \
Expand All @@ -64,12 +60,19 @@ override DTC_FLAGS := \
-Wno-unique_unit_address \
-Wunique_unit_address_if_enabled

$(obj)/processed-schema.json: $(DT_DOCS) $(src)/.yamllint check_dtschema_version FORCE
$(call if_changed_rule,chkdt)
$(obj)/processed-schema.json: $(DT_DOCS) check_dtschema_version FORCE
$(call if_changed,mk_schema)

targets += .dt-binding.checked .yamllint.checked
$(obj)/.yamllint.checked: $(DT_DOCS) $(src)/.yamllint FORCE
$(if $(DT_SCHEMA_LINT),$(call if_changed,yamllint),)

$(obj)/.dt-binding.checked: $(DT_DOCS) FORCE
$(call if_changed,chk_bindings)

always-y += processed-schema.json
always-$(CHECK_DT_BINDING) += $(patsubst $(srctree)/$(src)/%.yaml,%.example.dts, $(CHK_DT_DOCS))
always-$(CHECK_DT_BINDING) += $(patsubst $(srctree)/$(src)/%.yaml,%.example.dtb, $(CHK_DT_DOCS))
targets += $(patsubst $(obj)/%,%, $(CHK_DT_EXAMPLES))
targets += $(patsubst $(obj)/%.dtb,%.dts, $(CHK_DT_EXAMPLES))

# Hack: avoid 'Argument list too long' error for 'make clean'. Remove most of
# build artifacts here before they are processed by scripts/Makefile.clean
Expand All @@ -78,3 +81,6 @@ clean-files = $(shell find $(obj) \( -name '*.example.dts' -o \

dt_compatible_check: $(obj)/processed-schema.json
$(Q)$(srctree)/scripts/dtc/dt-extract-compatibles $(srctree) | xargs dt-check-compatible -v -s $<

PHONY += dt_binding_check
dt_binding_check: $(obj)/.dt-binding.checked $(obj)/.yamllint.checked $(CHK_DT_EXAMPLES)
3 changes: 0 additions & 3 deletions Documentation/kbuild/kconfig-language.rst
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,6 @@ to be set to 'm'. This can be used if multiple drivers for a single
hardware exists and only a single driver can be compiled/loaded into
the kernel, but all drivers can be compiled as modules.

A choice accepts another option "optional", which allows to set the
choice to 'n' and no entry needs to be selected.

comment::

"comment" <prompt>
Expand Down
12 changes: 6 additions & 6 deletions Documentation/kbuild/makefiles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ ccflags-y, asflags-y and ldflags-y
Example::

#arch/cris/boot/compressed/Makefile
ldflags-y += -T $(srctree)/$(src)/decompress_$(arch-y).lds
ldflags-y += -T $(src)/decompress_$(arch-y).lds

subdir-ccflags-y, subdir-asflags-y
The two flags listed above are similar to ccflags-y and asflags-y.
Expand Down Expand Up @@ -426,14 +426,14 @@ path to prerequisite files and target files.
Two variables are used when defining custom rules:

$(src)
$(src) is a relative path which points to the directory
where the Makefile is located. Always use $(src) when
$(src) is the directory where the Makefile is located. Always use $(src) when
referring to files located in the src tree.

$(obj)
$(obj) is a relative path which points to the directory
where the target is saved. Always use $(obj) when
referring to generated files.
$(obj) is the directory where the target is saved. Always use $(obj) when
referring to generated files. Use $(obj) for pattern rules that need to work
for both generated files and real sources (VPATH will help to find the
prerequisites not only in the object tree but also in the source tree).

Example::

Expand Down
44 changes: 27 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,14 @@ srctree := $(abs_srctree)
endif

objtree := .

VPATH :=

ifeq ($(KBUILD_EXTMOD),)
ifdef building_out_of_srctree
VPATH := $(srctree)
endif
endif

export building_out_of_srctree srctree objtree VPATH

Expand Down Expand Up @@ -942,7 +949,6 @@ endif
ifdef CONFIG_LTO_CLANG
ifdef CONFIG_LTO_CLANG_THIN
CC_FLAGS_LTO := -flto=thin -fsplit-lto-unit
KBUILD_LDFLAGS += --thinlto-cache-dir=$(extmod_prefix).thinlto-cache
else
CC_FLAGS_LTO := -flto
endif
Expand Down Expand Up @@ -1248,8 +1254,8 @@ define filechk_version.h
echo \#define LINUX_VERSION_SUBLEVEL $(SUBLEVEL)
endef

$(version_h): PATCHLEVEL := $(or $(PATCHLEVEL), 0)
$(version_h): SUBLEVEL := $(or $(SUBLEVEL), 0)
$(version_h): private PATCHLEVEL := $(or $(PATCHLEVEL), 0)
$(version_h): private SUBLEVEL := $(or $(SUBLEVEL), 0)
$(version_h): FORCE
$(call filechk,version.h)

Expand Down Expand Up @@ -1403,7 +1409,7 @@ export CHECK_DTBS=y
endif

ifneq ($(CHECK_DTBS),)
dtbs_prepare: dt_binding_check
dtbs_prepare: dt_binding_schemas
endif

dtbs_check: dtbs
Expand All @@ -1422,15 +1428,18 @@ scripts_dtc: scripts_basic
$(Q)$(MAKE) $(build)=scripts/dtc

ifneq ($(filter dt_binding_check, $(MAKECMDGOALS)),)
export CHECK_DT_BINDING=y
export CHECK_DTBS=y
endif

PHONY += dt_binding_check
dt_binding_check: scripts_dtc
PHONY += dt_binding_check dt_binding_schemas
dt_binding_check: dt_binding_schemas scripts_dtc
$(Q)$(MAKE) $(build)=Documentation/devicetree/bindings $@

dt_binding_schemas:
$(Q)$(MAKE) $(build)=Documentation/devicetree/bindings

PHONY += dt_compatible_check
dt_compatible_check: dt_binding_check
dt_compatible_check: dt_binding_schemas
$(Q)$(MAKE) $(build)=Documentation/devicetree/bindings $@

# ---------------------------------------------------------------------------
Expand Down Expand Up @@ -1477,7 +1486,7 @@ endif # CONFIG_MODULES
# Directories & files removed with 'make clean'
CLEAN_FILES += vmlinux.symvers modules-only.symvers \
modules.builtin modules.builtin.modinfo modules.nsdeps \
compile_commands.json .thinlto-cache rust/test \
compile_commands.json rust/test \
rust-project.json .vmlinux.objs .vmlinux.export.c

# Directories & files removed with 'make mrproper'
Expand All @@ -1494,7 +1503,7 @@ MRPROPER_FILES += include/config include/generated \

# clean - Delete most, but leave enough to build external modules
#
clean: rm-files := $(CLEAN_FILES)
clean: private rm-files := $(CLEAN_FILES)

PHONY += archclean vmlinuxclean

Expand All @@ -1506,7 +1515,7 @@ clean: archclean vmlinuxclean resolve_btfids_clean

# mrproper - Delete all generated files, including .config
#
mrproper: rm-files := $(wildcard $(MRPROPER_FILES))
mrproper: private rm-files := $(MRPROPER_FILES)
mrproper-dirs := $(addprefix _mrproper_,scripts)

PHONY += $(mrproper-dirs) mrproper
Expand Down Expand Up @@ -1626,10 +1635,11 @@ help:
@echo ''
@$(if $(dtstree), \
echo 'Devicetree:'; \
echo '* dtbs - Build device tree blobs for enabled boards'; \
echo ' dtbs_install - Install dtbs to $(INSTALL_DTBS_PATH)'; \
echo ' dt_binding_check - Validate device tree binding documents'; \
echo ' dtbs_check - Validate device tree source files';\
echo '* dtbs - Build device tree blobs for enabled boards'; \
echo ' dtbs_install - Install dtbs to $(INSTALL_DTBS_PATH)'; \
echo ' dt_binding_check - Validate device tree binding documents and examples'; \
echo ' dt_binding_schema - Build processed device tree binding schemas'; \
echo ' dtbs_check - Validate device tree source files';\
echo '')

@echo 'Userspace tools targets:'
Expand Down Expand Up @@ -1782,8 +1792,8 @@ compile_commands.json: $(extmod_prefix)compile_commands.json
PHONY += compile_commands.json

clean-dirs := $(KBUILD_EXTMOD)
clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers $(KBUILD_EXTMOD)/modules.nsdeps \
$(KBUILD_EXTMOD)/compile_commands.json $(KBUILD_EXTMOD)/.thinlto-cache
clean: private rm-files := $(KBUILD_EXTMOD)/Module.symvers $(KBUILD_EXTMOD)/modules.nsdeps \
$(KBUILD_EXTMOD)/compile_commands.json

PHONY += prepare
# now expand this into a simple variable to reduce the cost of shell evaluations
Expand Down
3 changes: 1 addition & 2 deletions arch/arc/boot/dts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ obj-y += $(builtindtb-y).dtb.o
dtb-y := $(builtindtb-y).dtb

# for CONFIG_OF_ALL_DTBS test
dtstree := $(srctree)/$(src)
dtb- := $(patsubst $(dtstree)/%.dts,%.dtb, $(wildcard $(dtstree)/*.dts))
dtb- := $(patsubst $(src)/%.dts,%.dtb, $(wildcard $(src)/*.dts))

# board-specific dtc flags
DTC_FLAGS_hsdk += --pad 20
2 changes: 1 addition & 1 deletion arch/arm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0-only
obj-$(CONFIG_FPE_NWFPE) += nwfpe/
# Put arch/arm/fastfpe/ to use this.
obj-$(CONFIG_FPE_FASTFPE) += $(patsubst $(srctree)/$(src)/%,%,$(wildcard $(srctree)/$(src)/fastfpe/))
obj-$(CONFIG_FPE_FASTFPE) += $(patsubst $(src)/%,%,$(wildcard $(src)/fastfpe/))
obj-$(CONFIG_VFP) += vfp/
obj-$(CONFIG_XEN) += xen/
obj-$(CONFIG_VDSO) += vdso/
Expand Down
3 changes: 1 addition & 2 deletions arch/arm/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ targets := Image zImage xipImage bootpImage uImage

ifeq ($(CONFIG_XIP_KERNEL),y)

cmd_deflate_xip_data = $(CONFIG_SHELL) -c \
'$(srctree)/$(src)/deflate_xip_data.sh $< $@'
cmd_deflate_xip_data = $(CONFIG_SHELL) -c '$(src)/deflate_xip_data.sh $< $@'

ifeq ($(CONFIG_XIP_DEFLATED_DATA),y)
quiet_cmd_mkxip = XIPZ $@
Expand Down
1 change: 0 additions & 1 deletion arch/arm/boot/bootp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# This file is included by the global makefile so that you can add your own
# architecture-specific flags and dependencies.
#
GCOV_PROFILE := n

ifdef PHYS_OFFSET
add_hex = $(shell printf 0x%x $$(( $(1) + $(2) )) )
Expand Down
7 changes: 0 additions & 7 deletions arch/arm/boot/compressed/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@ ifeq ($(CONFIG_ARM_VIRT_EXT),y)
OBJS += hyp-stub.o
endif

GCOV_PROFILE := n
KASAN_SANITIZE := n

# Prevents link failures: __sanitizer_cov_trace_pc() is not linked in.
KCOV_INSTRUMENT := n
UBSAN_SANITIZE := n

#
# Architecture dependencies
#
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-s3c/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Copyright 2009 Simtec Electronics

include $(srctree)/$(src)/Makefile.s3c64xx
include $(src)/Makefile.s3c64xx

# Objects we always build independent of SoC choice

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/plat-orion/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Makefile for the linux kernel.
#
ccflags-y := -I$(srctree)/$(src)/include
ccflags-y := -I$(src)/include

orion-gpio-$(CONFIG_GPIOLIB) += gpio.o
obj-$(CONFIG_PLAT_ORION_LEGACY) += irq.o pcie.o time.o common.o mpp.o
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ gen := arch/$(ARCH)/include/generated
kapi := $(gen)/asm
uapi := $(gen)/uapi/asm
syshdr := $(srctree)/scripts/syscallhdr.sh
sysnr := $(srctree)/$(src)/syscallnr.sh
sysnr := $(src)/syscallnr.sh
systbl := $(srctree)/scripts/syscalltbl.sh
syscall := $(src)/syscall.tbl

Expand Down
9 changes: 0 additions & 9 deletions arch/arm/vdso/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,6 @@ else
CFLAGS_vgettimeofday.o = -O2 -include $(c-gettimeofday-y)
endif

# Disable gcov profiling for VDSO code
GCOV_PROFILE := n
UBSAN_SANITIZE := n

# Prevents link failures: __sanitizer_cov_trace_pc() is not linked in.
KCOV_INSTRUMENT := n

KASAN_SANITIZE := n

# Force dependency
$(obj)/vdso.o : $(obj)/vdso.so

Expand Down
6 changes: 0 additions & 6 deletions arch/arm64/kernel/pi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_SCS), $(KBUILD_CFLAGS))
# disable LTO
KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_LTO), $(KBUILD_CFLAGS))

GCOV_PROFILE := n
KASAN_SANITIZE := n
KCSAN_SANITIZE := n
UBSAN_SANITIZE := n
KCOV_INSTRUMENT := n

hostprogs := relacheck

quiet_cmd_piobjcopy = $(quiet_cmd_objcopy)
Expand Down
10 changes: 1 addition & 9 deletions arch/arm64/kernel/vdso/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,13 @@ CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) -Os $(CC_FLAGS_SCS) \
$(RANDSTRUCT_CFLAGS) $(GCC_PLUGINS_CFLAGS) \
$(CC_FLAGS_LTO) $(CC_FLAGS_CFI) \
-Wmissing-prototypes -Wmissing-declarations
KASAN_SANITIZE := n
KCSAN_SANITIZE := n
UBSAN_SANITIZE := n
OBJECT_FILES_NON_STANDARD := y
KCOV_INSTRUMENT := n

CFLAGS_vgettimeofday.o = -O2 -mcmodel=tiny -fasynchronous-unwind-tables

ifneq ($(c-gettimeofday-y),)
CFLAGS_vgettimeofday.o += -include $(c-gettimeofday-y)
endif

# Disable gcov profiling for VDSO code
GCOV_PROFILE := n

targets += vdso.lds
CPPFLAGS_vdso.lds += -P -C -U$(ARCH)

Expand All @@ -68,7 +60,7 @@ $(obj)/%.so: $(obj)/%.so.dbg FORCE
$(call if_changed,objcopy)

# Generate VDSO offsets using helper script
gen-vdsosym := $(srctree)/$(src)/gen_vdso_offsets.sh
gen-vdsosym := $(src)/gen_vdso_offsets.sh
quiet_cmd_vdsosym = VDSOSYM $@
cmd_vdsosym = $(NM) $< | $(gen-vdsosym) | LC_ALL=C sort > $@

Expand Down
Loading

0 comments on commit ff9a793

Please sign in to comment.