Skip to content

Commit

Permalink
Merge tag 'kbuild-v5.1-2' of git://git.kernel.org/pub/scm/linux/kerne…
Browse files Browse the repository at this point in the history
…l/git/masahiroy/linux-kbuild

Pull more Kbuild updates from Masahiro Yamada:

 - add more Build-Depends to Debian source package

 - prefix header search paths with $(srctree)/

 - make modpost show verbose section mismatch warnings

 - avoid hard-coded CROSS_COMPILE for h8300

 - fix regression for Debian make-kpkg command

 - add semantic patch to detect missing put_device()

 - fix some warnings of 'make deb-pkg'

 - optimize NOSTDINC_FLAGS evaluation

 - add warnings about redundant generic-y

 - clean up Makefiles and scripts

* tag 'kbuild-v5.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
  kconfig: remove stale lxdialog/.gitignore
  kbuild: force all architectures except um to include mandatory-y
  kbuild: warn redundant generic-y
  Revert "modsign: Abort modules_install when signing fails"
  kbuild: Make NOSTDINC_FLAGS a simply expanded variable
  kbuild: deb-pkg: avoid implicit effects
  coccinelle: semantic code search for missing put_device()
  kbuild: pkg: grep include/config/auto.conf instead of $KCONFIG_CONFIG
  kbuild: deb-pkg: introduce is_enabled and if_enabled_echo to builddeb
  kbuild: deb-pkg: add CONFIG_ prefix to kernel config options
  kbuild: add workaround for Debian make-kpkg
  kbuild: source include/config/auto.conf instead of ${KCONFIG_CONFIG}
  unicore32: simplify linker script generation for decompressor
  h8300: use cc-cross-prefix instead of hardcoding h8300-unknown-linux-
  kbuild: move archive command to scripts/Makefile.lib
  modpost: always show verbose warning for section mismatch
  ia64: prefix header search path with $(srctree)/
  libfdt: prefix header search paths with $(srctree)/
  deb-pkg: generate correct build dependencies
  • Loading branch information
torvalds committed Mar 17, 2019
2 parents 80b98e9 + c71bb9f commit 28d747f
Show file tree
Hide file tree
Showing 57 changed files with 153 additions and 156 deletions.
2 changes: 1 addition & 1 deletion Documentation/kbuild/makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1274,7 +1274,7 @@ See subsequent chapter for the syntax of the Kbuild file.

--- 7.4 mandatory-y

mandatory-y is essentially used by include/(uapi/)asm-generic/Kbuild.asm
mandatory-y is essentially used by include/(uapi/)asm-generic/Kbuild
to define the minimum set of ASM headers that all architectures must have.

This works like optional generic-y. If a mandatory header is missing
Expand Down
18 changes: 15 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ _all:
# descending is started. They are now explicitly listed as the
# prepare rule.

# Ugly workaround for Debian make-kpkg:
# make-kpkg directly includes the top Makefile of Linux kernel. In such a case,
# skip sub-make to support debian_* targets in ruleset/kernel_version.mk, but
# displays warning to discourage such abusage.
ifneq ($(word 2, $(MAKEFILE_LIST)),)
$(warning Do not include top Makefile of Linux Kernel)
sub-make-done := 1
MAKEFLAGS += -rR
endif

ifneq ($(sub-make-done),1)

# Do not use make's built-in rules and variables
Expand Down Expand Up @@ -402,7 +412,7 @@ CHECK = sparse

CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
-Wbitwise -Wno-return-void -Wno-unknown-attribute $(CF)
NOSTDINC_FLAGS =
NOSTDINC_FLAGS :=
CFLAGS_MODULE =
AFLAGS_MODULE =
LDFLAGS_MODULE =
Expand Down Expand Up @@ -1088,9 +1098,11 @@ asm-generic := -f $(srctree)/scripts/Makefile.asm-generic obj

