Skip to content

Commit 8715ee7

Browse files
committed
Merge tag 'kbuild-v4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull Kbuild updates from Masahiro Yamada: - improve fixdep to coalesce consecutive slashes in dep-files - fix some issues of the maintainer string generation in deb-pkg script - remove unused CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX and clean-up several tools and linker scripts - clean-up modpost - allow to enable the dead code/data elimination for PowerPC in EXPERT mode - improve two coccinelle scripts for better performance - pass endianness and machine size flags to sparse for all architecture - misc fixes * tag 'kbuild-v4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (25 commits) kbuild: add machine size to CHECKFLAGS kbuild: add endianness flag to CHEKCFLAGS kbuild: $(CHECK) doesnt need NOSTDINC_FLAGS twice scripts: Fixed printf format mismatch scripts/tags.sh: use `find` for $ALLSOURCE_ARCHS generation coccinelle: deref_null: improve performance coccinelle: mini_lock: improve performance powerpc: Allow LD_DEAD_CODE_DATA_ELIMINATION to be selected kbuild: Allow LD_DEAD_CODE_DATA_ELIMINATION to be selectable if enabled kbuild: LD_DEAD_CODE_DATA_ELIMINATION no -ffunction-sections/-fdata-sections for module build kbuild: Fix asm-generic/vmlinux.lds.h for LD_DEAD_CODE_DATA_ELIMINATION modpost: constify *modname function argument where possible modpost: remove redundant is_vmlinux() test modpost: use strstarts() helper more widely modpost: pass struct elf_info pointer to get_modinfo() checkpatch: remove VMLINUX_SYMBOL() check vmlinux.lds.h: remove no-op macro VMLINUX_SYMBOL() kbuild: remove CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX export.h: remove code for prefixing symbols with underscore depmod.sh: remove symbol prefix support ...
2 parents 126f705 + 1f2f01b commit 8715ee7

33 files changed

Lines changed: 349 additions & 443 deletions

‎Makefile‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -802,13 +802,12 @@ KBUILD_CFLAGS += $(call cc-option, -fno-inline-functions-called-once)
802802
endif
803803

804804
ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
805-
KBUILD_CFLAGS += $(call cc-option,-ffunction-sections,)
806-
KBUILD_CFLAGS += $(call cc-option,-fdata-sections,)
805+
KBUILD_CFLAGS_KERNEL += $(call cc-option,-ffunction-sections,)
806+
KBUILD_CFLAGS_KERNEL += $(call cc-option,-fdata-sections,)
807807
endif
808808

809809
# arch Makefile may override CC so keep this after arch Makefile is included
810810
NOSTDINC_FLAGS += -nostdinc -isystem $(call shell-cached,$(CC) -print-file-name=include)
811-
CHECKFLAGS += $(NOSTDINC_FLAGS)
812811

813812
# warn about C99 declaration after statement
814813
KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)
@@ -878,6 +877,12 @@ ifeq ($(CONFIG_STRIP_ASM_SYMS),y)
878877
LDFLAGS_vmlinux += $(call ld-option, -X,)
879878
endif
880879

880+
# insure the checker run with the right endianness
881+
CHECKFLAGS += $(if $(CONFIG_CPU_BIG_ENDIAN),-mbig-endian,-mlittle-endian)
882+
883+
# the checker needs the correct machine size
884+
CHECKFLAGS += $(if $(CONFIG_64BIT),-m64,-m32)
885+
881886
# Default kernel image to build when no specific target is given.
882887
# KBUILD_IMAGE may be overruled on the command line or
883888
# set in the environment
@@ -1763,7 +1768,7 @@ quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files))
17631768
# Run depmod only if we have System.map and depmod is executable
17641769
quiet_cmd_depmod = DEPMOD $(KERNELRELEASE)
17651770
cmd_depmod = $(CONFIG_SHELL) $(srctree)/scripts/depmod.sh $(DEPMOD) \
1766-
$(KERNELRELEASE) "$(patsubst y,_,$(CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX))"
1771+
$(KERNELRELEASE)
17671772

17681773
# Create temporary dir for module support files
17691774
# clean it up only when building all modules

‎arch/Kconfig‎

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -597,21 +597,6 @@ config CC_STACKPROTECTOR_AUTO
597597

598598
endchoice
599599

600-
config LD_DEAD_CODE_DATA_ELIMINATION
601-
bool
602-
help
603-
Select this if the architecture wants to do dead code and
604-
data elimination with the linker by compiling with
605-
-ffunction-sections -fdata-sections and linking with
606-
--gc-sections.
607-
608-
This requires that the arch annotates or otherwise protects
609-
its external entry points from being discarded. Linker scripts
610-
must also merge .text.*, .data.*, and .bss.* correctly into
611-
output sections. Care must be taken not to pull in unrelated
612-
sections (e.g., '.text.init'). Typically '.' in section names
613-
is used to distinguish them from label names / C identifiers.
614-
615600
config HAVE_ARCH_WITHIN_STACK_FRAMES
616601
bool
617602
help
@@ -687,12 +672,6 @@ config MODULES_USE_ELF_REL
687672
Modules only use ELF REL relocations. Modules with ELF RELA
688673
relocations will give an error.
689674

