Merge tag 'kbuild-v5.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 17 Mar 2019 20:25:26 +0000 (13:25 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 17 Mar 2019 20:25:26 +0000 (13:25 -0700)
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

59 files changed:
Documentation/kbuild/makefiles.txt
Makefile
arch/alpha/include/uapi/asm/Kbuild
arch/arc/include/uapi/asm/Kbuild
arch/arm/include/asm/Kbuild
arch/arm/include/uapi/asm/Kbuild
arch/arm64/include/uapi/asm/Kbuild
arch/c6x/include/uapi/asm/Kbuild
arch/csky/include/uapi/asm/Kbuild
arch/h8300/Makefile
arch/h8300/include/asm/Kbuild
arch/h8300/include/uapi/asm/Kbuild
arch/hexagon/include/uapi/asm/Kbuild
arch/ia64/include/uapi/asm/Kbuild
arch/ia64/sn/kernel/Makefile
arch/ia64/sn/kernel/sn2/Makefile
arch/ia64/sn/pci/Makefile
arch/ia64/sn/pci/pcibr/Makefile
arch/m68k/include/uapi/asm/Kbuild
arch/microblaze/include/uapi/asm/Kbuild
arch/mips/include/uapi/asm/Kbuild
arch/nds32/include/uapi/asm/Kbuild
arch/nios2/include/uapi/asm/Kbuild
arch/openrisc/include/asm/Kbuild
arch/openrisc/include/uapi/asm/Kbuild
arch/parisc/include/asm/Kbuild
arch/parisc/include/uapi/asm/Kbuild
arch/powerpc/include/asm/Kbuild
arch/powerpc/include/uapi/asm/Kbuild
arch/riscv/include/uapi/asm/Kbuild
arch/s390/boot/Makefile
arch/s390/include/asm/Kbuild
arch/s390/include/uapi/asm/Kbuild
arch/sh/include/uapi/asm/Kbuild
arch/sparc/include/uapi/asm/Kbuild
arch/unicore32/boot/compressed/Makefile
arch/unicore32/boot/compressed/vmlinux.lds.S [new file with mode: 0644]
arch/unicore32/boot/compressed/vmlinux.lds.in [deleted file]
arch/unicore32/include/uapi/asm/Kbuild
arch/x86/include/uapi/asm/Kbuild
arch/xtensa/include/asm/Kbuild
arch/xtensa/include/uapi/asm/Kbuild
include/asm-generic/Kbuild [new file with mode: 0644]
include/uapi/asm-generic/Kbuild [new file with mode: 0644]
include/uapi/asm-generic/Kbuild.asm [deleted file]
lib/Makefile
scripts/Makefile.asm-generic
scripts/Makefile.build
scripts/Makefile.lib
scripts/Makefile.modinst
scripts/Makefile.modpost
scripts/adjust_autoksyms.sh
scripts/coccinelle/free/put_device.cocci [new file with mode: 0644]
scripts/kconfig/lxdialog/.gitignore [deleted file]
scripts/link-vmlinux.sh
scripts/mod/modpost.c
scripts/package/builddeb
scripts/package/buildtar
scripts/package/mkdebian

index f124be6e4c3a8d59e854d45df5d9314b0db48aa2..03c065855eafb39e00179626bfd2a5106a945079 100644 (file)
@@ -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
index 9ef547fc7ffe970058735c8a95687454f05eda59..4f45ae628f5415100a34b5f950101bdeeaa7647c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -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
@@ -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  =
@@ -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)
index 439f5157aa35fe373149a61a9391e838598a99ac..7417847dc438e5ff6aff14f04094a1323d6b933f 100644 (file)
@@ -1,3 +1 @@
-include include/uapi/asm-generic/Kbuild.asm
-
 generated-y += unistd_32.h
index 0febf1a07c30a7df64bd64806151f91de123da45..755bb11323d8feb92d12349bf444f151cd8acc29 100644 (file)
@@ -1,4 +1,2 @@
-include include/uapi/asm-generic/Kbuild.asm
-
 generic-y += kvm_para.h
 generic-y += ucontext.h
index 1d66db9c9db532f3c23b2ace02a18fbce7e66da5..a8a4eb7f6dae0371940a9cc70c077e2194fb02bc 100644 (file)
@@ -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
index eee8f7d23899295350959c5e60c47d52d7ff424f..23b4464c0995ab3ed1673f7aa36e16a3554e296a 100644 (file)
@@ -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
index 87eea29b24ab9d110d5f078e8295fee40ebea8f2..602d137932dcef659fc39c6eef6160bc2182f25b 100644 (file)
@@ -1,4 +1,3 @@
 # SPDX-License-Identifier: GPL-2.0