PHONY += asm-generic uapi-asm-generic
asm-generic: uapi-asm-generic
$(Q)$(MAKE) $(asm-generic)=arch/$(SRCARCH)/include/generated/asm
$(Q)$(MAKE) $(asm-generic)=arch/$(SRCARCH)/include/generated/asm \
generic=include/asm-generic
uapi-asm-generic:
$(Q)$(MAKE) $(asm-generic)=arch/$(SRCARCH)/include/generated/uapi/asm
$(Q)$(MAKE) $(asm-generic)=arch/$(SRCARCH)/include/generated/uapi/asm \
generic=include/uapi/asm-generic

PHONY += prepare-objtool
prepare-objtool: $(objtool_target)
Expand Down
2 changes: 0 additions & 2 deletions arch/alpha/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
include include/uapi/asm-generic/Kbuild.asm

generated-y += unistd_32.h
2 changes: 0 additions & 2 deletions arch/arc/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
include include/uapi/asm-generic/Kbuild.asm

generic-y += kvm_para.h
generic-y += ucontext.h
1 change: 0 additions & 1 deletion arch/arm/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ generic-y += segment.h
generic-y += serial.h
generic-y += simd.h
generic-y += sizes.h
generic-y += timex.h
generic-y += trace_clock.h

generated-y += mach-types.h
Expand Down
1 change: 0 additions & 1 deletion arch/arm/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# SPDX-License-Identifier: GPL-2.0
include include/uapi/asm-generic/Kbuild.asm

generated-y += unistd-common.h
generated-y += unistd-oabi.h
Expand Down
1 change: 0 additions & 1 deletion arch/arm64/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# SPDX-License-Identifier: GPL-2.0
include include/uapi/asm-generic/Kbuild.asm

generic-y += kvm_para.h
2 changes: 0 additions & 2 deletions arch/c6x/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
include include/uapi/asm-generic/Kbuild.asm

generic-y += kvm_para.h
generic-y += ucontext.h
2 changes: 0 additions & 2 deletions arch/csky/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
include include/uapi/asm-generic/Kbuild.asm

generic-y += ucontext.h
2 changes: 1 addition & 1 deletion arch/h8300/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ KBUILD_LDFLAGS += $(ldflags-y)
CHECKFLAGS += -msize-long

ifeq ($(CROSS_COMPILE),)
CROSS_COMPILE := h8300-unknown-linux-
CROSS_COMPILE := $(call cc-cross-prefix, h8300-unknown-linux- h8300-linux-)
endif

core-y += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/
Expand Down
1 change: 0 additions & 1 deletion arch/h8300/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ generic-y += fb.h
generic-y += ftrace.h
generic-y += futex.h
generic-y += hardirq.h
generic-y += hash.h
generic-y += hw_irq.h
generic-y += irq_regs.h
generic-y += irq_work.h
Expand Down
2 changes: 0 additions & 2 deletions arch/h8300/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
include include/uapi/asm-generic/Kbuild.asm

generic-y += kvm_para.h
generic-y += ucontext.h
2 changes: 0 additions & 2 deletions arch/hexagon/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
include include/uapi/asm-generic/Kbuild.asm

generic-y += ucontext.h
3 changes: 0 additions & 3 deletions arch/ia64/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
include include/uapi/asm-generic/Kbuild.asm

generated-y += unistd_64.h
generic-y += kvm_para.h
generic-y += socket.h
2 changes: 1 addition & 1 deletion arch/ia64/sn/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Copyright (C) 1999,2001-2006,2008 Silicon Graphics, Inc. All Rights Reserved.
#

ccflags-y := -Iarch/ia64/sn/include
ccflags-y := -I $(srctree)/arch/ia64/sn/include

obj-y += setup.o bte.o bte_error.o irq.o mca.o idle.o \
huberror.o io_acpi_init.o io_common.o \
Expand Down
2 changes: 0 additions & 2 deletions arch/ia64/sn/kernel/sn2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,5 @@
# sn2 specific kernel files
#

ccflags-y := -Iarch/ia64/sn/include