690-
config HAVE_UNDERSCORE_SYMBOL_PREFIX
691-
bool
692-
help
693-
Some architectures generate an _ in front of C symbols; things like
694-
module loading and assembly files need to know about this.
695-
696675
config HAVE_IRQ_EXIT_ON_IRQ_STACK
697676
bool
698677
help

‎arch/alpha/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
NM := $(NM) -B
1212

1313
LDFLAGS_vmlinux := -static -N #-relax
14-
CHECKFLAGS += -D__alpha__ -m64
14+
CHECKFLAGS += -D__alpha__
1515
cflags-y := -pipe -mno-fp-regs -ffixed-8
1616
cflags-y += $(call cc-option, -fno-jump-tables)
1717

‎arch/arm/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ endif
135135
KBUILD_CFLAGS +=$(CFLAGS_ABI) $(CFLAGS_ISA) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm
136136
KBUILD_AFLAGS +=$(CFLAGS_ABI) $(AFLAGS_ISA) $(arch-y) $(tune-y) -include asm/unified.h -msoft-float
137137

138-
CHECKFLAGS += -D__arm__ -m32
138+
CHECKFLAGS += -D__arm__
139139

140140
#Default value
141141
head-y := arch/arm/kernel/head$(MMUEXT).o

‎arch/arm64/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ LDFLAGS += -maarch64linux
7878
UTS_MACHINE := aarch64
7979
endif
8080

81-
CHECKFLAGS += -D__aarch64__ -m64
81+
CHECKFLAGS += -D__aarch64__
8282

8383
ifeq ($(CONFIG_ARM64_MODULE_PLTS),y)
8484
KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/arm64/kernel/module.lds

‎arch/ia64/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ READELF := $(CROSS_COMPILE)readelf
1818

1919
export AWK
2020

21-
CHECKFLAGS += -m64 -D__ia64=1 -D__ia64__=1 -D_LP64 -D__LP64__
21+
CHECKFLAGS += -D__ia64=1 -D__ia64__=1 -D_LP64 -D__LP64__
2222

2323
OBJCOPYFLAGS := --strip-all
2424
LDFLAGS_vmlinux := -static

‎arch/mips/Makefile‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,6 @@ ifdef CONFIG_MIPS
309309
CHECKFLAGS += $(shell $(CC) $(KBUILD_CFLAGS) -dM -E -x c /dev/null | \
310310
egrep -vw '__GNUC_(|MINOR_|PATCHLEVEL_)_' | \
311311
sed -e "s/^\#define /-D'/" -e "s/ /'='/" -e "s/$$/'/" -e 's/\$$/&&/g')
312-
ifdef CONFIG_64BIT
313-
CHECKFLAGS += -m64
314-
endif
315312
endif
316313

317314
OBJCOPYFLAGS += --remove-section=.reginfo

‎arch/openrisc/Makefile‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ LDFLAGS_vmlinux :=
2525
LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
2626

2727
KBUILD_CFLAGS += -pipe -ffixed-r10 -D__linux__
28-
CHECKFLAGS += -mbig-endian
2928

3029
ifeq ($(CONFIG_OPENRISC_HAVE_INST_MUL),y)
3130
KBUILD_CFLAGS += $(call cc-option,-mhard-mul)

‎arch/parisc/Makefile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ KBUILD_IMAGE := vmlinuz
2222
KBUILD_DEFCONFIG := default_defconfig
2323

2424
NM = sh $(srctree)/arch/parisc/nm
25-
CHECKFLAGS += -D__hppa__=1 -mbig-endian
25+
CHECKFLAGS += -D__hppa__=1
2626
LIBGCC = $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
2727
export LIBGCC
2828

2929
ifdef CONFIG_64BIT
3030
UTS_MACHINE := parisc64
31-
CHECKFLAGS += -D__LP64__=1 -m64
31+
CHECKFLAGS += -D__LP64__=1
3232
CC_ARCHES = hppa64
3333
LD_BFD := elf64-hppa-linux
3434
else # 32-bit

‎arch/powerpc/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ config PPC
198198
select HAVE_KPROBES
199199
select HAVE_KPROBES_ON_FTRACE
200200
select HAVE_KRETPROBES
201+
select HAVE_LD_DEAD_CODE_DATA_ELIMINATION
201202
select HAVE_LIVEPATCH if HAVE_DYNAMIC_FTRACE_WITH_REGS
202203
select HAVE_MEMBLOCK
203204
select HAVE_MEMBLOCK_NODE_MAP

0 commit comments

Comments
 (0)