From: Linus Torvalds Date: Thu, 22 Oct 2020 20:13:57 +0000 (-0700) Subject: Merge tag 'kbuild-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy... X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=746b25b1aa0f5736d585728ded70a8141da91edb;p=linux.git Merge tag 'kbuild-v5.10' of git://git./linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild updates from Masahiro Yamada: - Support 'make compile_commands.json' to generate the compilation database more easily, avoiding stale entries - Support 'make clang-analyzer' and 'make clang-tidy' for static checks using clang-tidy - Preprocess scripts/modules.lds.S to allow CONFIG options in the module linker script - Drop cc-option tests from compiler flags supported by our minimal GCC/Clang versions - Use always 12-digits commit hash for CONFIG_LOCALVERSION_AUTO=y - Use sha1 build id for both BFD linker and LLD - Improve deb-pkg for reproducible builds and rootless builds - Remove stale, useless scripts/namespace.pl - Turn -Wreturn-type warning into error - Fix build error of deb-pkg when CONFIG_MODULES=n - Replace 'hostname' command with more portable 'uname -n' - Various Makefile cleanups * tag 'kbuild-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (34 commits) kbuild: Use uname for LINUX_COMPILE_HOST detection kbuild: Only add -fno-var-tracking-assignments for old GCC versions kbuild: remove leftover comment for filechk utility treewide: remove DISABLE_LTO kbuild: deb-pkg: clean up package name variables kbuild: deb-pkg: do not build linux-headers package if CONFIG_MODULES=n kbuild: enforce -Werror=return-type scripts: remove namespace.pl builddeb: Add support for all required debian/rules targets builddeb: Enable rootless builds builddeb: Pass -n to gzip for reproducible packages kbuild: split the build log of kallsyms kbuild: explicitly specify the build id style scripts/setlocalversion: make git describe output more reliable kbuild: remove cc-option test of -Werror=date-time kbuild: remove cc-option test of -fno-stack-check kbuild: remove cc-option test of -fno-strict-overflow kbuild: move CFLAGS_{KASAN,UBSAN,KCSAN} exports to relevant Makefiles kbuild: remove redundant CONFIG_KASAN check from scripts/Makefile.kasan kbuild: do not create built-in objects for external module builds ... --- 746b25b1aa0f5736d585728ded70a8141da91edb diff --cc Makefile index ebbd34801476a,17a62e365a380..e71979882e4fc --- a/Makefile +++ b/Makefile @@@ -919,10 -932,19 +928,10 @@@ KBUILD_CFLAGS += $(call cc-disable-warn KBUILD_CFLAGS += $(call cc-disable-warning, maybe-uninitialized) # disable invalid "can't wrap" optimizations for signed / pointers - KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow) + KBUILD_CFLAGS += -fno-strict-overflow -# clang sets -fmerge-all-constants by default as optimization, but this -# is non-conforming behavior for C and in fact breaks the kernel, so we -# need to disable it here generally. -KBUILD_CFLAGS += $(call cc-option,-fno-merge-all-constants) - -# for gcc -fno-merge-all-constants disables everything, but it is fine -# to have actual conforming behavior enabled. -KBUILD_CFLAGS += $(call cc-option,-fmerge-constants) - # Make sure -fstack-check isn't enabled (like gentoo apparently did) - KBUILD_CFLAGS += $(call cc-option,-fno-stack-check,) + KBUILD_CFLAGS += -fno-stack-check # conserve stack if available KBUILD_CFLAGS += $(call cc-option,-fconserve-stack) diff --cc arch/arm/Makefile index c4301437ca72e,a0cb15de96778..2874cd9923b7a --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@@ -16,14 -16,6 +16,10 @@@ LDFLAGS_vmlinux += --be KBUILD_LDFLAGS_MODULE += --be8 endif +# We never want expected sections to be placed heuristically by the +# linker. All sections should be explicitly named in the linker script. +LDFLAGS_vmlinux += $(call ld-option, --orphan-handling=warn) + - ifeq ($(CONFIG_ARM_MODULE_PLTS),y) - KBUILD_LDS_MODULE += $(srctree)/arch/arm/kernel/module.lds - endif - GZFLAGS :=-9 #KBUILD_CFLAGS +=-pipe diff --cc scripts/Makefile.kcsan index c37f9518d5d95,cec50d74e0d0a..37cb504c77e13 --- a/scripts/Makefile.kcsan +++ b/scripts/Makefile.kcsan @@@ -9,7 -9,7 +9,7 @@@ endi # Keep most options here optional, to allow enabling more compilers if absence # of some options does not break KCSAN nor causes false positive reports. - CFLAGS_KCSAN := -fsanitize=thread \ + export CFLAGS_KCSAN := -fsanitize=thread \ $(call cc-option,$(call cc-param,tsan-instrument-func-entry-exit=0) -fno-optimize-sibling-calls) \ - $(call cc-option,$(call cc-param,tsan-instrument-read-before-write=1)) \ + $(call cc-option,$(call cc-param,tsan-compound-read-before-write=1),$(call cc-option,$(call cc-param,tsan-instrument-read-before-write=1))) \ $(call cc-param,tsan-distinguish-volatile=1)