obj-y += cache.o io.o ptc_deadlock.o sn2_smp.o sn_proc_fs.o \
prominfo_proc.o timer.o timer_interrupt.o sn_hwperf.o
2 changes: 0 additions & 2 deletions arch/ia64/sn/pci/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,4 @@
#
# Makefile for the sn pci general routines.

ccflags-y := -Iarch/ia64/sn/include

obj-y := pci_dma.o tioca_provider.o tioce_provider.o pcibr/
2 changes: 1 addition & 1 deletion arch/ia64/sn/pci/pcibr/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# Makefile for the sn2 io routines.

ccflags-y := -Iarch/ia64/sn/include
ccflags-y := -I $(srctree)/arch/ia64/sn/include

obj-y += pcibr_dma.o pcibr_reg.o \
pcibr_ate.o pcibr_provider.o
2 changes: 0 additions & 2 deletions arch/m68k/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
include include/uapi/asm-generic/Kbuild.asm

generated-y += unistd_32.h
generic-y += kvm_para.h
2 changes: 0 additions & 2 deletions arch/microblaze/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include include/uapi/asm-generic/Kbuild.asm

generated-y += unistd_32.h
generic-y += kvm_para.h
generic-y += ucontext.h
2 changes: 0 additions & 2 deletions arch/mips/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include include/uapi/asm-generic/Kbuild.asm

generated-y += unistd_n32.h
generated-y += unistd_n64.h
generated-y += unistd_o32.h
Expand Down
2 changes: 0 additions & 2 deletions arch/nds32/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
include include/uapi/asm-generic/Kbuild.asm

generic-y += ucontext.h
2 changes: 0 additions & 2 deletions arch/nios2/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
include include/uapi/asm-generic/Kbuild.asm

generic-y += kvm_para.h
generic-y += ucontext.h
2 changes: 0 additions & 2 deletions arch/openrisc/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ generic-y += fb.h
generic-y += ftrace.h
generic-y += hardirq.h
generic-y += hw_irq.h
generic-y += irq.h
generic-y += irq_regs.h
generic-y += irq_work.h
generic-y += kdebug.h
Expand All @@ -35,7 +34,6 @@ generic-y += qrwlock.h
generic-y += sections.h
generic-y += segment.h
generic-y += shmparam.h
generic-y += string.h
generic-y += switch_to.h
generic-y += topology.h
generic-y += trace_clock.h
Expand Down
2 changes: 0 additions & 2 deletions arch/openrisc/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
include include/uapi/asm-generic/Kbuild.asm

generic-y += kvm_para.h
generic-y += ucontext.h
2 changes: 0 additions & 2 deletions arch/parisc/include/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
generated-y += syscall_table_32.h
generated-y += syscall_table_64.h
generated-y += syscall_table_c32.h
generic-y += barrier.h
generic-y += current.h
generic-y += device.h
generic-y += div64.h
Expand All @@ -20,7 +19,6 @@ generic-y += percpu.h
generic-y += preempt.h
generic-y += seccomp.h
generic-y += segment.h
generic-y += topology.h
generic-y += trace_clock.h
generic-y += user.h
generic-y += vga.h
Expand Down
2 changes: 0 additions & 2 deletions arch/parisc/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include include/uapi/asm-generic/Kbuild.asm

generated-y += unistd_32.h
generated-y += unistd_64.h
generic-y += kvm_para.h
1 change: 0 additions & 1 deletion arch/powerpc/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ generated-y += syscall_table_spu.h
generic-y += div64.h
generic-y += export.h
generic-y += irq_regs.h
generic-y += irq_work.h
generic-y += local64.h
generic-y += mcs_spinlock.h
generic-y += preempt.h
Expand Down
2 changes: 0 additions & 2 deletions arch/powerpc/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
include include/uapi/asm-generic/Kbuild.asm