-include include/uapi/asm-generic/Kbuild.asm
 
 generic-y += kvm_para.h
index 0febf1a07c30a7df64bd64806151f91de123da45..755bb11323d8feb92d12349bf444f151cd8acc29 100644 (file)
@@ -1,4 +1,2 @@
-include include/uapi/asm-generic/Kbuild.asm
-
 generic-y += kvm_para.h
 generic-y += ucontext.h
index c1b06dcf6cf8e816552895882094f09e44afc77b..1c72f04ff75da1a7f6918f00b14116a183a79313 100644 (file)
@@ -1,3 +1 @@
-include include/uapi/asm-generic/Kbuild.asm
-
 generic-y += ucontext.h
index f801f3708a89e17cd5e933b34d4dcbefd6c1c995..ba0f26cfad6199475f700c0acbd3b220edf3c7da 100644 (file)
@@ -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/
index 961c1dc064e167748428ed6b6e95acf97ad66d8f..3e7c8ecf151e13841d0c3e491f3927aa1586434c 100644 (file)
@@ -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
index 0febf1a07c30a7df64bd64806151f91de123da45..755bb11323d8feb92d12349bf444f151cd8acc29 100644 (file)
@@ -1,4 +1,2 @@
-include include/uapi/asm-generic/Kbuild.asm
-
 generic-y += kvm_para.h
 generic-y += ucontext.h
index c1b06dcf6cf8e816552895882094f09e44afc77b..1c72f04ff75da1a7f6918f00b14116a183a79313 100644 (file)
@@ -1,3 +1 @@
-include include/uapi/asm-generic/Kbuild.asm
-
 generic-y += ucontext.h
index b71c5f787783b70a06bbdf18dd0a9a48c568803a..20018cb883a90981565284ac1d5d9df51c38e987 100644 (file)
@@ -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
index d27df1d45da7b224a184758b831d264030169903..9c349dd232650a19f76de0420461cb0e32b4ade1 100644 (file)
@@ -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 \
index 3d09108d42776658d193c9e57b59becdfadec881..170bde4549da8f6191726c099fe7c88483377f31 100644 (file)
@@ -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
index df2a9014542664cf34b0c6f89b76fa898f95bb6d..321576b1b425f8916858c875058326148216fa8f 100644 (file)
@@ -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/
index 396bcae36309ab35e45e827546fd48db3b55e88e..712f6af7c6e0d05c5ba58fc713cd764241617def 100644 (file)
@@ -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
index 960bf1e4be530b383da54074990d7a05dd9f34e2..8a7ad40be463656854310b85dbba06d5f9b8e189 100644 (file)
@@ -1,4 +1,2 @@
-include include/uapi/asm-generic/Kbuild.asm
-
 generated-y += unistd_32.h
 generic-y += kvm_para.h
index 97823ec46e97c02d45cd30168b930e3a9904d733..3ce84fbb2678f2194de4e81504494045a00915ed 100644 (file)
@@ -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
index 0851c103a8cedcd965dc8f2d6133d28860a83fcf..c3798bfe04862f182ee059ce1122d05e13c47166 100644 (file)
@@ -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
index c1b06dcf6cf8e816552895882094f09e44afc77b..1c72f04ff75da1a7f6918f00b14116a183a79313 100644 (file)
@@ -1,3 +1 @@
-include include/uapi/asm-generic/Kbuild.asm
-
 generic-y += ucontext.h
index 0febf1a07c30a7df64bd64806151f91de123da45..755bb11323d8feb92d12349bf444f151cd8acc29 100644 (file)
@@ -1,4 +1,2 @@
-include include/uapi/asm-generic/Kbuild.asm
-
 generic-y += kvm_para.h
 generic-y += ucontext.h
index 1f04844b6b82d2233be080cabfe7ca36db7ea4b8..5a73e2956ac46953ac9e1cf2404c3d0996617602 100644 (file)
@@ -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
@@ -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
index 0febf1a07c30a7df64bd64806151f91de123da45..755bb11323d8feb92d12349bf444f151cd8acc29 100644 (file)
@@ -1,4 +1,2 @@
-include include/uapi/asm-generic/Kbuild.asm
-
 generic-y += kvm_para.h
 generic-y += ucontext.h
