commit e3e42c96fa1e8f504ab499fcdc8e410878b983b6 Merge: 833477fce7a1 0715fdb03e2c Author: Masahiro Yamada Date: Thu Oct 6 11:03:56 2022 +0900 Merge branch 'kbuild' of ../../workspace/linux-kbuild into merge-test diff --cc Documentation/process/changes.rst index 9a90197989dd,26a7fd875cfa..9844ca3a71a6 --- a/Documentation/process/changes.rst +++ b/Documentation/process/changes.rst @@@ -31,9 -31,7 +31,9 @@@ you probably needn't concern yourself w ====================== =============== ======================================== GNU C 5.1 gcc --version Clang/LLVM (optional) 11.0.0 clang --version +Rust (optional) 1.62.0 rustc --version +bindgen (optional) 0.56.0 bindgen --version - GNU make 3.81 make --version + GNU make 3.82 make --version bash 4.2 bash --version binutils 2.23 ld -v flex 2.5.35 flex --version diff --cc Kbuild index fa441b98c9f6,8a37584d1fd6..464b34a08f51 --- a/Kbuild +++ b/Kbuild @@@ -42,18 -39,60 +39,61 @@@ $(offsets-file): arch/$(SRCARCH)/kernel quiet_cmd_syscalls = CALL $< cmd_syscalls = $(CONFIG_SHELL) $< $(CC) $(c_flags) $(missing_syscalls_flags) - missing-syscalls: scripts/checksyscalls.sh $(offsets-file) FORCE + PHONY += missing-syscalls + missing-syscalls: scripts/checksyscalls.sh $(offsets-file) $(call cmd,syscalls) - ##### - # Check atomic headers are up-to-date - - always-y += old-atomics - - quiet_cmd_atomics = CALL $< - cmd_atomics = $(CONFIG_SHELL) $< - - old-atomics: scripts/atomic/check-atomics.sh FORCE - $(call cmd,atomics) + # Check the manual modification of atomic headers + + quiet_cmd_check_sha1 = CHKSHA1 $< + cmd_check_sha1 = \ + if ! command -v sha1sum >/dev/null; then \ + echo "warning: cannot check the header due to sha1sum missing"; \ + exit 0; \ + fi; \ + if [ "$$(sed -n '$$s:// ::p' $<)" != \ + "$$(sed '$$d' $< | sha1sum | sed 's/ .*//')" ]; then \ + echo "error: $< has been modified." >&2; \ + exit 1; \ + fi; \ + touch $@ + + atomic-checks += $(addprefix $(obj)/.checked-, \ + atomic-arch-fallback.h \ + atomic-instrumented.h \ + atomic-long.h) + + targets += $(atomic-checks) + $(atomic-checks): $(obj)/.checked-%: include/linux/atomic/% FORCE + $(call if_changed,check_sha1) + + # A phony target that depends on all the preparation targets + + PHONY += prepare + prepare: $(offsets-file) missing-syscalls $(atomic-checks) + @: + + # Ordinary directory descending + # --------------------------------------------------------------------------- + + obj-y += init/ + obj-y += usr/ + obj-y += arch/$(SRCARCH)/ + obj-y += $(ARCH_CORE) + obj-y += kernel/ + obj-y += certs/ + obj-y += mm/ + obj-y += fs/ + obj-y += ipc/ + obj-y += security/ + obj-y += crypto/ + obj-$(CONFIG_BLOCK) += block/ + obj-$(CONFIG_IO_URING) += io_uring/ ++obj-$(CONFIG_RUST) += rust/ + obj-y += $(ARCH_LIB) + obj-y += drivers/ + obj-y += sound/ + obj-$(CONFIG_SAMPLES) += samples/ + obj-$(CONFIG_NET) += net/ + obj-y += virt/ + obj-y += $(ARCH_DRIVERS) diff --cc Makefile index f659d3085121,d7ba05191470..d66187d53b5f --- a/Makefile +++ b/Makefile @@@ -536,9 -501,8 +536,9 @@@ RUSTFLAGS_MODULE AFLAGS_MODULE = LDFLAGS_MODULE = CFLAGS_KERNEL = +RUSTFLAGS_KERNEL = AFLAGS_KERNEL = - LDFLAGS_vmlinux = + export LDFLAGS_vmlinux = # Use USERINCLUDE when you must reference the UAPI directories only. USERINCLUDE := \ @@@ -862,11 -789,7 +861,10 @@@ KBUILD_CFLAGS += $(stackp-flags-y KBUILD_CFLAGS-$(CONFIG_WERROR) += -Werror KBUILD_CFLAGS-$(CONFIG_CC_NO_ARRAY_BOUNDS) += -Wno-array-bounds - KBUILD_CFLAGS += $(KBUILD_CFLAGS-y) $(CONFIG_CC_IMPLICIT_FALLTHROUGH) +KBUILD_RUSTFLAGS-$(CONFIG_WERROR) += -Dwarnings +KBUILD_RUSTFLAGS += $(KBUILD_RUSTFLAGS-y) + ifdef CONFIG_CC_IS_CLANG KBUILD_CPPFLAGS += -Qunused-arguments # The kernel builds with '-std=gnu11' so use of GNU extensions is acceptable. @@@ -1574,7 -1493,7 +1567,8 @@@ endif # CONFIG_MODULE # Directories & files removed with 'make clean' CLEAN_FILES += include/ksym vmlinux.symvers modules-only.symvers \ modules.builtin modules.builtin.modinfo modules.nsdeps \ - compile_commands.json .thinlto-cache rust/test rust/doc - compile_commands.json .thinlto-cache .vmlinux.objs .vmlinux.export.c ++ compile_commands.json .thinlto-cache rust/test rust/doc \ ++ .vmlinux.objs .vmlinux.export.c # Directories & files removed with 'make mrproper' MRPROPER_FILES += include/config include/generated \