generated-y += unistd_32.h
generated-y += unistd_64.h
1 change: 0 additions & 1 deletion arch/riscv/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
include include/uapi/asm-generic/Kbuild.asm
3 changes: 0 additions & 3 deletions arch/s390/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ $(obj)/section_cmp%: vmlinux $(obj)/compressed/vmlinux FORCE
$(obj)/compressed/vmlinux: $(obj)/startup.a FORCE
$(Q)$(MAKE) $(build)=$(obj)/compressed $@

quiet_cmd_ar = AR $@
cmd_ar = rm -f $@; $(AR) rcsTP$(KBUILD_ARFLAGS) $@ $(real-prereqs)

$(obj)/startup.a: $(OBJECTS) FORCE
$(call if_changed,ar)

Expand Down
1 change: 0 additions & 1 deletion arch/s390/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ generic-y += local.h
generic-y += local64.h
generic-y += mcs_spinlock.h
generic-y += mm-arch-hooks.h
generic-y += preempt.h
generic-y += rwsem.h
generic-y += trace_clock.h
generic-y += unaligned.h
Expand Down
2 changes: 0 additions & 2 deletions arch/s390/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# SPDX-License-Identifier: GPL-2.0
include include/uapi/asm-generic/Kbuild.asm

generated-y += unistd_32.h
generated-y += unistd_64.h
generic-y += socket.h
1 change: 0 additions & 1 deletion arch/sh/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# SPDX-License-Identifier: GPL-2.0
include include/uapi/asm-generic/Kbuild.asm

generated-y += unistd_32.h
generic-y += kvm_para.h
Expand Down
2 changes: 0 additions & 2 deletions arch/sparc/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
include include/uapi/asm-generic/Kbuild.asm