index 0b1e354c8c24cee1cb46289a1471b76a3bbb8a9c..6f49e77d82a2a48673356355e38a411794ff51bb 100644 (file)
@@ -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
@@ -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
index c54353d390ff1fc37daacada4e60a2b14770e972..22fdbd08cdc8551777459efe75c49bbfa1e3f95a 100644 (file)
@@ -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
index 77ff7fb24823a4416df86fedd90a9a7ddb38c0a6..a0c132bedfae86965c2f7c850098b65420c2c5fc 100644 (file)
@@ -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
index 214a39acdf256527c81fd0b9def42fcbf16ae422..2bd5b392277c2cf5c4a52f3d0b7d9aaed7382f44 100644 (file)
@@ -1,4 +1,2 @@
-include include/uapi/asm-generic/Kbuild.asm
-
 generated-y += unistd_32.h
 generated-y += unistd_64.h
index d2ee86b4c091c7bcde862f8b34cb822570468d98..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1 +0,0 @@
-include include/uapi/asm-generic/Kbuild.asm
index 11ca8795b74a082f8d11e59e42bfa156a8dbfe32..c844eaf24ed739dc2b818daef401b523fc788643 100644 (file)
@@ -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)
 
index e3239772887aa2cb5a1080d6b2f567dfa1049bed..12d77cb11fe5a96269a7bde5fe6b8c6f11a23ea8 100644 (file)
@@ -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
index 6b0f30b14642669f2323736c7a2959f571f78b76..46c1ff0b842a17d379c37eb4ad5420777d2e39d8 100644 (file)
@@ -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
index eaa30bcd93bf0e4a7c04a385cf17518c4c723375..ecfbd40924dd948f97985e65daa18216c123c424 100644 (file)
@@ -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
index 214a39acdf256527c81fd0b9def42fcbf16ae422..2bd5b392277c2cf5c4a52f3d0b7d9aaed7382f44 100644 (file)
@@ -1,4 +1,2 @@
-include include/uapi/asm-generic/Kbuild.asm
-
 generated-y += unistd_32.h
 generated-y += unistd_64.h
index 9aecdd3ddc4828242b7387061c71447cb44082e4..150fafc32fb080f8b46ec2ba547f502cefe186b0 100644 (file)
@@ -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)"
diff --git a/arch/unicore32/boot/compressed/vmlinux.lds.S b/arch/unicore32/boot/compressed/vmlinux.lds.S
new file mode 100644 (file)
index 0000000..d5a3ce2
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * linux/arch/unicore/boot/compressed/vmlinux.lds.in
+ *
+ * Code specific to PKUnity SoC and UniCore ISA
+ *
+ * Copyright (C) 2001-2010 GUAN Xue-tao
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+OUTPUT_ARCH(unicore32)
+ENTRY(_start)
+SECTIONS
+{
+  /DISCARD/ : {
+    /*
+     * Discard any r/w data - this produces a link error if we have any,
+     * which is required for PIC decompression.  Local data generates
+     * GOTOFF relocations, which prevents it being relocated independently
+     * of the text/got segments.
+     */
+    *(.data)
+  }
+
+  . = TEXT_START;
+  _text = .;
+
+  .text : {
+    _start = .;
+    *(.start)
+    *(.text)
+    *(.text.*)
+    *(.fixup)
+    *(.gnu.warning)
+    *(.rodata)
+    *(.rodata.*)
+    *(.piggydata)
+    . = ALIGN(4);
+  }
+
+  _etext = .;
+
+  /* Assume size of decompressed image is 4x the compressed image */
+  _image_size = (_etext - _text) * 4;
+
+  _got_start = .;
+  .got                 : { *(.got) }
+  _got_end = .;
+  .got.plt             : { *(.got.plt) }
+  _edata = .;
+
+  . = BSS_START;
+  __bss_start = .;
+  .bss                 : { *(.bss) }
+  _end = .;
+
+  .stack               : { *(.stack) }
+  .comment 0           : { *(.comment) }
+}
+
diff --git a/arch/unicore32/boot/compressed/vmlinux.lds.in b/arch/unicore32/boot/compressed/vmlinux.lds.in
deleted file mode 100644 (file)
index d5a3ce2..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * linux/arch/unicore/boot/compressed/vmlinux.lds.in
- *
- * Code specific to PKUnity SoC and UniCore ISA
- *
- * Copyright (C) 2001-2010 GUAN Xue-tao
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-OUTPUT_ARCH(unicore32)
-ENTRY(_start)
-SECTIONS
-{
-  /DISCARD/ : {
-    /*
-     * Discard any r/w data - this produces a link error if we have any,
-     * which is required for PIC decompression.  Local data generates
-     * GOTOFF relocations, which prevents it being relocated independently
-     * of the text/got segments.
-     */
-    *(.data)
-  }
-
-  . = TEXT_START;
-  _text = .;
-
-  .text : {
-    _start = .;
-    *(.start)
-    *(.text)
-    *(.text.*)
-    *(.fixup)
-    *(.gnu.warning)
-    *(.rodata)
-    *(.rodata.*)
-    *(.piggydata)
-    . = ALIGN(4);
-  }
-
-  _etext = .;
-
-  /* Assume size of decompressed image is 4x the compressed image */
-  _image_size = (_etext - _text) * 4;
-
-  _got_start = .;
-  .got                 : { *(.got) }
-  _got_end = .;
-  .got.plt             : { *(.got.plt) }
-  _edata = .;
-
-  . = BSS_START;
-  __bss_start = .;
-  .bss                 : { *(.bss) }
-  _end = .;
-
-  .stack               : { *(.stack) }
-  .comment 0           : { *(.comment) }
-}
-
index 0febf1a07c30a7df64bd64806151f91de123da45..755bb11323d8feb92d12349bf444f151cd8acc29 100644 (file)
@@ -1,4 +1,2 @@
-include include/uapi/asm-generic/Kbuild.asm
-
 generic-y += kvm_para.h
 generic-y += ucontext.h
