Commit e6585a49 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'kbuild-fixes-v5.10-2' of...

Merge tag 'kbuild-fixes-v5.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild

Pull Kbuild fixes from Masahiro Yamada:

 - Move -Wcast-align to W=3, which tends to be false-positive and there
   is no tree-wide solution.

 - Pass -fmacro-prefix-map to KBUILD_CPPFLAGS because it is a
   preprocessor option and makes sense for .S files as well.

 - Disable -gdwarf-2 for Clang's integrated assembler to avoid warnings.

 - Disable --orphan-handling=warn for LLD 10.0.1 to avoid warnings.

 - Fix undesirable line breaks in *.mod files.

* tag 'kbuild-fixes-v5.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
  kbuild: avoid split lines in .mod files
  kbuild: Disable CONFIG_LD_ORPHAN_WARN for ld.lld 10.0.1
  kbuild: Hoist '--orphan-handling' into Kconfig
  Kbuild: do not emit debug info for assembly with LLVM_IAS=1
  kbuild: use -fmacro-prefix-map for .S sources
  Makefile.extrawarn: move -Wcast-align to W=3
parents 12c0ab66 7d32358b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -4287,6 +4287,7 @@ B: https://github.com/ClangBuiltLinux/linux/issues
C:	irc://chat.freenode.net/clangbuiltlinux
F:	Documentation/kbuild/llvm.rst
F:	scripts/clang-tools/
F:	scripts/lld-version.sh
K:	\b(?i:clang|llvm)\b
CLEANCACHE API
+9 −1
Original line number Diff line number Diff line
@@ -826,7 +826,9 @@ else
DEBUG_CFLAGS	+= -g
endif

ifneq ($(LLVM_IAS),1)
KBUILD_AFLAGS	+= -Wa,-gdwarf-2
endif

ifdef CONFIG_DEBUG_INFO_DWARF4
DEBUG_CFLAGS	+= -gdwarf-4
@@ -944,7 +946,7 @@ KBUILD_CFLAGS += $(call cc-option,-Werror=incompatible-pointer-types)
KBUILD_CFLAGS   += $(call cc-option,-Werror=designated-init)

# change __FILE__ to the relative path from the srctree
KBUILD_CFLAGS	+= $(call cc-option,-fmacro-prefix-map=$(srctree)/=)
KBUILD_CPPFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=)

# ensure -fcf-protection is disabled when using retpoline as it is
# incompatible with -mindirect-branch=thunk-extern
@@ -982,6 +984,12 @@ ifeq ($(CONFIG_RELR),y)
LDFLAGS_vmlinux	+= --pack-dyn-relocs=relr
endif

# We never want expected sections to be placed heuristically by the
# linker. All sections should be explicitly named in the linker script.
ifdef CONFIG_LD_ORPHAN_WARN
LDFLAGS_vmlinux += --orphan-handling=warn
endif

# Align the bit size of userspace programs with the kernel
KBUILD_USERCFLAGS  += $(filter -m32 -m64 --target=%, $(KBUILD_CFLAGS))
KBUILD_USERLDFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CFLAGS))
+9 −0
Original line number Diff line number Diff line
@@ -1028,6 +1028,15 @@ config HAVE_STATIC_CALL_INLINE
	bool
	depends on HAVE_STATIC_CALL

config ARCH_WANT_LD_ORPHAN_WARN
	bool
	help
	  An arch should select this symbol once all linker sections are explicitly
	  included, size-asserted, or discarded in the linker scripts. This is
	  important because we never want expected sections to be placed heuristically
	  by the linker, since the locations of such sections can change between linker
	  versions.

source "kernel/gcov/Kconfig"

source "scripts/gcc-plugins/Kconfig"
+1 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ config ARM
	select ARCH_USE_CMPXCHG_LOCKREF
	select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
	select ARCH_WANT_IPC_PARSE_VERSION
	select ARCH_WANT_LD_ORPHAN_WARN
	select BINFMT_FLAT_ARGVP_ENVP_ON_STACK
	select BUILDTIME_TABLE_SORT if MMU
	select CLONE_BACKWARDS
+0 −4
Original line number Diff line number Diff line
@@ -16,10 +16,6 @@ LDFLAGS_vmlinux += --be8
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)

GZFLAGS		:=-9
#KBUILD_CFLAGS	+=-pipe

Loading