generated-y += unistd_32.h
generated-y += unistd_64.h
5 changes: 1 addition & 4 deletions arch/unicore32/boot/compressed/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,4 @@ $(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/head.o $(obj)/piggy.o \
ZTEXTADDR := 0x03000000
ZBSSADDR := ALIGN(4)

SEDFLAGS_lds = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/
$(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in arch/unicore32/boot/Makefile $(KCONFIG_CONFIG)
@sed "$(SEDFLAGS_lds)" < $< > $@

CPPFLAGS_vmlinux.lds = -DTEXT_START="$(ZTEXTADDR)" -DBSS_START="$(ZBSSADDR)"
2 changes: 0 additions & 2 deletions arch/unicore32/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
include include/uapi/asm-generic/Kbuild.asm

generic-y += kvm_para.h
generic-y += ucontext.h
3 changes: 0 additions & 3 deletions arch/x86/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
include include/uapi/asm-generic/Kbuild.asm

generated-y += unistd_32.h
generated-y += unistd_64.h
generated-y += unistd_x32.h
generic-y += socket.h
1 change: 0 additions & 1 deletion arch/xtensa/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ generic-y += irq_work.h
generic-y += kdebug.h
generic-y += kmap_types.h
generic-y += kprobes.h
generic-y += linkage.h
generic-y += local.h
generic-y += local64.h
generic-y += mcs_spinlock.h
Expand Down
3 changes: 0 additions & 3 deletions arch/xtensa/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
include include/uapi/asm-generic/Kbuild.asm

generated-y += unistd_32.h
generic-y += kvm_para.h
generic-y += socket.h
5 changes: 5 additions & 0 deletions include/asm-generic/Kbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SPDX-License-Identifier: GPL-2.0
#
# asm headers that all architectures except um should have
# (This file is not included when SRCARCH=um since UML borrows several
# asm headers from the host architecutre.)
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# SPDX-License-Identifier: GPL-2.0
#
# Headers that are mandatory in usr/include/asm/
#
# (This file is not included when SRCARCH=um since UML does not support UAPI.)

mandatory-y += auxvec.h
mandatory-y += bitsperlong.h
mandatory-y += bpf_perf_event.h
Expand Down
2 changes: 1 addition & 1 deletion lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ KCOV_INSTRUMENT_stackdepot.o := n
libfdt_files = fdt.o fdt_ro.o fdt_wip.o fdt_rw.o fdt_sw.o fdt_strerror.o \
fdt_empty_tree.o
$(foreach file, $(libfdt_files), \
$(eval CFLAGS_$(file) = -I$(src)/../scripts/dtc/libfdt))
$(eval CFLAGS_$(file) = -I $(srctree)/scripts/dtc/libfdt))
lib-$(CONFIG_LIBFDT) += $(libfdt_files)

obj-$(CONFIG_RBTREE_TEST) += rbtree_test.o
Expand Down
11 changes: 11 additions & 0 deletions scripts/Makefile.asm-generic
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,19 @@ all:
src := $(subst /generated,,$(obj))
-include $(src)/Kbuild

# $(generic)/Kbuild lists mandatory-y. Exclude um since it is a special case.
ifneq ($(SRCARCH),um)
include $(generic)/Kbuild
endif

include scripts/Kbuild.include

redundant := $(filter $(mandatory-y) $(generated-y), $(generic-y))
redundant += $(foreach f, $(generic-y), $(if $(wildcard $(srctree)/$(src)/$(f)),$(f)))
redundant := $(sort $(redundant))
$(if $(redundant),\
$(warning redundant generic-y found in $(src)/Kbuild: $(redundant)))

# If arch does not implement mandatory headers, fallback to asm-generic ones.
mandatory-y := $(filter-out $(generated-y), $(mandatory-y))
generic-y += $(foreach f, $(mandatory-y), $(if $(wildcard $(srctree)/$(src)/$(f)),,$(f)))
Expand Down
6 changes: 1 addition & 5 deletions scripts/Makefile.build
Original file line number Diff line number Diff line change
Expand Up @@ -426,13 +426,9 @@ $(modorder-target): $(subdir-ym) FORCE
# Rule to compile a set of .o files into one .a file (with symbol table)
#
ifdef lib-target
quiet_cmd_link_l_target = AR $@

# lib target archives do get a symbol table and index
cmd_link_l_target = rm -f $@; $(AR) rcsTP$(KBUILD_ARFLAGS) $@ $(real-prereqs)

$(lib-target): $(lib-y) FORCE
$(call if_changed,link_l_target)
$(call if_changed,ar)

targets += $(lib-target)

Expand Down
6 changes: 6 additions & 0 deletions scripts/Makefile.lib
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,12 @@ $(obj)/%: $(src)/%_shipped
quiet_cmd_ld = LD $@
cmd_ld = $(LD) $(ld_flags) $(real-prereqs) -o $@

# Archive
# ---------------------------------------------------------------------------

quiet_cmd_ar = AR $@
cmd_ar = rm -f $@; $(AR) rcsTP$(KBUILD_ARFLAGS) $@ $(real-prereqs)

# Objcopy
# ---------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion scripts/Makefile.modinst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ quiet_cmd_modules_install = INSTALL $@
mkdir -p $(2) ; \
cp $@ $(2) ; \
$(mod_strip_cmd) $(2)/$(notdir $@) ; \
$(mod_sign_cmd) $(2)/$(notdir $@) $(patsubst %,|| true,$(KBUILD_EXTMOD)) && \
$(mod_sign_cmd) $(2)/$(notdir $@) $(patsubst %,|| true,$(KBUILD_EXTMOD)) ; \
$(mod_compress_cmd) $(2)/$(notdir $@)

# Modules built outside the kernel source tree go into extra by default
Expand Down
1 change: 0 additions & 1 deletion scripts/Makefile.modpost
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ modpost = scripts/mod/modpost \
$(if $(KBUILD_EXTMOD),-I $(modulesymfile)) \
$(if $(KBUILD_EXTRA_SYMBOLS), $(patsubst %, -e %,$(KBUILD_EXTRA_SYMBOLS))) \
$(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \
$(if $(CONFIG_DEBUG_SECTION_MISMATCH),,-S) \
$(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E) \
$(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w)

Expand Down
Loading

0 comments on commit 28d747f

Please sign in to comment.