index efe701b7c6cebfe2da7f5ecd9126b0669ed27101..59b5ad310f780d07f4f321a84c322f9b230c040f 100644 (file)
@@ -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
index d939e13e8d846fe5d1a24f4948caae1ff798a36a..42b6cb3d16f7b9666baf44daf0a63757786d729b 100644 (file)
@@ -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
index 6b43e5049ff7e42f3c0344f824ff8e9f8cb9ca11..8a7ad40be463656854310b85dbba06d5f9b8e189 100644 (file)
@@ -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
diff --git a/include/asm-generic/Kbuild b/include/asm-generic/Kbuild
new file mode 100644 (file)
index 0000000..6f4536d
--- /dev/null
@@ -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.)
diff --git a/include/uapi/asm-generic/Kbuild b/include/uapi/asm-generic/Kbuild
new file mode 100644 (file)
index 0000000..ebb180a
--- /dev/null
@@ -0,0 +1,36 @@
+# 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
+mandatory-y += byteorder.h
+mandatory-y += errno.h
+mandatory-y += fcntl.h
+mandatory-y += ioctl.h
+mandatory-y += ioctls.h
+mandatory-y += ipcbuf.h
+mandatory-y += mman.h
+mandatory-y += msgbuf.h
+mandatory-y += param.h
+mandatory-y += poll.h
+mandatory-y += posix_types.h
+mandatory-y += ptrace.h
+mandatory-y += resource.h
+mandatory-y += sembuf.h
+mandatory-y += setup.h
+mandatory-y += shmbuf.h
+mandatory-y += sigcontext.h
+mandatory-y += siginfo.h
+mandatory-y += signal.h
+mandatory-y += socket.h
+mandatory-y += sockios.h
+mandatory-y += stat.h
+mandatory-y += statfs.h
+mandatory-y += swab.h
+mandatory-y += termbits.h
+mandatory-y += termios.h
+mandatory-y += types.h
+mandatory-y += unistd.h
diff --git a/include/uapi/asm-generic/Kbuild.asm b/include/uapi/asm-generic/Kbuild.asm
deleted file mode 100644 (file)
index 355c4ac..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# Headers that are mandatory in usr/include/asm/
-#
-mandatory-y += auxvec.h
-mandatory-y += bitsperlong.h
-mandatory-y += bpf_perf_event.h
-mandatory-y += byteorder.h
-mandatory-y += errno.h
-mandatory-y += fcntl.h
-mandatory-y += ioctl.h
-mandatory-y += ioctls.h
-mandatory-y += ipcbuf.h
-mandatory-y += mman.h
-mandatory-y += msgbuf.h
-mandatory-y += param.h
-mandatory-y += poll.h
-mandatory-y += posix_types.h
-mandatory-y += ptrace.h
-mandatory-y += resource.h
-mandatory-y += sembuf.h
-mandatory-y += setup.h
-mandatory-y += shmbuf.h
-mandatory-y += sigcontext.h
-mandatory-y += siginfo.h
-mandatory-y += signal.h
-mandatory-y += socket.h
-mandatory-y += sockios.h
-mandatory-y += stat.h
-mandatory-y += statfs.h
-mandatory-y += swab.h
-mandatory-y += termbits.h
-mandatory-y += termios.h
-mandatory-y += types.h
-mandatory-y += unistd.h
index 4e066120a0d6be50ed8161b87d6297095d12cbf9..3b08673e8881a42c9abcd67269455f69fbd9ceb0 100644 (file)
@@ -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
index a62d2823f6cfe6ffe7f269131fd3f19f78f2516c..82ad63dcd62b4733ab7370306ceb4407575651eb 100644 (file)
@@ -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)))
index 850b611f4aba268ca6eaf164d15201bf92b6f8f0..2554a15ecf2b8796c41e593d97c8b55ee97a4620 100644 (file)
@@ -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)
 
index c0abd9a779c3b1e2b117508f4b6bb2c25fc4047a..8a1f64f1774091ae2c87f0e7b9cabb9aa160d36a 100644 (file)
@@ -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
 # ---------------------------------------------------------------------------
 
index ff5ca9817a85ab394740c7ec8f8459f02a9656f9..0dae402661f3b4e924606eb6ff754b15c93784fc 100644 (file)
@@ -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
index c0b7f526f95efa2afbd556bc2b87e1a02c87afd4..6b7f354f189a53d85470a24a605d8706b7b5fa65 100644 (file)
@@ -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)
 
index 6e6d63957da348f6172ca7a7c5545e0058d8824d..84bf6b500815a9ed930e99385dc77c3c60adabf9 100755 (executable)
@@ -39,14 +39,7 @@ case "$KBUILD_VERBOSE" in
 esac
 
 # We need access to CONFIG_ symbols
-case "${KCONFIG_CONFIG}" in
-*/*)
-       . "${KCONFIG_CONFIG}"
-       ;;
-*)
-       # Force using a file from the current directory
-       . "./${KCONFIG_CONFIG}"
-esac
+. include/config/auto.conf
 
 # Generate a new ksym list file with symbols needed by the current
 # set of modules.
diff --git a/scripts/coccinelle/free/put_device.cocci b/scripts/coccinelle/free/put_device.cocci
new file mode 100644 (file)
index 0000000..7395697
--- /dev/null
@@ -0,0 +1,56 @@
+// SPDX-License-Identifier: GPL-2.0
+/// Find missing put_device for every of_find_device_by_node.
+///
+// Confidence: Moderate
+// Copyright: (C) 2018-2019 Wen Yang, ZTE.
+// Comments:
+// Options: --no-includes --include-headers
+
+virtual report
+virtual org
+
+@search exists@
+local idexpression id;
+expression x,e,e1;
+position p1,p2;
+type T,T1,T2,T3;
+@@
+
+id = of_find_device_by_node@p1(x)
+... when != e = id
+if (id == NULL || ...) { ... return ...; }
+... when != put_device(&id->dev)
+    when != platform_device_put(id)
+    when != of_dev_put(id)
+    when != if (id) { ... put_device(&id->dev) ... }
+    when != e1 = (T)id
+    when != e1 = &id->dev
+    when != e1 = get_device(&id->dev)
+    when != e1 = (T1)platform_get_drvdata(id)
+(
+  return
+(    id
+|    (T2)dev_get_drvdata(&id->dev)
+|    (T3)platform_get_drvdata(id)
+);
+| return@p2 ...;
+)
+
+@script:python depends on report@
+p1 << search.p1;
+p2 << search.p2;
+@@
+
+coccilib.report.print_report(p2[0], "ERROR: missing put_device; "
+                             + "call of_find_device_by_node on line "
+                             + p1[0].line
+                             + ", but without a corresponding object release "
+                             + "within this function.")
+
+@script:python depends on org@
+p1 << search.p1;
+p2 << search.p2;
+@@
+
+cocci.print_main("of_find_device_by_node", p1)
+cocci.print_secs("needed put_device", p2)
diff --git a/scripts/kconfig/lxdialog/.gitignore b/scripts/kconfig/lxdialog/.gitignore
deleted file mode 100644 (file)
index 90b08ff..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#
-# Generated files
-#
-lxdialog
index bc7f1fc1f55b04e90737c3b569b9a9529a07126c..dc0e8c5a140239c6a3bb13ccfbca5ab522328a28 100755 (executable)
@@ -171,14 +171,7 @@ if [ "$1" = "clean" ]; then
 fi
 
 # We need access to CONFIG_ symbols
-case "${KCONFIG_CONFIG}" in
-*/*)
-       . "${KCONFIG_CONFIG}"
-       ;;
-*)
-       # Force using a file from the current directory
-       . "./${KCONFIG_CONFIG}"
-esac
+. include/config/auto.conf
 
 # Update version
 info GEN .version
index 26bf886bd168828ccf750554aa7e28ffac6f6a8c..0b0d1080b1c5ef4903a3b87d8fbfbc11b165e739 100644 (file)
@@ -35,7 +35,6 @@ static int vmlinux_section_warnings = 1;
 static int warn_unresolved = 0;
 /* How a symbol is exported */
 static int sec_mismatch_count = 0;
-static int sec_mismatch_verbose = 1;
 static int sec_mismatch_fatal = 0;
 /* ignore missing files */
 static int ignore_missing_files;
@@ -1406,8 +1405,6 @@ static void report_sec_mismatch(const char *modname,
        char *prl_to;
 
        sec_mismatch_count++;
-       if (!sec_mismatch_verbose)
-               return;
 
        get_pretty_name(from_is_func, &from, &from_p);
        get_pretty_name(to_is_func, &to, &to_p);
@@ -1655,9 +1652,7 @@ static void extable_mismatch_handler(const char* modname, struct elf_info *elf,
 
        sec_mismatch_count++;
 
-       if (sec_mismatch_verbose)
-               report_extable_warnings(modname, elf, mismatch, r, sym,
-                                       fromsec, tosec);
+       report_extable_warnings(modname, elf, mismatch, r, sym, fromsec, tosec);
 
        if (match(tosec, mismatch->bad_tosec))
                fatal("The relocation at %s+0x%lx references\n"
@@ -2433,7 +2428,7 @@ int main(int argc, char **argv)
        struct ext_sym_list *extsym_iter;
        struct ext_sym_list *extsym_start = NULL;
 
-       while ((opt = getopt(argc, argv, "i:I:e:mnsST:o:awE")) != -1) {
+       while ((opt = getopt(argc, argv, "i:I:e:mnsT:o:awE")) != -1) {
                switch (opt) {
                case 'i':
                        kernel_read = optarg;
@@ -2465,9 +2460,6 @@ int main(int argc, char **argv)
                case 's':
                        vmlinux_section_warnings = 0;
                        break;
-               case 'S':
-                       sec_mismatch_verbose = 0;
-                       break;
                case 'T':
                        files_source = optarg;
                        break;
@@ -2525,18 +2517,9 @@ int main(int argc, char **argv)
        }
        if (dump_write)
                write_dump(dump_write);
-       if (sec_mismatch_count) {
-               if (!sec_mismatch_verbose) {
-                       warn("modpost: Found %d section mismatch(es).\n"
-                            "To see full details build your kernel with:\n"
-                            "'make CONFIG_DEBUG_SECTION_MISMATCH=y'\n",
-                            sec_mismatch_count);
-               }
-               if (sec_mismatch_fatal) {
-                       fatal("modpost: Section mismatches detected.\n"
-                             "Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them.\n");
-               }
-       }
+       if (sec_mismatch_count && sec_mismatch_fatal)
+               fatal("modpost: Section mismatches detected.\n"
+                     "Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them.\n");
        free(buf.p);
 
        return err;
index 8ac25d10a6ad68d10bb436e4ece0c678b36590e0..b03dd56a4782b481fc4e176b022d652ec60df2e4 100755 (executable)
 
 set -e
 
+is_enabled() {
+       grep -q "^$1=y" include/config/auto.conf
+}
+
+if_enabled_echo() {
+       if is_enabled "$1"; then
+               echo -n "$2"
+       elif [ $# -ge 3 ]; then
+               echo -n "$3"
+       fi
+}
+
 create_package() {
        local pname="$1" pdir="$2"
 
@@ -62,7 +74,7 @@ parisc|mips|powerpc)
        installed_image_path="boot/vmlinuz-$version"
 esac
 
-BUILD_DEBUG="$(grep -s '^CONFIG_DEBUG_INFO=y' $KCONFIG_CONFIG || true)"
+BUILD_DEBUG=$(if_enabled_echo CONFIG_DEBUG_INFO Yes)
 
 # Setup the directory structure
 rm -rf "$tmpdir" "$kernel_headers_dir" "$libc_headers_dir" "$dbg_dir" $objtree/debian/files
@@ -83,14 +95,14 @@ else
 fi
 cp "$($MAKE -s -f $srctree/Makefile image_name)" "$tmpdir/$installed_image_path"
 
-if grep -q "^CONFIG_OF_EARLY_FLATTREE=y" $KCONFIG_CONFIG ; then
+if is_enabled CONFIG_OF_EARLY_FLATTREE; then
        # Only some architectures with OF support have this target
        if [ -d "${srctree}/arch/$SRCARCH/boot/dts" ]; then
                $MAKE -f $srctree/Makefile INSTALL_DTBS_PATH="$tmpdir/usr/lib/$packagename" dtbs_install
        fi
 fi
 
-if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then
+if is_enabled CONFIG_MODULES; then
        INSTALL_MOD_PATH="$tmpdir" $MAKE -f $srctree/Makefile modules_install
        rm -f "$tmpdir/lib/modules/$version/build"
        rm -f "$tmpdir/lib/modules/$version/source"
@@ -111,8 +123,7 @@ if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then
                done
 
                # resign stripped modules
-               MODULE_SIG_ALL="$(grep -s '^CONFIG_MODULE_SIG_ALL=y' $KCONFIG_CONFIG || true)"
-               if [ -n "$MODULE_SIG_ALL" ]; then
+               if is_enabled CONFIG_MODULE_SIG_ALL; then
                        INSTALL_MOD_PATH="$tmpdir" $MAKE -f $srctree/Makefile modules_sign
                fi
        fi
@@ -129,11 +140,6 @@ fi
 # make-kpkg sets $INITRD to indicate whether an initramfs is wanted, and
 # so do we; recent versions of dracut and initramfs-tools will obey this.
 debhookdir=${KDEB_HOOKDIR:-/etc/kernel}
-if grep -q '^CONFIG_BLK_DEV_INITRD=y' $KCONFIG_CONFIG; then
-       want_initrd=Yes
-else
-       want_initrd=No
-fi
 for script in postinst postrm preinst prerm ; do
        mkdir -p "$tmpdir$debhookdir/$script.d"
        cat <<EOF > "$tmpdir/DEBIAN/$script"
@@ -145,7 +151,7 @@ set -e
 export DEB_MAINT_PARAMS="\$*"
 
 # Tell initramfs builder whether it's wanted
-export INITRD=$want_initrd
+export INITRD=$(if_enabled_echo CONFIG_BLK_DEV_INITRD Yes No)
 
 test -d $debhookdir/$script.d && run-parts --arg="$version" --arg="/$installed_image_path" $debhookdir/$script.d
 exit 0
@@ -158,11 +164,11 @@ done
 (cd $srctree; find arch/*/include include scripts -type f -o -type l) >> "$objtree/debian/hdrsrcfiles"
 (cd $srctree; find arch/$SRCARCH -name module.lds -o -name Kbuild.platforms -o -name Platform) >> "$objtree/debian/hdrsrcfiles"
 (cd $srctree; find $(find arch/$SRCARCH -name include -o -name scripts -type d) -type f) >> "$objtree/debian/hdrsrcfiles"
-if grep -q '^CONFIG_STACK_VALIDATION=y' $KCONFIG_CONFIG ; then
+if is_enabled CONFIG_STACK_VALIDATION; then
        (cd $objtree; find tools/objtool -type f -executable) >> "$objtree/debian/hdrobjfiles"
 fi
 (cd $objtree; find arch/$SRCARCH/include Module.symvers include scripts -type f) >> "$objtree/debian/hdrobjfiles"
-if grep -q '^CONFIG_GCC_PLUGINS=y' $KCONFIG_CONFIG ; then
+if is_enabled CONFIG_GCC_PLUGINS; then
        (cd $objtree; find scripts/gcc-plugins -name \*.so -o -name gcc-common.h) >> "$objtree/debian/hdrobjfiles"
 fi
 destdir=$kernel_headers_dir/usr/src/linux-headers-$version
index cfd2a4a3fe42db1bf21e61ac93cc36f280b8c15b..2f66c81e4021bd808251c3a5ccf9921f0f32dd89 100755 (executable)
@@ -56,7 +56,7 @@ dirs=boot
 #
 # Try to install modules
 #
-if grep -q '^CONFIG_MODULES=y' "${KCONFIG_CONFIG}"; then
+if grep -q '^CONFIG_MODULES=y' include/config/auto.conf; then
        make ARCH="${ARCH}" -f ${srctree}/Makefile INSTALL_MOD_PATH="${tmpdir}" modules_install
        dirs="$dirs lib"
 fi
index f030961c5165b444806a38c424b132e0e15ca7b4..8351584cb24e61f3f3c3250b8b94c9b10a223b5f 100755 (executable)
@@ -7,7 +7,7 @@
 set -e
 
 is_enabled() {
-       grep -q "^CONFIG_$1=y" $KCONFIG_CONFIG
+       grep -q "^$1=y" include/config/auto.conf
 }
 
 if_enabled_echo() {
@@ -31,23 +31,23 @@ set_debarch() {
        x86_64)
                debarch=amd64 ;;
        sparc*)
-               debarch=sparc$(if_enabled_echo 64BIT 64) ;;
+               debarch=sparc$(if_enabled_echo CONFIG_64BIT 64) ;;
        s390*)
                debarch=s390x ;;
        ppc*)
-               if is_enabled 64BIT; then
-                       debarch=ppc64$(if_enabled_echo CPU_LITTLE_ENDIAN el)
+               if is_enabled CONFIG_64BIT; then
+                       debarch=ppc64$(if_enabled_echo CONFIG_CPU_LITTLE_ENDIAN el)
                else
-                       debarch=powerpc$(if_enabled_echo SPE spe)
+                       debarch=powerpc$(if_enabled_echo CONFIG_SPE spe)
                fi
                ;;
        parisc*)
                debarch=hppa ;;
        mips*)
-               if is_enabled CPU_LITTLE_ENDIAN; then
-                       debarch=mips$(if_enabled_echo 64BIT 64)$(if_enabled_echo CPU_MIPSR6 r6)el
-               elif is_enabled CPU_MIPSR6; then
-                       debarch=mips$(if_enabled_echo 64BIT 64)r6
+               if is_enabled CONFIG_CPU_LITTLE_ENDIAN; then
+                       debarch=mips$(if_enabled_echo CONFIG_64BIT 64)$(if_enabled_echo CONFIG_CPU_MIPSR6 r6)el
+               elif is_enabled CONFIG_CPU_MIPSR6; then
+                       debarch=mips$(if_enabled_echo CONFIG_64BIT 64)r6
                else
                        debarch=mips
                fi
@@ -55,8 +55,8 @@ set_debarch() {
        aarch64|arm64)
                debarch=arm64 ;;
        arm*)
-               if is_enabled AEABI; then
-                       debarch=arm$(if_enabled_echo VFP hf el)
+               if is_enabled CONFIG_AEABI; then
+                       debarch=arm$(if_enabled_echo CONFIG_VFP hf el)
                else
                        debarch=arm
                fi
@@ -64,10 +64,10 @@ set_debarch() {
        openrisc)
                debarch=or1k ;;
        sh)
-               if is_enabled CPU_SH3; then
-                       debarch=sh3$(if_enabled_echo CPU_BIG_ENDIAN eb)
-               elif is_enabled CPU_SH4; then
-                       debarch=sh4$(if_enabled_echo CPU_BIG_ENDIAN eb)
+               if is_enabled CONFIG_CPU_SH3; then
+                       debarch=sh3$(if_enabled_echo CONFIG_CPU_BIG_ENDIAN eb)
+               elif is_enabled CONFIG_CPU_SH4; then
+                       debarch=sh4$(if_enabled_echo CONFIG_CPU_BIG_ENDIAN eb)
                fi
                ;;
        esac
@@ -132,8 +132,12 @@ else
         echo >&2 "Install lsb-release or set \$KDEB_CHANGELOG_DIST explicitly"
 fi
 
-mkdir -p debian/
+mkdir -p debian/source/
+echo "1.0" > debian/source/format
+
 echo $debarch > debian/arch
+extra_build_depends=", $(if_enabled_echo CONFIG_UNWINDER_ORC libelf-dev)"
+extra_build_depends="$extra_build_depends, $(if_enabled_echo CONFIG_SYSTEM_TRUSTED_KEYRING libssl-dev:native)"
 
 # Generate a simple changelog template
 cat <<EOF > debian/changelog
@@ -170,7 +174,7 @@ Source: $sourcename
 Section: kernel
 Priority: optional
 Maintainer: $maintainer
-Build-Depends: bc, kmod, cpio
+Build-Depends: bc, kmod, cpio, bison, flex | flex:native $extra_build_depends
 Homepage: http://www.kernel.org/
 
 Package: $packagename
@@ -221,5 +225,6 @@ clean:
 
 binary: binary-arch
 EOF
+chmod +x debian/rules
 
 exit 0