Merge tag 'kbuild-v5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 25 Feb 2021 18:17:31 +0000 (10:17 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 25 Feb 2021 18:17:31 +0000 (10:17 -0800)
Pull Kbuild updates from Masahiro Yamada:

 - Fix false-positive build warnings for ARCH=ia64 builds

 - Optimize dictionary size for module compression with xz

 - Check the compiler and linker versions in Kconfig

 - Fix misuse of extra-y

 - Support DWARF v5 debug info

 - Clamp SUBLEVEL to 255 because stable releases 4.4.x and 4.9.x
   exceeded the limit

 - Add generic syscall{tbl,hdr}.sh for cleanups across arches

 - Minor cleanups of genksyms

 - Minor cleanups of Kconfig

* tag 'kbuild-v5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (38 commits)
  initramfs: Remove redundant dependency of RD_ZSTD on BLK_DEV_INITRD
  kbuild: remove deprecated 'always' and 'hostprogs-y/m'
  kbuild: parse C= and M= before changing the working directory
  kbuild: reuse this-makefile to define abs_srctree
  kconfig: unify rule of config, menuconfig, nconfig, gconfig, xconfig
  kconfig: omit --oldaskconfig option for 'make config'
  kconfig: fix 'invalid option' for help option
  kconfig: remove dead code in conf_askvalue()
  kconfig: clean up nested if-conditionals in check_conf()
  kconfig: Remove duplicate call to sym_get_string_value()
  Makefile: Remove # characters from compiler string
  Makefile: reuse CC_VERSION_TEXT
  kbuild: check the minimum linker version in Kconfig
  kbuild: remove ld-version macro
  scripts: add generic syscallhdr.sh
  scripts: add generic syscalltbl.sh
  arch: syscalls: remove $(srctree)/ prefix from syscall tables
  arch: syscalls: add missing FORCE and fix 'targets' to make if_changed work
  gen_compile_commands: prune some directories
  kbuild: simplify access to the kernel's version
  ...

65 files changed:
Documentation/devicetree/bindings/Makefile
Documentation/kbuild/makefiles.rst
MAINTAINERS
Makefile
arch/alpha/kernel/syscalls/Makefile
arch/arm/tools/Makefile
arch/arm64/Kconfig
arch/ia64/Makefile
arch/ia64/include/asm/irq.h
arch/ia64/include/asm/mca.h
arch/ia64/include/asm/pal.h
arch/ia64/include/asm/sal.h
arch/ia64/kernel/Makefile
arch/ia64/kernel/asm-offsets.c
arch/ia64/kernel/crash.c
arch/ia64/kernel/efi.c
arch/ia64/kernel/mca.c
arch/ia64/kernel/mca_drv.c
arch/ia64/kernel/nr-irqs.c [deleted file]
arch/ia64/kernel/syscalls/Makefile
arch/m68k/kernel/syscalls/Makefile
arch/microblaze/kernel/syscalls/Makefile
arch/mips/kernel/syscalls/Makefile
arch/mips/loongson64/Platform
arch/mips/vdso/Kconfig
arch/parisc/kernel/syscalls/Makefile
arch/powerpc/Makefile
arch/powerpc/kernel/syscalls/Makefile
arch/powerpc/lib/Makefile
arch/sh/kernel/syscalls/Makefile
arch/sparc/kernel/syscalls/Makefile
arch/x86/entry/syscalls/Makefile
arch/xtensa/kernel/syscalls/Makefile
drivers/gpu/drm/i915/Makefile
drivers/net/ethernet/mellanox/mlx5/core/main.c
drivers/usb/core/hcd.c
drivers/usb/gadget/udc/aspeed-vhub/hub.c
include/asm-generic/vmlinux.lds.h
include/linux/compiler-clang.h
include/linux/compiler-gcc.h
include/linux/usb/composite.h
init/Kconfig
kernel/sys.c
lib/Kconfig.debug
scripts/Kbuild.include
scripts/Kconfig.include
scripts/Makefile.build
scripts/Makefile.clean
scripts/Makefile.lib
scripts/cc-version.sh [new file with mode: 0755]
scripts/clang-tools/gen_compile_commands.py
scripts/clang-version.sh [deleted file]
scripts/gcc-version.sh [deleted file]
scripts/gdb/linux/Makefile
scripts/genksyms/genksyms.c
scripts/genksyms/genksyms.h
scripts/genksyms/lex.l
scripts/kconfig/Makefile
scripts/kconfig/conf.c
scripts/ld-version.sh
scripts/lld-version.sh [deleted file]
scripts/syscallhdr.sh [new file with mode: 0755]
scripts/syscalltbl.sh [new file with mode: 0755]
scripts/test_dwarf5_support.sh [new file with mode: 0755]
usr/Kconfig

index f5530c91d655c2680076c5a2012797d8d6344e83..780e5618ec0ae2fc7942c86a802d9cc98119494b 100644 (file)
@@ -78,10 +78,10 @@ $(obj)/processed-schema.json: $(DT_SCHEMA_FILES) check_dtschema_version FORCE
 
 endif
 
-extra-$(CHECK_DT_BINDING) += processed-schema-examples.json
-extra-$(CHECK_DTBS) += processed-schema.json
-extra-$(CHECK_DT_BINDING) += $(patsubst $(src)/%.yaml,%.example.dts, $(DT_SCHEMA_FILES))
-extra-$(CHECK_DT_BINDING) += $(patsubst $(src)/%.yaml,%.example.dt.yaml, $(DT_SCHEMA_FILES))
+always-$(CHECK_DT_BINDING) += processed-schema-examples.json
+always-$(CHECK_DTBS)       += processed-schema.json
+always-$(CHECK_DT_BINDING) += $(patsubst $(src)/%.yaml,%.example.dts, $(DT_SCHEMA_FILES))
+always-$(CHECK_DT_BINDING) += $(patsubst $(src)/%.yaml,%.example.dt.yaml, $(DT_SCHEMA_FILES))
 
 # Hack: avoid 'Argument list too long' error for 'make clean'. Remove most of
 # build artifacts here before they are processed by scripts/Makefile.clean
index de669c2f1fcdb35d888f9c66adc34d4c8bfbfe53..db3af0b45bafa7872f54a3b5fd91753396ea89a6 100644 (file)
@@ -12,7 +12,7 @@ This document describes the Linux kernel Makefiles.
           --- 3.1 Goal definitions
           --- 3.2 Built-in object goals - obj-y
           --- 3.3 Loadable module goals - obj-m
-          --- 3.4 Objects which export symbols
+          --- 3.4 <deleted>
           --- 3.5 Library file goals - lib-y
           --- 3.6 Descending down in directories
           --- 3.7 Non-builtin vmlinux targets - extra-y
@@ -247,12 +247,6 @@ more details, with real examples.
        kbuild will build an ext2.o file for you out of the individual
        parts and then link this into built-in.a, as you would expect.
 
-3.4 Objects which export symbols
---------------------------------
-
-       No special notation is required in the makefiles for
-       modules exporting symbols.
-
 3.5 Library file goals - lib-y
 ------------------------------
 
index b40744cc6e991c0dc56c121a5fc61bb661721c3d..c71664ca8bfdc31ade22ad71cfc374738195c6bc 100644 (file)
@@ -4319,8 +4319,6 @@ C:        irc://chat.freenode.net/clangbuiltlinux
 F:     Documentation/kbuild/llvm.rst
 F:     include/linux/compiler-clang.h
 F:     scripts/clang-tools/
-F:     scripts/clang-version.sh
-F:     scripts/lld-version.sh
 K:     \b(?i:clang|llvm)\b
 
 CLEANCACHE API
index b18dbc634690261a00d371e7e76aeb1936835033..6ecd0d22e608dc6e55fe459806edf798ff0752b8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -100,6 +100,36 @@ endif
 
 export quiet Q KBUILD_VERBOSE
 
+# Call a source code checker (by default, "sparse") as part of the
+# C compilation.
+#
+# Use 'make C=1' to enable checking of only re-compiled files.
+# Use 'make C=2' to enable checking of *all* source files, regardless
+# of whether they are re-compiled or not.
+#
+# See the file "Documentation/dev-tools/sparse.rst" for more details,
+# including where to get the "sparse" utility.
+
+ifeq ("$(origin C)", "command line")
+  KBUILD_CHECKSRC = $(C)
+endif
+ifndef KBUILD_CHECKSRC
+  KBUILD_CHECKSRC = 0
+endif
+
+export KBUILD_CHECKSRC
+
+# Use make M=dir or set the environment variable KBUILD_EXTMOD to specify the
+# directory of external module to build. Setting M= takes precedence.
+ifeq ("$(origin M)", "command line")
+  KBUILD_EXTMOD := $(M)
+endif
+
+$(if $(word 2, $(KBUILD_EXTMOD)), \
+       $(error building multiple external modules is not supported))
+
+export KBUILD_EXTMOD
+
 # Kbuild will save output files in the current working directory.
 # This does not need to match to the root of the kernel source tree.
 #
@@ -145,7 +175,8 @@ else
 need-sub-make := 1
 endif
 
-abs_srctree := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
+this-makefile := $(lastword $(MAKEFILE_LIST))
+abs_srctree := $(realpath $(dir $(this-makefile)))
 
 ifneq ($(words $(subst :, ,$(abs_srctree))), 1)
 $(error source directory cannot contain spaces or colons)
@@ -160,8 +191,6 @@ MAKEFLAGS += --include-dir=$(abs_srctree)
 need-sub-make := 1
 endif
 
-this-makefile := $(lastword $(MAKEFILE_LIST))
-
 ifneq ($(filter 3.%,$(MAKE_VERSION)),)
 # 'MAKEFLAGS += -rR' does not immediately become effective for GNU Make 3.x
 # We need to invoke sub-make to avoid implicit rules in the top Makefile.
@@ -195,36 +224,6 @@ ifeq ($(need-sub-make),)
 # so that IDEs/editors are able to understand relative filenames.
 MAKEFLAGS += --no-print-directory
 
-# Call a source code checker (by default, "sparse") as part of the
-# C compilation.
-#
-# Use 'make C=1' to enable checking of only re-compiled files.
-# Use 'make C=2' to enable checking of *all* source files, regardless
-# of whether they are re-compiled or not.
-#
-# See the file "Documentation/dev-tools/sparse.rst" for more details,
-# including where to get the "sparse" utility.
-
-ifeq ("$(origin C)", "command line")
-  KBUILD_CHECKSRC = $(C)
-endif
-ifndef KBUILD_CHECKSRC
-  KBUILD_CHECKSRC = 0
-endif
-
-# Use make M=dir or set the environment variable KBUILD_EXTMOD to specify the
-# directory of external module to build. Setting M= takes precedence.
-ifeq ("$(origin M)", "command line")
-  KBUILD_EXTMOD := $(M)
-endif
-
-$(if $(word 2, $(KBUILD_EXTMOD)), \
-       $(error building multiple external modules is not supported))
-
-export KBUILD_CHECKSRC KBUILD_EXTMOD
-
-extmod-prefix = $(if $(KBUILD_EXTMOD),$(KBUILD_EXTMOD)/)
-
 ifeq ($(abs_srctree),$(abs_objtree))
         # building in the source tree
         srctree := .
@@ -257,7 +256,6 @@ export building_out_of_srctree srctree objtree VPATH
 # of make so .config is not included in this case either (for *config).
 
 version_h := include/generated/uapi/linux/version.h
-old_version_h := include/linux/version.h
 
 clean-targets := %clean mrproper cleandocs
 no-dot-config-targets := $(clean-targets) \
@@ -558,7 +556,13 @@ ifdef building_out_of_srctree
        { echo "# this is build directory, ignore it"; echo "*"; } > .gitignore
 endif
 
-ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),)
+# The expansion should be delayed until arch/$(SRCARCH)/Makefile is included.
+# Some architectures define CROSS_COMPILE in arch/$(SRCARCH)/Makefile.
+# CC_VERSION_TEXT is referenced from Kconfig (so it needs export),
+# and from include/config/auto.conf.cmd to detect the compiler upgrade.
+CC_VERSION_TEXT = $(shell $(CC) --version 2>/dev/null | head -n 1 | sed 's/\#//g')
+
+ifneq ($(findstring clang,$(CC_VERSION_TEXT)),)
 ifneq ($(CROSS_COMPILE),)
 CLANG_FLAGS    += --target=$(notdir $(CROSS_COMPILE:%-=%))
 GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit))
@@ -577,12 +581,6 @@ KBUILD_AFLAGS      += $(CLANG_FLAGS)
 export CLANG_FLAGS
 endif
 
-# The expansion should be delayed until arch/$(SRCARCH)/Makefile is included.
-# Some architectures define CROSS_COMPILE in arch/$(SRCARCH)/Makefile.
-# CC_VERSION_TEXT is referenced from Kconfig (so it needs export),
-# and from include/config/auto.conf.cmd to detect the compiler upgrade.
-CC_VERSION_TEXT = $(shell $(CC) --version 2>/dev/null | head -n 1)
-
 ifdef config-build
 # ===========================================================================
 # *config targets only - make sure prerequisites are updated, and descend
@@ -832,8 +830,10 @@ ifneq ($(LLVM_IAS),1)
 KBUILD_AFLAGS  += -Wa,-gdwarf-2
 endif
 
-ifdef CONFIG_DEBUG_INFO_DWARF4
-DEBUG_CFLAGS   += -gdwarf-4
+ifndef CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
+dwarf-version-$(CONFIG_DEBUG_INFO_DWARF4) := 4
+dwarf-version-$(CONFIG_DEBUG_INFO_DWARF5) := 5
+DEBUG_CFLAGS   += -gdwarf-$(dwarf-version-y)
 endif
 
 ifdef CONFIG_DEBUG_INFO_REDUCED
@@ -1072,7 +1072,7 @@ ifdef CONFIG_MODULE_COMPRESS
     mod_compress_cmd = $(KGZIP) -n -f
   endif # CONFIG_MODULE_COMPRESS_GZIP
   ifdef CONFIG_MODULE_COMPRESS_XZ
-    mod_compress_cmd = $(XZ) -f
+    mod_compress_cmd = $(XZ) --lzma2=dict=2MiB -f
   endif # CONFIG_MODULE_COMPRESS_XZ
 endif # CONFIG_MODULE_COMPRESS
 export mod_compress_cmd
@@ -1123,6 +1123,7 @@ endif # CONFIG_BPF
 
 PHONY += prepare0
 
+extmod-prefix = $(if $(KBUILD_EXTMOD),$(KBUILD_EXTMOD)/)
 export MODORDER := $(extmod-prefix)modules.order
 export MODULES_NSDEPS := $(extmod-prefix)modules.nsdeps
 
@@ -1280,14 +1281,22 @@ define filechk_utsrelease.h
 endef
 
 define filechk_version.h
-       echo \#define LINUX_VERSION_CODE $(shell                         \
-       expr $(VERSION) \* 65536 + 0$(PATCHLEVEL) \* 256 + 0$(SUBLEVEL)); \
-       echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'
+       if [ $(SUBLEVEL) -gt 255 ]; then                                 \
+               echo \#define LINUX_VERSION_CODE $(shell                 \
+               expr $(VERSION) \* 65536 + 0$(PATCHLEVEL) \* 256 + 255); \
+       else                                                             \
+               echo \#define LINUX_VERSION_CODE $(shell                 \
+               expr $(VERSION) \* 65536 + 0$(PATCHLEVEL) \* 256 + $(SUBLEVEL)); \
+       fi;                                                              \
+       echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) +  \
+       ((c) > 255 ? 255 : (c)))';                                       \
+       echo \#define LINUX_VERSION_MAJOR $(VERSION);                    \
+       echo \#define LINUX_VERSION_PATCHLEVEL $(PATCHLEVEL);            \
+       echo \#define LINUX_VERSION_SUBLEVEL $(SUBLEVEL)
 endef
 
 $(version_h): FORCE
        $(call filechk,version.h)
-       $(Q)rm -f $(old_version_h)
 
 include/generated/utsrelease.h: include/config/kernel.release FORCE
        $(call filechk,utsrelease.h)
index 659faefdcb1da5f0ffbafc40fd598dd98d9a5fde..285aaba832d93936c3f2b7edb2938dbfe13fc21f 100644 (file)
@@ -5,7 +5,7 @@ uapi := arch/$(SRCARCH)/include/generated/uapi/asm
 _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)')      \
          $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')
 
-syscall := $(srctree)/$(src)/syscall.tbl
+syscall := $(src)/syscall.tbl
 syshdr := $(srctree)/$(src)/syscallhdr.sh
 systbl := $(srctree)/$(src)/syscalltbl.sh
 
@@ -21,18 +21,19 @@ quiet_cmd_systbl = SYSTBL  $@
                   '$(systbl_abi_$(basetarget))'                \
                   '$(systbl_offset_$(basetarget))'
 
-$(uapi)/unistd_32.h: $(syscall) $(syshdr)
+$(uapi)/unistd_32.h: $(syscall) $(syshdr) FORCE
        $(call if_changed,syshdr)
 
-$(kapi)/syscall_table.h: $(syscall) $(systbl)
+$(kapi)/syscall_table.h: $(syscall) $(systbl) FORCE
        $(call if_changed,systbl)
 
 uapisyshdr-y           += unistd_32.h
 kapisyshdr-y           += syscall_table.h
 
-targets        += $(uapisyshdr-y) $(kapisyshdr-y)
+uapisyshdr-y   := $(addprefix $(uapi)/, $(uapisyshdr-y))
+kapisyshdr-y   := $(addprefix $(kapi)/, $(kapisyshdr-y))
+targets                += $(addprefix ../../../../, $(uapisyshdr-y) $(kapisyshdr-y))
 
 PHONY += all
-all: $(addprefix $(uapi)/,$(uapisyshdr-y))
-all: $(addprefix $(kapi)/,$(kapisyshdr-y))
+all: $(uapisyshdr-y) $(kapisyshdr-y)
        @:
index 27d8beb7c9410bedc6010ccbacd77ef3b8526558..3654f979851b71efac6dec5d46e461e2d8571b32 100644 (file)
@@ -11,7 +11,7 @@ uapi := $(gen)/uapi/asm
 syshdr := $(srctree)/$(src)/syscallhdr.sh
 sysnr := $(srctree)/$(src)/syscallnr.sh
 systbl := $(srctree)/$(src)/syscalltbl.sh
-syscall := $(srctree)/$(src)/syscall.tbl
+syscall := $(src)/syscall.tbl
 
 gen-y := $(gen)/calls-oabi.S
 gen-y += $(gen)/calls-eabi.S
index fd8abf9cb31210e1106006cce18d33efb729764d..fc0ce2a1f3bfa63a10091a012fd2ec946d81a012 100644 (file)
@@ -1485,7 +1485,7 @@ config ARM64_PTR_AUTH
        depends on (CC_HAS_SIGN_RETURN_ADDRESS || CC_HAS_BRANCH_PROT_PAC_RET) && AS_HAS_PAC
        # Modern compilers insert a .note.gnu.property section note for PAC
        # which is only understood by binutils starting with version 2.33.1.
-       depends on LD_IS_LLD || LD_VERSION >= 233010000 || (CC_IS_GCC && GCC_VERSION < 90100)
+       depends on LD_IS_LLD || LD_VERSION >= 23301 || (CC_IS_GCC && GCC_VERSION < 90100)
        depends on !CC_IS_CLANG || AS_HAS_CFI_NEGATE_RA_STATE
        depends on (!FUNCTION_GRAPH_TRACER || DYNAMIC_FTRACE_WITH_REGS)
        help
index f3328a29e881ba6808bfe1c8c2cd4dbbce88cc7a..3e9da5e6c3bdde5bfc1edc4b508e0af58317a430 100644 (file)
@@ -85,9 +85,3 @@ define archhelp
   echo '  install      - Install compressed kernel image'
   echo '* unwcheck     - Check vmlinux for invalid unwind info'
 endef
-
-archprepare: make_nr_irqs_h
-PHONY += make_nr_irqs_h
-
-make_nr_irqs_h:
-       $(Q)$(MAKE) $(build)=arch/ia64/kernel include/generated/nr-irqs.h
index 5acf52e908722c0a3cbeaaba96ed7e310a042707..0eccf33dfe8be99e7a22c1061fd2d2e88e66cc0a 100644 (file)
@@ -14,7 +14,9 @@
 
 #include <linux/types.h>
 #include <linux/cpumask.h>
-#include <generated/nr-irqs.h>
+#include <asm/native/irq.h>
+
+#define NR_IRQS                IA64_NATIVE_NR_IRQS
 
 static __inline__ int
 irq_canonicalize (int irq)
index 726df17f1b5166c6157f9b532dd8efd525cb326b..05805249296cd5234ac8caceef7e29302a1c23fc 100644 (file)
 
 #if !defined(__ASSEMBLY__)
 
-#include <linux/interrupt.h>
+#include <linux/percpu.h>
+#include <linux/threads.h>
 #include <linux/types.h>
-
-#include <asm/param.h>
-#include <asm/sal.h>
-#include <asm/processor.h>
-#include <asm/mca_asm.h>
+#include <asm/ptrace.h>
 
 #define IA64_MCA_RENDEZ_TIMEOUT                (20 * 1000)     /* value in milliseconds - 20 seconds */
 
@@ -83,7 +80,7 @@ struct ia64_sal_os_state {
        /* common */
        unsigned long           sal_ra;                 /* Return address in SAL, physical */
        unsigned long           sal_gp;                 /* GP of the SAL - physical */
-       pal_min_state_area_t    *pal_min_state;         /* from R17.  physical in asm, virtual in C */
+       struct pal_min_state_area *pal_min_state;       /* from R17.  physical in asm, virtual in C */
        /* Previous values of IA64_KR(CURRENT) and IA64_KR(CURRENT_STACK).
         * Note: if the MCA/INIT recovery code wants to resume to a new context
         * then it must change these values to reflect the new kernel stack.
index f9d2b3b2dfad4f7a81601642bbd65ceb26b45c93..b1d87955e8cc9cecdaadddb31e200a2ee98ed8e5 100644 (file)
@@ -750,7 +750,7 @@ typedef union pal_mc_error_info_u {
  * for PAL.
  */
 
-typedef struct pal_min_state_area_s {
+struct pal_min_state_area {
        u64     pmsa_nat_bits;          /* nat bits for saved GRs  */
        u64     pmsa_gr[15];            /* GR1  - GR15             */
        u64     pmsa_bank0_gr[16];      /* GR16 - GR31             */
@@ -766,7 +766,7 @@ typedef struct pal_min_state_area_s {
        u64     pmsa_xfs;               /* previous ifs            */
        u64     pmsa_br1;               /* branch register 1       */
        u64     pmsa_reserved[70];      /* pal_min_state_area should total to 1KB */
-} pal_min_state_area_t;
+};
 
 
 struct ia64_pal_retval {
index 08f5b6aaed7324096e0d07cc39503c7d65b1dc9d..78f4f7b40435e5d3d6bfa975608005255b8506b4 100644 (file)
@@ -385,7 +385,7 @@ typedef struct sal_processor_static_info {
                    fr              : 1,
                    reserved        : 58;
        } valid;
-       pal_min_state_area_t min_state_area;
+       struct pal_min_state_area min_state_area;
        u64 br[8];
        u64 cr[128];
        u64 ar[128];
index c89bd5f8cbf8311975c7bcbb181a635010cf8387..78717819131cc2bc2a8101d0247ab7bf04c11dbf 100644 (file)
@@ -47,8 +47,3 @@ CFLAGS_traps.o  += -mfixed-range=f2-f5,f16-f31
 
 # The gate DSO image is built using a special linker script.
 include $(src)/Makefile.gate
-
-include/generated/nr-irqs.h: arch/$(SRCARCH)/kernel/nr-irqs.s FORCE
-       $(call filechk,offsets,__ASM_NR_IRQS_H__)
-
-targets += nr-irqs.s
index fb0deb8a42218ad2514db46904dd28daf86ece61..be3b90fef2e9218bc1351bf7c6dc9a06544490a6 100644 (file)
@@ -245,23 +245,23 @@ void foo(void)
        BLANK();
 
        DEFINE(IA64_PMSA_GR_OFFSET,
-              offsetof (struct pal_min_state_area_s, pmsa_gr));
+              offsetof(struct pal_min_state_area, pmsa_gr));
        DEFINE(IA64_PMSA_BANK1_GR_OFFSET,
-              offsetof (struct pal_min_state_area_s, pmsa_bank1_gr));
+              offsetof(struct pal_min_state_area, pmsa_bank1_gr));
        DEFINE(IA64_PMSA_PR_OFFSET,
-              offsetof (struct pal_min_state_area_s, pmsa_pr));
+              offsetof(struct pal_min_state_area, pmsa_pr));
        DEFINE(IA64_PMSA_BR0_OFFSET,
-              offsetof (struct pal_min_state_area_s, pmsa_br0));
+              offsetof(struct pal_min_state_area, pmsa_br0));
        DEFINE(IA64_PMSA_RSC_OFFSET,
-              offsetof (struct pal_min_state_area_s, pmsa_rsc));
+              offsetof(struct pal_min_state_area, pmsa_rsc));
        DEFINE(IA64_PMSA_IIP_OFFSET,
-              offsetof (struct pal_min_state_area_s, pmsa_iip));
+              offsetof(struct pal_min_state_area, pmsa_iip));
        DEFINE(IA64_PMSA_IPSR_OFFSET,
-              offsetof (struct pal_min_state_area_s, pmsa_ipsr));
+              offsetof(struct pal_min_state_area, pmsa_ipsr));
        DEFINE(IA64_PMSA_IFS_OFFSET,
-              offsetof (struct pal_min_state_area_s, pmsa_ifs));
+              offsetof(struct pal_min_state_area, pmsa_ifs));
        DEFINE(IA64_PMSA_XIP_OFFSET,
-              offsetof (struct pal_min_state_area_s, pmsa_xip));
+              offsetof(struct pal_min_state_area, pmsa_xip));
        BLANK();
 
        /* used by fsys_gettimeofday in arch/ia64/kernel/fsys.S */
index 4f47741005d26e160671556529f3985ee8509307..76730f34685c451141c4a3890e6b126b732e4712 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/memblock.h>
 #include <linux/kexec.h>
 #include <linux/elfcore.h>
+#include <linux/reboot.h>
 #include <linux/sysctl.h>
 #include <linux/init.h>
 #include <linux/kdebug.h>
index dd7fd750bb934925ca94b85910548b8eacb2fb72..c5fe21de46a81dbccd8d57a4869a93ff412da05a 100644 (file)
@@ -40,6 +40,7 @@
 #include <asm/meminit.h>
 #include <asm/processor.h>
 #include <asm/mca.h>
+#include <asm/sal.h>
 #include <asm/setup.h>
 #include <asm/tlbflush.h>
 
index 0fea266b4d39447d34eb5fcf40828fa2538c3841..d4cae2fc69ca333ae03fe342aa3f04f0ce389653 100644 (file)
@@ -97,6 +97,7 @@
 #include <asm/ptrace.h>
 #include <asm/sal.h>
 #include <asm/mca.h>
+#include <asm/mca_asm.h>
 #include <asm/kexec.h>
 
 #include <asm/irq.h>
@@ -895,7 +896,7 @@ static void
 finish_pt_regs(struct pt_regs *regs, struct ia64_sal_os_state *sos,
                unsigned long *nat)
 {
-       const pal_min_state_area_t *ms = sos->pal_min_state;
+       const struct pal_min_state_area *ms = sos->pal_min_state;
        const u64 *bank;
 
        /* If ipsr.ic then use pmsa_{iip,ipsr,ifs}, else use
@@ -971,7 +972,7 @@ ia64_mca_modify_original_stack(struct pt_regs *regs,
        char *p;
        ia64_va va;
        extern char ia64_leave_kernel[];        /* Need asm address, not function descriptor */
-       const pal_min_state_area_t *ms = sos->pal_min_state;
+       const struct pal_min_state_area *ms = sos->pal_min_state;
        struct task_struct *previous_current;
        struct pt_regs *old_regs;
        struct switch_stack *old_sw;
index 4d0ab323dee8c7d65cb0db3a1adb1b186970cda6..36a69b4e61690a615d8f5f90e7beb6bcb511d7c4 100644 (file)
@@ -496,7 +496,7 @@ recover_from_read_error(slidx_table_t *slidx,
                        struct ia64_sal_os_state *sos)
 {
        u64 target_identifier;
-       pal_min_state_area_t *pmsa;
+       struct pal_min_state_area *pmsa;
        struct ia64_psr *psr1, *psr2;
        ia64_fptr_t *mca_hdlr_bh = (ia64_fptr_t*)mca_handler_bhhook;
 
diff --git a/arch/ia64/kernel/nr-irqs.c b/arch/ia64/kernel/nr-irqs.c
deleted file mode 100644 (file)
index f2633b2..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * calculate
- * NR_IRQS = max(IA64_NATIVE_NR_IRQS, XEN_NR_IRQS, FOO_NR_IRQS...)
- * depending on config.
- * This must be calculated before processing asm-offset.c.
- */
-
-#define ASM_OFFSETS_C 1
-
-#include <linux/kbuild.h>
-#include <linux/threads.h>
-#include <asm/native/irq.h>
-
-void foo(void)
-{
-       union paravirt_nr_irqs_max {
-               char ia64_native_nr_irqs[IA64_NATIVE_NR_IRQS];
-       };
-
-       DEFINE(NR_IRQS, sizeof (union paravirt_nr_irqs_max));
-}
index 813a58cba39ca129088cb0af87ac523605a4b9eb..bf4bda0f63eb6f98aa91989e080ece4dbd6988c1 100644 (file)
@@ -5,7 +5,7 @@ uapi := arch/$(SRCARCH)/include/generated/uapi/asm
 _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)')      \
          $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')
 
-syscall := $(srctree)/$(src)/syscall.tbl
+syscall := $(src)/syscall.tbl
 syshdr := $(srctree)/$(src)/syscallhdr.sh
 systbl := $(srctree)/$(src)/syscalltbl.sh
 
@@ -22,19 +22,20 @@ quiet_cmd_systbl = SYSTBL  $@
                   '$(systbl_offset_$(basetarget))'
 
 syshdr_offset_unistd_64 := __NR_Linux
-$(uapi)/unistd_64.h: $(syscall) $(syshdr)
+$(uapi)/unistd_64.h: $(syscall) $(syshdr) FORCE
        $(call if_changed,syshdr)
 
 systbl_offset_syscall_table := 1024
-$(kapi)/syscall_table.h: $(syscall) $(systbl)
+$(kapi)/syscall_table.h: $(syscall) $(systbl) FORCE
        $(call if_changed,systbl)
 
 uapisyshdr-y           += unistd_64.h
 kapisyshdr-y           += syscall_table.h
 
-targets        += $(uapisyshdr-y) $(kapisyshdr-y)
+uapisyshdr-y   := $(addprefix $(uapi)/, $(uapisyshdr-y))
+kapisyshdr-y   := $(addprefix $(kapi)/, $(kapisyshdr-y))
+targets                += $(addprefix ../../../../, $(uapisyshdr-y) $(kapisyshdr-y))
 
 PHONY += all
-all: $(addprefix $(uapi)/,$(uapisyshdr-y))
-all: $(addprefix $(kapi)/,$(kapisyshdr-y))
+all: $(uapisyshdr-y) $(kapisyshdr-y)
        @:
index 659faefdcb1da5f0ffbafc40fd598dd98d9a5fde..285aaba832d93936c3f2b7edb2938dbfe13fc21f 100644 (file)
@@ -5,7 +5,7 @@ uapi := arch/$(SRCARCH)/include/generated/uapi/asm
 _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)')      \
          $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')
 
-syscall := $(srctree)/$(src)/syscall.tbl
+syscall := $(src)/syscall.tbl
 syshdr := $(srctree)/$(src)/syscallhdr.sh
 systbl := $(srctree)/$(src)/syscalltbl.sh
 
@@ -21,18 +21,19 @@ quiet_cmd_systbl = SYSTBL  $@
                   '$(systbl_abi_$(basetarget))'                \
                   '$(systbl_offset_$(basetarget))'
 
-$(uapi)/unistd_32.h: $(syscall) $(syshdr)
+$(uapi)/unistd_32.h: $(syscall) $(syshdr) FORCE
        $(call if_changed,syshdr)
 
-$(kapi)/syscall_table.h: $(syscall) $(systbl)
+$(kapi)/syscall_table.h: $(syscall) $(systbl) FORCE
        $(call if_changed,systbl)
 
 uapisyshdr-y           += unistd_32.h
 kapisyshdr-y           += syscall_table.h
 
-targets        += $(uapisyshdr-y) $(kapisyshdr-y)
+uapisyshdr-y   := $(addprefix $(uapi)/, $(uapisyshdr-y))
+kapisyshdr-y   := $(addprefix $(kapi)/, $(kapisyshdr-y))
+targets                += $(addprefix ../../../../, $(uapisyshdr-y) $(kapisyshdr-y))
 
 PHONY += all
-all: $(addprefix $(uapi)/,$(uapisyshdr-y))
-all: $(addprefix $(kapi)/,$(kapisyshdr-y))
+all: $(uapisyshdr-y) $(kapisyshdr-y)
        @:
index 659faefdcb1da5f0ffbafc40fd598dd98d9a5fde..285aaba832d93936c3f2b7edb2938dbfe13fc21f 100644 (file)
@@ -5,7 +5,7 @@ uapi := arch/$(SRCARCH)/include/generated/uapi/asm
 _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)')      \
          $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')
 
-syscall := $(srctree)/$(src)/syscall.tbl
+syscall := $(src)/syscall.tbl
 syshdr := $(srctree)/$(src)/syscallhdr.sh
 systbl := $(srctree)/$(src)/syscalltbl.sh
 
@@ -21,18 +21,19 @@ quiet_cmd_systbl = SYSTBL  $@
                   '$(systbl_abi_$(basetarget))'                \
                   '$(systbl_offset_$(basetarget))'
 
-$(uapi)/unistd_32.h: $(syscall) $(syshdr)
+$(uapi)/unistd_32.h: $(syscall) $(syshdr) FORCE
        $(call if_changed,syshdr)
 
-$(kapi)/syscall_table.h: $(syscall) $(systbl)
+$(kapi)/syscall_table.h: $(syscall) $(systbl) FORCE
        $(call if_changed,systbl)
 
 uapisyshdr-y           += unistd_32.h
 kapisyshdr-y           += syscall_table.h
 
-targets        += $(uapisyshdr-y) $(kapisyshdr-y)
+uapisyshdr-y   := $(addprefix $(uapi)/, $(uapisyshdr-y))
+kapisyshdr-y   := $(addprefix $(kapi)/, $(kapisyshdr-y))
+targets                += $(addprefix ../../../../, $(uapisyshdr-y) $(kapisyshdr-y))
 
 PHONY += all
-all: $(addprefix $(uapi)/,$(uapisyshdr-y))
-all: $(addprefix $(kapi)/,$(kapisyshdr-y))
+all: $(uapisyshdr-y) $(kapisyshdr-y)
        @:
index a1ce8b7dbcfaf8c8b4ad3e8cec9d41a56d8b4a1f..51f8b805f2ed480777248cca4212d100529b2cdb 100644 (file)
@@ -5,9 +5,9 @@ uapi := arch/$(SRCARCH)/include/generated/uapi/asm
 _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)')      \
          $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')
 
-syscalln32 := $(srctree)/$(src)/syscall_n32.tbl
-syscalln64 := $(srctree)/$(src)/syscall_n64.tbl
-syscallo32 := $(srctree)/$(src)/syscall_o32.tbl
+syscalln32 := $(src)/syscall_n32.tbl
+syscalln64 := $(src)/syscall_n64.tbl
+syscallo32 := $(src)/syscall_o32.tbl
 syshdr := $(srctree)/$(src)/syscallhdr.sh
 sysnr := $(srctree)/$(src)/syscallnr.sh
 systbl := $(srctree)/$(src)/syscalltbl.sh
@@ -31,50 +31,50 @@ quiet_cmd_systbl = SYSTBL  $@
                   '$(systbl_offset_$(basetarget))'
 
 syshdr_offset_unistd_n32 := __NR_Linux
-$(uapi)/unistd_n32.h: $(syscalln32) $(syshdr)
+$(uapi)/unistd_n32.h: $(syscalln32) $(syshdr) FORCE
        $(call if_changed,syshdr)
 
 syshdr_offset_unistd_n64 := __NR_Linux
-$(uapi)/unistd_n64.h: $(syscalln64) $(syshdr)
+$(uapi)/unistd_n64.h: $(syscalln64) $(syshdr) FORCE
        $(call if_changed,syshdr)
 
 syshdr_offset_unistd_o32 := __NR_Linux
-$(uapi)/unistd_o32.h: $(syscallo32) $(syshdr)
+$(uapi)/unistd_o32.h: $(syscallo32) $(syshdr) FORCE
        $(call if_changed,syshdr)
 
 sysnr_pfx_unistd_nr_n32 := N32
 sysnr_offset_unistd_nr_n32 := 6000
-$(kapi)/unistd_nr_n32.h: $(syscalln32) $(sysnr)
+$(kapi)/unistd_nr_n32.h: $(syscalln32) $(sysnr) FORCE
        $(call if_changed,sysnr)
 
 sysnr_pfx_unistd_nr_n64 := 64
 sysnr_offset_unistd_nr_n64 := 5000
-$(kapi)/unistd_nr_n64.h: $(syscalln64) $(sysnr)
+$(kapi)/unistd_nr_n64.h: $(syscalln64) $(sysnr) FORCE
        $(call if_changed,sysnr)
 
 sysnr_pfx_unistd_nr_o32 := O32
 sysnr_offset_unistd_nr_o32 := 4000
-$(kapi)/unistd_nr_o32.h: $(syscallo32) $(sysnr)
+$(kapi)/unistd_nr_o32.h: $(syscallo32) $(sysnr) FORCE
        $(call if_changed,sysnr)
 
 systbl_abi_syscall_table_32_o32 := 32_o32
 systbl_offset_syscall_table_32_o32 := 4000
-$(kapi)/syscall_table_32_o32.h: $(syscallo32) $(systbl)
+$(kapi)/syscall_table_32_o32.h: $(syscallo32) $(systbl) FORCE
        $(call if_changed,systbl)
 
 systbl_abi_syscall_table_64_n32 := 64_n32
 systbl_offset_syscall_table_64_n32 := 6000
-$(kapi)/syscall_table_64_n32.h: $(syscalln32) $(systbl)
+$(kapi)/syscall_table_64_n32.h: $(syscalln32) $(systbl) FORCE
        $(call if_changed,systbl)
 
 systbl_abi_syscall_table_64_n64 := 64_n64
 systbl_offset_syscall_table_64_n64 := 5000
-$(kapi)/syscall_table_64_n64.h: $(syscalln64) $(systbl)
+$(kapi)/syscall_table_64_n64.h: $(syscalln64) $(systbl) FORCE
        $(call if_changed,systbl)
 
 systbl_abi_syscall_table_64_o32 := 64_o32
 systbl_offset_syscall_table_64_o32 := 4000
-$(kapi)/syscall_table_64_o32.h: $(syscallo32) $(systbl)
+$(kapi)/syscall_table_64_o32.h: $(syscallo32) $(systbl) FORCE
        $(call if_changed,systbl)
 
 uapisyshdr-y           += unistd_n32.h                 \
@@ -88,9 +88,10 @@ kapisyshdr-y         += syscall_table_32_o32.h       \
                           unistd_nr_n64.h              \
                           unistd_nr_o32.h
 
-targets        += $(uapisyshdr-y) $(kapisyshdr-y)
+uapisyshdr-y   := $(addprefix $(uapi)/, $(uapisyshdr-y))
+kapisyshdr-y   := $(addprefix $(kapi)/, $(kapisyshdr-y))
+targets                += $(addprefix ../../../../, $(uapisyshdr-y) $(kapisyshdr-y))
 
 PHONY += all
-all: $(addprefix $(uapi)/,$(uapisyshdr-y))
-all: $(addprefix $(kapi)/,$(kapisyshdr-y))
+all: $(uapisyshdr-y) $(kapisyshdr-y)
        @:
index e2354e128d9a05a2514b3ea28b790005bbda9348..3e660d6d3c2bd5b3f5dd511c08b86ea811b11777 100644 (file)
@@ -13,7 +13,7 @@ cflags-$(CONFIG_CPU_LOONGSON64)       += -Wa,--trap
 # can't easily be used safely within the kbuild framework.
 #
 ifeq ($(call cc-ifversion, -ge, 0409, y), y)
-  ifeq ($(call ld-ifversion, -ge, 225000000, y), y)
+  ifeq ($(call ld-ifversion, -ge, 22500, y), y)
     cflags-$(CONFIG_CPU_LOONGSON64)  += \
       $(call cc-option,-march=loongson3a -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64)
   else
index 7aec721398d59e4b5d271d98d7de0a9a43a4a039..a665f6108cb5a3c477fb0f2ce06e081c92055489 100644 (file)
@@ -12,7 +12,7 @@
 # the lack of relocations. As such, we disable the VDSO for microMIPS builds.
 
 config MIPS_LD_CAN_LINK_VDSO
-       def_bool LD_VERSION >= 225000000 || LD_IS_LLD
+       def_bool LD_VERSION >= 22500 || LD_IS_LLD
 
 config MIPS_DISABLE_VDSO
        def_bool CPU_MICROMIPS || (!CPU_MIPSR6 && !MIPS_LD_CAN_LINK_VDSO)
index c22a21c39f308429ccaaa7d3b1d29dc23010a1fb..283f64407b07a40944e842c44a15ed2629b85db9 100644 (file)
@@ -5,7 +5,7 @@ uapi := arch/$(SRCARCH)/include/generated/uapi/asm
 _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)')      \
          $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')
 
-syscall := $(srctree)/$(src)/syscall.tbl
+syscall := $(src)/syscall.tbl
 syshdr := $(srctree)/$(src)/syscallhdr.sh
 systbl := $(srctree)/$(src)/syscalltbl.sh
 
@@ -22,24 +22,24 @@ quiet_cmd_systbl = SYSTBL  $@
                   '$(systbl_offset_$(basetarget))'
 
 syshdr_abis_unistd_32 := common,32
-$(uapi)/unistd_32.h: $(syscall) $(syshdr)
+$(uapi)/unistd_32.h: $(syscall) $(syshdr) FORCE
        $(call if_changed,syshdr)
 
 syshdr_abis_unistd_64 := common,64
-$(uapi)/unistd_64.h: $(syscall) $(syshdr)
+$(uapi)/unistd_64.h: $(syscall) $(syshdr) FORCE
        $(call if_changed,syshdr)
 
 systbl_abis_syscall_table_32 := common,32
-$(kapi)/syscall_table_32.h: $(syscall) $(systbl)
+$(kapi)/syscall_table_32.h: $(syscall) $(systbl) FORCE
        $(call if_changed,systbl)
 
 systbl_abis_syscall_table_64 := common,64
-$(kapi)/syscall_table_64.h: $(syscall) $(systbl)
+$(kapi)/syscall_table_64.h: $(syscall) $(systbl) FORCE
        $(call if_changed,systbl)
 
 systbl_abis_syscall_table_c32 := common,32
 systbl_abi_syscall_table_c32 := c32
-$(kapi)/syscall_table_c32.h: $(syscall) $(systbl)
+$(kapi)/syscall_table_c32.h: $(syscall) $(systbl) FORCE
        $(call if_changed,systbl)
 
 uapisyshdr-y           += unistd_32.h unistd_64.h
@@ -47,9 +47,10 @@ kapisyshdr-y         += syscall_table_32.h           \
                           syscall_table_64.h           \
                           syscall_table_c32.h
 
-targets        += $(uapisyshdr-y) $(kapisyshdr-y)
+uapisyshdr-y   := $(addprefix $(uapi)/, $(uapisyshdr-y))
+kapisyshdr-y   := $(addprefix $(kapi)/, $(kapisyshdr-y))
+targets                += $(addprefix ../../../../, $(uapisyshdr-y) $(kapisyshdr-y))
 
 PHONY += all
-all: $(addprefix $(uapi)/,$(uapisyshdr-y))
-all: $(addprefix $(kapi)/,$(kapisyshdr-y))
+all: $(uapisyshdr-y) $(kapisyshdr-y)
        @:
index b959fdaec713968ee270c670cc3a889faf4b6b20..5f8544cf724a4fff9b2aed3f0f487e047fd8ee44 100644 (file)
@@ -65,7 +65,7 @@ UTS_MACHINE := $(subst $(space),,$(machine-y))
 ifdef CONFIG_PPC32
 KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o
 else
-ifeq ($(call ld-ifversion, -ge, 225000000, y),y)
+ifeq ($(call ld-ifversion, -ge, 22500, y),y)
 # Have the linker provide sfpr if possible.
 # There is a corresponding test in arch/powerpc/lib/Makefile
 KBUILD_LDFLAGS_MODULE += --save-restore-funcs
index 27b48954808dfc583c7af88184b99f04fd7659cf..9e3be295dbba26d2506603f36ff6c54769ce8973 100644 (file)
@@ -5,7 +5,7 @@ uapi := arch/$(SRCARCH)/include/generated/uapi/asm
 _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)')      \
          $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')
 
-syscall := $(srctree)/$(src)/syscall.tbl
+syscall := $(src)/syscall.tbl
 syshdr := $(srctree)/$(src)/syscallhdr.sh
 systbl := $(srctree)/$(src)/syscalltbl.sh
 
@@ -22,31 +22,31 @@ quiet_cmd_systbl = SYSTBL  $@
                   '$(systbl_offset_$(basetarget))'
 
 syshdr_abis_unistd_32 := common,nospu,32
-$(uapi)/unistd_32.h: $(syscall) $(syshdr)
+$(uapi)/unistd_32.h: $(syscall) $(syshdr) FORCE
        $(call if_changed,syshdr)
 
 syshdr_abis_unistd_64 := common,nospu,64
-$(uapi)/unistd_64.h: $(syscall) $(syshdr)
+$(uapi)/unistd_64.h: $(syscall) $(syshdr) FORCE
        $(call if_changed,syshdr)
 
 systbl_abis_syscall_table_32 := common,nospu,32
 systbl_abi_syscall_table_32 := 32
-$(kapi)/syscall_table_32.h: $(syscall) $(systbl)
+$(kapi)/syscall_table_32.h: $(syscall) $(systbl) FORCE
        $(call if_changed,systbl)
 
 systbl_abis_syscall_table_64 := common,nospu,64
 systbl_abi_syscall_table_64 := 64
-$(kapi)/syscall_table_64.h: $(syscall) $(systbl)
+$(kapi)/syscall_table_64.h: $(syscall) $(systbl) FORCE
        $(call if_changed,systbl)
 
 systbl_abis_syscall_table_c32 := common,nospu,32
 systbl_abi_syscall_table_c32 := c32
-$(kapi)/syscall_table_c32.h: $(syscall) $(systbl)
+$(kapi)/syscall_table_c32.h: $(syscall) $(systbl) FORCE
        $(call if_changed,systbl)
 
 systbl_abis_syscall_table_spu := common,spu
 systbl_abi_syscall_table_spu := spu
-$(kapi)/syscall_table_spu.h: $(syscall) $(systbl)
+$(kapi)/syscall_table_spu.h: $(syscall) $(systbl) FORCE
        $(call if_changed,systbl)
 
 uapisyshdr-y           += unistd_32.h unistd_64.h
@@ -55,9 +55,10 @@ kapisyshdr-y         += syscall_table_32.h           \
                           syscall_table_c32.h          \
                           syscall_table_spu.h
 
-targets        += $(uapisyshdr-y) $(kapisyshdr-y)
+uapisyshdr-y   := $(addprefix $(uapi)/, $(uapisyshdr-y))
+kapisyshdr-y   := $(addprefix $(kapi)/, $(kapisyshdr-y))
+targets                += $(addprefix ../../../../, $(uapisyshdr-y) $(kapisyshdr-y))
 
 PHONY += all
-all: $(addprefix $(uapi)/,$(uapisyshdr-y))
-all: $(addprefix $(kapi)/,$(kapisyshdr-y))
+all: $(uapisyshdr-y) $(kapisyshdr-y)
        @:
index 69a91b571845d7745bc3217629697f975c24e64c..d4efc182662a8cecf0b358fa844bd50c15570d76 100644 (file)
@@ -31,7 +31,7 @@ obj-$(CONFIG_FUNCTION_ERROR_INJECTION)        += error-inject.o
 # 64-bit linker creates .sfpr on demand for final link (vmlinux),
 # so it is only needed for modules, and only for older linkers which
 # do not support --save-restore-funcs
-ifeq ($(call ld-ifversion, -lt, 225000000, y),y)
+ifeq ($(call ld-ifversion, -lt, 22500, y),y)
 extra-$(CONFIG_PPC64)  += crtsavres.o
 endif
 
index 659faefdcb1da5f0ffbafc40fd598dd98d9a5fde..285aaba832d93936c3f2b7edb2938dbfe13fc21f 100644 (file)
@@ -5,7 +5,7 @@ uapi := arch/$(SRCARCH)/include/generated/uapi/asm
 _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)')      \
          $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')
 
-syscall := $(srctree)/$(src)/syscall.tbl
+syscall := $(src)/syscall.tbl
 syshdr := $(srctree)/$(src)/syscallhdr.sh
 systbl := $(srctree)/$(src)/syscalltbl.sh
 
@@ -21,18 +21,19 @@ quiet_cmd_systbl = SYSTBL  $@
                   '$(systbl_abi_$(basetarget))'                \
                   '$(systbl_offset_$(basetarget))'
 
-$(uapi)/unistd_32.h: $(syscall) $(syshdr)
+$(uapi)/unistd_32.h: $(syscall) $(syshdr) FORCE
        $(call if_changed,syshdr)
 
-$(kapi)/syscall_table.h: $(syscall) $(systbl)
+$(kapi)/syscall_table.h: $(syscall) $(systbl) FORCE
        $(call if_changed,systbl)
 
 uapisyshdr-y           += unistd_32.h
 kapisyshdr-y           += syscall_table.h
 
-targets        += $(uapisyshdr-y) $(kapisyshdr-y)
+uapisyshdr-y   := $(addprefix $(uapi)/, $(uapisyshdr-y))
+kapisyshdr-y   := $(addprefix $(kapi)/, $(kapisyshdr-y))
+targets                += $(addprefix ../../../../, $(uapisyshdr-y) $(kapisyshdr-y))
 
 PHONY += all
-all: $(addprefix $(uapi)/,$(uapisyshdr-y))
-all: $(addprefix $(kapi)/,$(kapisyshdr-y))
+all: $(uapisyshdr-y) $(kapisyshdr-y)
        @:
index c22a21c39f308429ccaaa7d3b1d29dc23010a1fb..283f64407b07a40944e842c44a15ed2629b85db9 100644 (file)
@@ -5,7 +5,7 @@ uapi := arch/$(SRCARCH)/include/generated/uapi/asm
 _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)')      \
          $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')
 
-syscall := $(srctree)/$(src)/syscall.tbl
+syscall := $(src)/syscall.tbl
 syshdr := $(srctree)/$(src)/syscallhdr.sh
 systbl := $(srctree)/$(src)/syscalltbl.sh
 
@@ -22,24 +22,24 @@ quiet_cmd_systbl = SYSTBL  $@
                   '$(systbl_offset_$(basetarget))'
 
 syshdr_abis_unistd_32 := common,32
-$(uapi)/unistd_32.h: $(syscall) $(syshdr)
+$(uapi)/unistd_32.h: $(syscall) $(syshdr) FORCE
        $(call if_changed,syshdr)
 
 syshdr_abis_unistd_64 := common,64
-$(uapi)/unistd_64.h: $(syscall) $(syshdr)
+$(uapi)/unistd_64.h: $(syscall) $(syshdr) FORCE
        $(call if_changed,syshdr)
 
 systbl_abis_syscall_table_32 := common,32
-$(kapi)/syscall_table_32.h: $(syscall) $(systbl)
+$(kapi)/syscall_table_32.h: $(syscall) $(systbl) FORCE
        $(call if_changed,systbl)
 
 systbl_abis_syscall_table_64 := common,64
-$(kapi)/syscall_table_64.h: $(syscall) $(systbl)
+$(kapi)/syscall_table_64.h: $(syscall) $(systbl) FORCE
        $(call if_changed,systbl)
 
 systbl_abis_syscall_table_c32 := common,32
 systbl_abi_syscall_table_c32 := c32
-$(kapi)/syscall_table_c32.h: $(syscall) $(systbl)
+$(kapi)/syscall_table_c32.h: $(syscall) $(systbl) FORCE
        $(call if_changed,systbl)
 
 uapisyshdr-y           += unistd_32.h unistd_64.h
@@ -47,9 +47,10 @@ kapisyshdr-y         += syscall_table_32.h           \
                           syscall_table_64.h           \
                           syscall_table_c32.h
 
-targets        += $(uapisyshdr-y) $(kapisyshdr-y)
+uapisyshdr-y   := $(addprefix $(uapi)/, $(uapisyshdr-y))
+kapisyshdr-y   := $(addprefix $(kapi)/, $(kapisyshdr-y))
+targets                += $(addprefix ../../../../, $(uapisyshdr-y) $(kapisyshdr-y))
 
 PHONY += all
-all: $(addprefix $(uapi)/,$(uapisyshdr-y))
-all: $(addprefix $(kapi)/,$(kapisyshdr-y))
+all: $(uapisyshdr-y) $(kapisyshdr-y)
        @:
index 6fb9b57ed5ba05dcc5247b26ee8b7b0575cf38e9..d8c4f6c9eadc070e1af04df4a358b3d8e7495a8d 100644 (file)
@@ -6,8 +6,8 @@ uapi := arch/$(SRCARCH)/include/generated/uapi/asm
 _dummy := $(shell [ -d '$(out)' ] || mkdir -p '$(out)') \
          $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)')
 
-syscall32 := $(srctree)/$(src)/syscall_32.tbl
-syscall64 := $(srctree)/$(src)/syscall_64.tbl
+syscall32 := $(src)/syscall_32.tbl
+syscall64 := $(src)/syscall_64.tbl
 
 syshdr := $(srctree)/$(src)/syscallhdr.sh
 systbl := $(srctree)/$(src)/syscalltbl.sh
@@ -21,37 +21,37 @@ quiet_cmd_systbl = SYSTBL  $@
       cmd_systbl = $(CONFIG_SHELL) '$(systbl)' $< $@
 
 quiet_cmd_hypercalls = HYPERCALLS $@
-      cmd_hypercalls = $(CONFIG_SHELL) '$<' $@ $(filter-out $<,$^)
+      cmd_hypercalls = $(CONFIG_SHELL) '$<' $@ $(filter-out $<, $(real-prereqs))
 
 syshdr_abi_unistd_32 := i386
-$(uapi)/unistd_32.h: $(syscall32) $(syshdr)
+$(uapi)/unistd_32.h: $(syscall32) $(syshdr) FORCE
        $(call if_changed,syshdr)
 
 syshdr_abi_unistd_32_ia32 := i386
 syshdr_pfx_unistd_32_ia32 := ia32_
-$(out)/unistd_32_ia32.h: $(syscall32) $(syshdr)
+$(out)/unistd_32_ia32.h: $(syscall32) $(syshdr) FORCE
        $(call if_changed,syshdr)
 
 syshdr_abi_unistd_x32 := common,x32
 syshdr_offset_unistd_x32 := __X32_SYSCALL_BIT
-$(uapi)/unistd_x32.h: $(syscall64) $(syshdr)
+$(uapi)/unistd_x32.h: $(syscall64) $(syshdr) FORCE
        $(call if_changed,syshdr)
 
 syshdr_abi_unistd_64 := common,64
-$(uapi)/unistd_64.h: $(syscall64) $(syshdr)
+$(uapi)/unistd_64.h: $(syscall64) $(syshdr) FORCE
        $(call if_changed,syshdr)
 
 syshdr_abi_unistd_64_x32 := x32
 syshdr_pfx_unistd_64_x32 := x32_
-$(out)/unistd_64_x32.h: $(syscall64) $(syshdr)
+$(out)/unistd_64_x32.h: $(syscall64) $(syshdr) FORCE
        $(call if_changed,syshdr)
 
-$(out)/syscalls_32.h: $(syscall32) $(systbl)
+$(out)/syscalls_32.h: $(syscall32) $(systbl) FORCE
        $(call if_changed,systbl)
-$(out)/syscalls_64.h: $(syscall64) $(systbl)
+$(out)/syscalls_64.h: $(syscall64) $(systbl) FORCE
        $(call if_changed,systbl)
 
-$(out)/xen-hypercalls.h: $(srctree)/scripts/xen-hypercalls.sh
+$(out)/xen-hypercalls.h: $(srctree)/scripts/xen-hypercalls.sh FORCE
        $(call if_changed,hypercalls)
 
 $(out)/xen-hypercalls.h: $(srctree)/include/xen/interface/xen*.h
@@ -62,9 +62,10 @@ syshdr-$(CONFIG_X86_64)              += unistd_32_ia32.h unistd_64_x32.h
 syshdr-$(CONFIG_X86_64)                += syscalls_64.h
 syshdr-$(CONFIG_XEN)           += xen-hypercalls.h
 
-targets        += $(uapisyshdr-y) $(syshdr-y)
+uapisyshdr-y   := $(addprefix $(uapi)/, $(uapisyshdr-y))
+syshdr-y       := $(addprefix $(out)/, $(syshdr-y))
+targets                += $(addprefix ../../../../, $(uapisyshdr-y) $(syshdr-y))
 
 PHONY += all
-all: $(addprefix $(uapi)/,$(uapisyshdr-y))
-all: $(addprefix $(out)/,$(syshdr-y))
+all: $(uapisyshdr-y) $(syshdr-y)
        @:
index 659faefdcb1da5f0ffbafc40fd598dd98d9a5fde..285aaba832d93936c3f2b7edb2938dbfe13fc21f 100644 (file)
@@ -5,7 +5,7 @@ uapi := arch/$(SRCARCH)/include/generated/uapi/asm
 _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)')      \
          $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')
 
-syscall := $(srctree)/$(src)/syscall.tbl
+syscall := $(src)/syscall.tbl
 syshdr := $(srctree)/$(src)/syscallhdr.sh
 systbl := $(srctree)/$(src)/syscalltbl.sh
 
@@ -21,18 +21,19 @@ quiet_cmd_systbl = SYSTBL  $@
                   '$(systbl_abi_$(basetarget))'                \
                   '$(systbl_offset_$(basetarget))'
 
-$(uapi)/unistd_32.h: $(syscall) $(syshdr)
+$(uapi)/unistd_32.h: $(syscall) $(syshdr) FORCE
        $(call if_changed,syshdr)
 
-$(kapi)/syscall_table.h: $(syscall) $(systbl)
+$(kapi)/syscall_table.h: $(syscall) $(systbl) FORCE
        $(call if_changed,systbl)
 
 uapisyshdr-y           += unistd_32.h
 kapisyshdr-y           += syscall_table.h
 
-targets        += $(uapisyshdr-y) $(kapisyshdr-y)
+uapisyshdr-y   := $(addprefix $(uapi)/, $(uapisyshdr-y))
+kapisyshdr-y   := $(addprefix $(kapi)/, $(kapisyshdr-y))
+targets                += $(addprefix ../../../../, $(uapisyshdr-y) $(kapisyshdr-y))
 
 PHONY += all
-all: $(addprefix $(uapi)/,$(uapisyshdr-y))
-all: $(addprefix $(kapi)/,$(kapisyshdr-y))
+all: $(uapisyshdr-y) $(kapisyshdr-y)
        @:
index 32bd1fdffffeca6f7b4a884e347778648fd3add2..2ae471518d9a3e8e9f01548dc0df8b9eba8c184e 100644 (file)
@@ -298,7 +298,7 @@ obj-$(CONFIG_DRM_I915_GVT_KVMGT) += gvt/kvmgt.o
 no-header-test := \
        display/intel_vbt_defs.h
 
-extra-$(CONFIG_DRM_I915_WERROR) += \
+always-$(CONFIG_DRM_I915_WERROR) += \
        $(patsubst %.h,%.hdrtest, $(filter-out $(no-header-test), \
                $(shell cd $(srctree)/$(src) && find * -name '*.h')))
 
index 2f2c352f301e452c9afe188242df4311cbbdd5e2..c568896cfb231c01c6939ee2140fdac21ce47cd4 100644 (file)
@@ -237,8 +237,8 @@ static void mlx5_set_driver_version(struct mlx5_core_dev *dev)
        remaining_size = max_t(int, 0, driver_ver_sz - strlen(string));
 
        snprintf(string + strlen(string), remaining_size, "%u.%u.%u",
-                (u8)((LINUX_VERSION_CODE >> 16) & 0xff), (u8)((LINUX_VERSION_CODE >> 8) & 0xff),
-                (u16)(LINUX_VERSION_CODE & 0xffff));
+               LINUX_VERSION_MAJOR, LINUX_VERSION_PATCHLEVEL,
+               LINUX_VERSION_SUBLEVEL);
 
        /*Send the command*/
        MLX5_SET(set_driver_version_in, in, opcode,
index ad5a0f405a75cd9c9a1cbb81ff071ec04281eef5..3f0381344221e20980dea3adad15a3d7c4933319 100644 (file)
@@ -111,8 +111,8 @@ DECLARE_WAIT_QUEUE_HEAD(usb_kill_urb_queue);
  */
 
 /*-------------------------------------------------------------------------*/
-#define KERNEL_REL     bin2bcd(((LINUX_VERSION_CODE >> 16) & 0x0ff))
-#define KERNEL_VER     bin2bcd(((LINUX_VERSION_CODE >> 8) & 0x0ff))
+#define KERNEL_REL     bin2bcd(LINUX_VERSION_MAJOR)
+#define KERNEL_VER     bin2bcd(LINUX_VERSION_PATCHLEVEL)
 
 /* usb 3.1 root hub device descriptor */
 static const u8 usb31_rh_dev_descriptor[18] = {
index bfd8e77788e29fe1c051b4f3f8ef14c772cb5dae..5c7dea5e0ff16dfde2a49d02964a3da0c9007768 100644 (file)
@@ -46,8 +46,8 @@
  *    - Make vid/did overridable
  *    - make it look like usb1 if usb1 mode forced
  */
-#define KERNEL_REL     bin2bcd(((LINUX_VERSION_CODE >> 16) & 0x0ff))
-#define KERNEL_VER     bin2bcd(((LINUX_VERSION_CODE >> 8) & 0x0ff))
+#define KERNEL_REL     bin2bcd(LINUX_VERSION_MAJOR)
+#define KERNEL_VER     bin2bcd(LINUX_VERSION_PATCHLEVEL)
 
 enum {
        AST_VHUB_STR_INDEX_MAX = 4,
index c54adce8f6f6ba99caa13c75d8161773d5122a5a..fbc0ca8d903b22478ca89c58fe0f58d7d4f2aaf6 100644 (file)
                /* DWARF 4 */                                           \
                .debug_types    0 : { *(.debug_types) }                 \
                /* DWARF 5 */                                           \
+               .debug_addr     0 : { *(.debug_addr) }                  \
+               .debug_line_str 0 : { *(.debug_line_str) }              \
+               .debug_loclists 0 : { *(.debug_loclists) }              \
                .debug_macro    0 : { *(.debug_macro) }                 \
-               .debug_addr     0 : { *(.debug_addr) }
+               .debug_names    0 : { *(.debug_names) }                 \
+               .debug_rnglists 0 : { *(.debug_rnglists) }              \
+               .debug_str_offsets      0 : { *(.debug_str_offsets) }
 
 /* Stabs debugging sections. */
 #define STABS_DEBUG                                                    \
index 98cff1b4b088c7ee3723a81b08f6b0d8272e5766..04c0a5a717f7eb638dd3413d26cd244aadba1116 100644 (file)
@@ -3,16 +3,6 @@
 #error "Please don't include <linux/compiler-clang.h> directly, include <linux/compiler.h> instead."
 #endif
 
-#define CLANG_VERSION (__clang_major__ * 10000 \
-                    + __clang_minor__ * 100    \
-                    + __clang_patchlevel__)
-
-#if CLANG_VERSION < 100001
-#ifndef __BPF_TRACING__
-# error Sorry, your version of Clang is too old - please use 10.0.1 or newer.
-#endif
-#endif
-
 /* Compiler specific definitions for Clang compiler */
 
 /* same as gcc, this was present in clang-2.6 so we can assume it works
index 555ab0fddbef7dc937a178e49621598736408c05..48750243db4c8e242baa71440e508d206a22c98c 100644 (file)
                     + __GNUC_MINOR__ * 100     \
                     + __GNUC_PATCHLEVEL__)
 
-/* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58145 */
-#if GCC_VERSION < 40900
-# error Sorry, your version of GCC is too old - please use 4.9 or newer.
-#elif defined(CONFIG_ARM64) && GCC_VERSION < 50100
-/*
- * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63293
- * https://lore.kernel.org/r/20210107111841.GN1551@shell.armlinux.org.uk
- */
-# error Sorry, your version of GCC is too old - please use 5.1 or newer.
-#endif
-
 /*
  * This macro obfuscates arithmetic on a variable address so that gcc
  * shouldn't recognize the original var, and make assumptions about it.
index 5646dad886e619f2c901b552adf49ad2039742f5..c71150f2c63906fe2046fcfd2578a6732770bc50 100644 (file)
@@ -575,8 +575,8 @@ static inline u16 get_default_bcdDevice(void)
 {
        u16 bcdDevice;
 
-       bcdDevice = bin2bcd((LINUX_VERSION_CODE >> 16 & 0xff)) << 8;
-       bcdDevice |= bin2bcd((LINUX_VERSION_CODE >> 8 & 0xff));
+       bcdDevice = bin2bcd(LINUX_VERSION_MAJOR) << 8;
+       bcdDevice |= bin2bcd(LINUX_VERSION_PATCHLEVEL);
        return bcdDevice;
 }
 
index 0bf5b340b80eff0c6abc273ced686993b2dabb98..719871f8727cf20ea29976198ce6ea19a62836ef 100644 (file)
@@ -26,30 +26,36 @@ config CC_VERSION_TEXT
            and then every file will be rebuilt.
 
 config CC_IS_GCC
-       def_bool $(success,echo "$(CC_VERSION_TEXT)" | grep -q gcc)
+       def_bool $(success,test "$(cc-name)" = GCC)
 
 config GCC_VERSION
        int
-       default $(shell,$(srctree)/scripts/gcc-version.sh $(CC)) if CC_IS_GCC
+       default $(cc-version) if CC_IS_GCC
        default 0
 
-config LD_VERSION
-       int
-       default $(shell,$(LD) --version | $(srctree)/scripts/ld-version.sh)
-
 config CC_IS_CLANG
-       def_bool $(success,echo "$(CC_VERSION_TEXT)" | grep -q clang)
-
-config LD_IS_LLD
-       def_bool $(success,$(LD) -v | head -n 1 | grep -q LLD)
+       def_bool $(success,test "$(cc-name)" = Clang)
 
 config CLANG_VERSION
        int
-       default $(shell,$(srctree)/scripts/clang-version.sh $(CC))
+       default $(cc-version) if CC_IS_CLANG
+       default 0
+
+config LD_IS_BFD
+       def_bool $(success,test "$(ld-name)" = BFD)
+
+config LD_VERSION
+       int
+       default $(ld-version) if LD_IS_BFD
+       default 0
+
+config LD_IS_LLD
+       def_bool $(success,test "$(ld-name)" = LLD)
 
 config LLD_VERSION
        int
-       default $(shell,$(srctree)/scripts/lld-version.sh $(LD))
+       default $(ld-version) if LD_IS_LLD
+       default 0
 
 config CC_CAN_LINK
        bool
index 8bb46e50f02d4f19da6f3303c1e7ad2e62b0da2e..b09fe21e88ff578007bcecc81d1ae012fabdf130 100644 (file)
@@ -1242,7 +1242,7 @@ static int override_release(char __user *release, size_t len)
                                break;
                        rest++;
                }
-               v = ((LINUX_VERSION_CODE >> 8) & 0xff) + 60;
+               v = LINUX_VERSION_PATCHLEVEL + 60;
                copy = clamp_t(size_t, len, 1, sizeof(buf));
                copy = scnprintf(buf, copy, "2.6.%u%s", v, rest);
                ret = copy_to_user(release, buf, copy + 1);
index 5ea0c1773b0ad698d92bab13d6adc12fc225e4b8..f9febffffc21aca928ec1d31ccab8dcb73411d85 100644 (file)
@@ -256,14 +256,51 @@ config DEBUG_INFO_SPLIT
          to know about the .dwo files and include them.
          Incompatible with older versions of ccache.
 
+choice
+       prompt "DWARF version"
+       help
+         Which version of DWARF debug info to emit.
+
+config DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
+       bool "Rely on the toolchain's implicit default DWARF version"
+       help
+         The implicit default version of DWARF debug info produced by a
+         toolchain changes over time.
+
+         This can break consumers of the debug info that haven't upgraded to
+         support newer revisions, and prevent testing newer versions, but
+         those should be less common scenarios.
+
+         If unsure, say Y.
+
 config DEBUG_INFO_DWARF4
-       bool "Generate dwarf4 debuginfo"
-       depends on $(cc-option,-gdwarf-4)
+       bool "Generate DWARF Version 4 debuginfo"
+       help
+         Generate DWARF v4 debug info. This requires gcc 4.5+ and gdb 7.0+.
+
+         If you have consumers of DWARF debug info that are not ready for
+         newer revisions of DWARF, you may wish to choose this or have your
+         config select this.
+
+config DEBUG_INFO_DWARF5
+       bool "Generate DWARF Version 5 debuginfo"
+       depends on GCC_VERSION >= 50000 || CC_IS_CLANG
+       depends on CC_IS_GCC || $(success,$(srctree)/scripts/test_dwarf5_support.sh $(CC) $(CLANG_FLAGS))
+       depends on !DEBUG_INFO_BTF
        help
-         Generate dwarf4 debug info. This requires recent versions
-         of gcc and gdb. It makes the debug information larger.
-         But it significantly improves the success of resolving
-         variables in gdb on optimized code.
+         Generate DWARF v5 debug info. Requires binutils 2.35.2, gcc 5.0+ (gcc
+         5.0+ accepts the -gdwarf-5 flag but only had partial support for some
+         draft features until 7.0), and gdb 8.0+.
+
+         Changes to the structure of debug info in Version 5 allow for around
+         15-18% savings in resulting image and debug info section sizes as
+         compared to DWARF Version 4. DWARF Version 5 standardizes previous
+         extensions such as accelerators for symbol indexing and the format
+         for fission (.dwo/.dwp) files. Users may not want to select this
+         config if they rely on tooling that has not yet been updated to
+         support DWARF Version 5.
+
+endchoice # "DWARF version"
 
 config DEBUG_INFO_BTF
        bool "Generate BTF typeinfo"
index 08e011175b4c879852a2cc203ea0b2ccf4ce8cfc..509e0856d6533c2c3864d2b89c895a87100459f7 100644 (file)
@@ -141,13 +141,9 @@ cc-ifversion = $(shell [ $(CONFIG_GCC_VERSION)0 $(1) $(2)000 ] && echo $(3) || e
 # Usage: KBUILD_LDFLAGS += $(call ld-option, -X, -Y)
 ld-option = $(call try-run, $(LD) $(KBUILD_LDFLAGS) $(1) -v,$(1),$(2),$(3))
 
-# ld-version
-# Note this is mainly for HJ Lu's 3 number binutil versions
-ld-version = $(shell $(LD) --version | $(srctree)/scripts/ld-version.sh)
-
 # ld-ifversion
 # Usage:  $(call ld-ifversion, -ge, 22252, y)
-ld-ifversion = $(shell [ $(ld-version) $(1) $(2) ] && echo $(3) || echo $(4))
+ld-ifversion = $(shell [ $(CONFIG_LD_VERSION)0 $(1) $(2)0 ] && echo $(3) || echo $(4))
 
 ######
 
index a5fe72c504ffb86fc31368927b29dd4bfc434b22..58fdb5308725cf615045120c27278d62c0e2be28 100644 (file)
@@ -39,8 +39,17 @@ as-instr = $(success,printf "%b\n" "$(1)" | $(CC) $(CLANG_FLAGS) -c -x assembler
 $(error-if,$(failure,command -v $(CC)),compiler '$(CC)' not found)
 $(error-if,$(failure,command -v $(LD)),linker '$(LD)' not found)
 
-# Fail if the linker is gold as it's not capable of linking the kernel proper
-$(error-if,$(success, $(LD) -v | grep -q gold), gold linker '$(LD)' not supported)
+# Get the compiler name, version, and error out if it is not supported.
+cc-info := $(shell,$(srctree)/scripts/cc-version.sh $(CC))
+$(error-if,$(success,test -z "$(cc-info)"),Sorry$(comma) this compiler is not supported.)
+cc-name := $(shell,set -- $(cc-info) && echo $1)
+cc-version := $(shell,set -- $(cc-info) && echo $2)
+
+# Get the linker name, version, and error out if it is not supported.
+ld-info := $(shell,$(srctree)/scripts/ld-version.sh $(LD))
+$(error-if,$(success,test -z "$(ld-info)"),Sorry$(comma) this linker is not supported.)
+ld-name := $(shell,set -- $(ld-info) && echo $1)
+ld-version := $(shell,set -- $(ld-info) && echo $2)
 
 # machine bit flags
 #  $(m32-flag): -m32 if the compiler supports it, or an empty string otherwise.
index 3f6bf0ea7c0eb28e490610e7d06921eb81f0260a..1b6094a130346e074aff28d26c82bad2be1f3339 100644 (file)
@@ -15,7 +15,6 @@ obj-y :=
 obj-m :=
 lib-y :=
 lib-m :=
-always :=
 always-y :=
 always-m :=
 targets :=
index d9e0ceace6a64f35cdfe2819a591b6149edd3d38..22a8172bce1f727fcdad131760cb69ffe058d4c2 100644 (file)
@@ -34,9 +34,6 @@ __clean-files := \
        $(hostprogs-always-y) $(hostprogs-always-m) $(hostprogs-always-) \
        $(userprogs-always-y) $(userprogs-always-m) $(userprogs-always-)
 
-# deprecated
-__clean-files  += $(always) $(hostprogs-y) $(hostprogs-m) $(hostprogs-)
-
 __clean-files   := $(filter-out $(no-clean-files), $(__clean-files))
 
 # clean-files is given relative to the current directory, unless it
index 9f2531567c0e200860a7e008d1cb1cdf7cd9ce58..eee59184de640ab94e7d0f5512a5286f0839f11f 100644 (file)
@@ -4,18 +4,6 @@ asflags-y  += $(EXTRA_AFLAGS)
 ccflags-y  += $(EXTRA_CFLAGS)
 cppflags-y += $(EXTRA_CPPFLAGS)
 ldflags-y  += $(EXTRA_LDFLAGS)
-ifneq ($(always),)
-$(warning 'always' is deprecated. Please use 'always-y' instead)
-always-y   += $(always)
-endif
-ifneq ($(hostprogs-y),)
-$(warning 'hostprogs-y' is deprecated. Please use 'hostprogs' instead)
-hostprogs  += $(hostprogs-y)
-endif
-ifneq ($(hostprogs-m),)
-$(warning 'hostprogs-m' is deprecated. Please use 'hostprogs' instead)
-hostprogs  += $(hostprogs-m)
-endif
 
 # flags that take effect in current and sub directories
 KBUILD_AFLAGS += $(subdir-asflags-y)
@@ -56,15 +44,19 @@ else
 obj-y          := $(filter-out %/, $(obj-y))
 endif
 
+# Expand $(foo-objs) $(foo-y) by calling $(call suffix-search,foo.o,-objs -y)
+suffix-search = $(foreach s,$(2),$($(1:.o=$s)))
 # If $(foo-objs), $(foo-y), $(foo-m), or $(foo-) exists, foo.o is a composite object
-multi-used-y := $(sort $(foreach m,$(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-))), $(m))))
-multi-used-m := $(sort $(foreach m,$(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)) $($(m:.o=-))), $(m))))
+multi-search = $(sort $(foreach m,$(1), $(if $(strip $(call suffix-search,$(m),$(2) -)), $(m))))
+multi-used-y := $(call multi-search,$(obj-y),-objs -y)
+multi-used-m := $(call multi-search,$(obj-m),-objs -y -m)
 multi-used   := $(multi-used-y) $(multi-used-m)
 
 # Replace multi-part objects by their individual parts,
 # including built-in.a from subdirectories
-real-obj-y := $(foreach m, $(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m)))
-real-obj-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)) $($(m:.o=-))),$($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)),$(m)))
+real-search = $(foreach m,$(1), $(if $(strip $(call suffix-search,$(m),$(2) -)),$(call suffix-search,$(m),$(2)),$(m)))
+real-obj-y := $(call real-search, $(obj-y),-objs -y)
+real-obj-m := $(call real-search, $(obj-m),-objs -y -m)
 
 always-y += $(always-m)
 
@@ -81,14 +73,14 @@ always-y += $(userprogs-always-y) $(userprogs-always-m)
 
 # DTB
 # If CONFIG_OF_ALL_DTBS is enabled, all DT blobs are built
-extra-y                                += $(dtb-y)
-extra-$(CONFIG_OF_ALL_DTBS)    += $(dtb-)
+always-y                       += $(dtb-y)
+always-$(CONFIG_OF_ALL_DTBS)   += $(dtb-)
 
 ifneq ($(CHECK_DTBS),)
-extra-y += $(patsubst %.dtb,%.dt.yaml, $(dtb-y))
-extra-y += $(patsubst %.dtbo,%.dt.yaml, $(dtb-y))
-extra-$(CONFIG_OF_ALL_DTBS) += $(patsubst %.dtb,%.dt.yaml, $(dtb-))
-extra-$(CONFIG_OF_ALL_DTBS) += $(patsubst %.dtbo,%.dt.yaml, $(dtb-))
+always-y += $(patsubst %.dtb,%.dt.yaml, $(dtb-y))
+always-y += $(patsubst %.dtbo,%.dt.yaml, $(dtb-y))
+always-$(CONFIG_OF_ALL_DTBS) += $(patsubst %.dtb,%.dt.yaml, $(dtb-))
+always-$(CONFIG_OF_ALL_DTBS) += $(patsubst %.dtbo,%.dt.yaml, $(dtb-))
 endif
 
 # Add subdir path
@@ -263,7 +255,7 @@ $(obj)/%: $(src)/%_shipped
 #      target: source(s) FORCE
 #              $(if_changed,ld/objcopy/gzip)
 #
-#      and add target to extra-y so that we know we have to
+#      and add target to 'targets' so that we know we have to
 #      read in the saved command line
 
 # Linking
diff --git a/scripts/cc-version.sh b/scripts/cc-version.sh
new file mode 100755 (executable)
index 0000000..3f2ee88
--- /dev/null
@@ -0,0 +1,82 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
+#
+# Print the compiler name and its version in a 5 or 6-digit form.
+# Also, perform the minimum version check.
+
+set -e
+
+# When you raise the minimum compiler version, please update
+# Documentation/process/changes.rst as well.
+gcc_min_version=4.9.0
+clang_min_version=10.0.1
+icc_min_version=16.0.3 # temporary
+
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63293
+# https://lore.kernel.org/r/20210107111841.GN1551@shell.armlinux.org.uk
+if [ "$SRCARCH" = arm64 ]; then
+       gcc_min_version=5.1.0
+fi
+
+# Print the compiler name and some version components.
+get_compiler_info()
+{
+       cat <<- EOF | "$@" -E -P -x c - 2>/dev/null
+       #if defined(__clang__)
+       Clang   __clang_major__  __clang_minor__  __clang_patchlevel__
+       #elif defined(__INTEL_COMPILER)
+       ICC     __INTEL_COMPILER  __INTEL_COMPILER_UPDATE
+       #elif defined(__GNUC__)
+       GCC     __GNUC__  __GNUC_MINOR__  __GNUC_PATCHLEVEL__
+       #else
+       unknown
+       #endif
+       EOF
+}
+
+# Convert the version string x.y.z to a canonical 5 or 6-digit form.
+get_canonical_version()
+{
+       IFS=.
+       set -- $1
+       echo $((10000 * $1 + 100 * $2 + $3))
+}
+
+# $@ instead of $1 because multiple words might be given, e.g. CC="ccache gcc".
+orig_args="$@"
+set -- $(get_compiler_info "$@")
+
+name=$1
+
+case "$name" in
+GCC)
+       version=$2.$3.$4
+       min_version=$gcc_min_version
+       ;;
+Clang)
+       version=$2.$3.$4
+       min_version=$clang_min_version
+       ;;
+ICC)
+       version=$(($2 / 100)).$(($2 % 100)).$3
+       min_version=$icc_min_version
+       ;;
+*)
+       echo "$orig_args: unknown compiler" >&2
+       exit 1
+       ;;
+esac
+
+cversion=$(get_canonical_version $version)
+min_cversion=$(get_canonical_version $min_version)
+
+if [ "$cversion" -lt "$min_cversion" ]; then
+       echo >&2 "***"
+       echo >&2 "*** Compiler is too old."
+       echo >&2 "***   Your $name version:    $version"
+       echo >&2 "***   Minimum $name version: $min_version"
+       echo >&2 "***"
+       exit 1
+fi
+
+echo $name $cversion
index 8ddb5d099029f717d9b3732f76d123c2a2315be5..b7e9ecf16e5699cd158f91b7b0fd898d0d5901b2 100755 (executable)
@@ -20,7 +20,9 @@ _DEFAULT_LOG_LEVEL = 'WARNING'
 _FILENAME_PATTERN = r'^\..*\.cmd$'
 _LINE_PATTERN = r'^cmd_[^ ]*\.o := (.* )([^ ]*\.c)$'
 _VALID_LOG_LEVELS = ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']
-
+# The tools/ directory adopts a different build system, and produces .cmd
+# files in a different format. Do not support it.
+_EXCLUDE_DIRS = ['.git', 'Documentation', 'include', 'tools']
 
 def parse_arguments():
     """Sets up and parses command-line arguments.
@@ -80,8 +82,14 @@ def cmdfiles_in_dir(directory):
     """
 
     filename_matcher = re.compile(_FILENAME_PATTERN)
+    exclude_dirs = [ os.path.join(directory, d) for d in _EXCLUDE_DIRS ]
+
+    for dirpath, dirnames, filenames in os.walk(directory, topdown=True):
+        # Prune unwanted directories.
+        if dirpath in exclude_dirs:
+            dirnames[:] = []
+            continue
 
-    for dirpath, _, filenames in os.walk(directory):
         for filename in filenames:
             if filename_matcher.match(filename):
                 yield os.path.join(dirpath, filename)
diff --git a/scripts/clang-version.sh b/scripts/clang-version.sh
deleted file mode 100755 (executable)
index 6fabf06..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-# SPDX-License-Identifier: GPL-2.0
-#
-# clang-version clang-command
-#
-# Print the compiler version of `clang-command' in a 5 or 6-digit form
-# such as `50001' for clang-5.0.1 etc.
-
-compiler="$*"
-
-if ! ( $compiler --version | grep -q clang) ; then
-       echo 0
-       exit 1
-fi
-
-MAJOR=$(echo __clang_major__ | $compiler -E -x c - | tail -n 1)
-MINOR=$(echo __clang_minor__ | $compiler -E -x c - | tail -n 1)
-PATCHLEVEL=$(echo __clang_patchlevel__ | $compiler -E -x c - | tail -n 1)
-printf "%d%02d%02d\\n" $MAJOR $MINOR $PATCHLEVEL
diff --git a/scripts/gcc-version.sh b/scripts/gcc-version.sh
deleted file mode 100755 (executable)
index ae35343..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-# SPDX-License-Identifier: GPL-2.0
-#
-# gcc-version gcc-command
-#
-# Print the gcc version of `gcc-command' in a 5 or 6-digit form
-# such as `29503' for gcc-2.95.3, `30301' for gcc-3.3.1, etc.
-
-compiler="$*"
-
-if [ ${#compiler} -eq 0 ]; then
-       echo "Error: No compiler specified." >&2
-       printf "Usage:\n\t$0 <gcc-command>\n" >&2
-       exit 1
-fi
-
-MAJOR=$(echo __GNUC__ | $compiler -E -x c - | tail -n 1)
-MINOR=$(echo __GNUC_MINOR__ | $compiler -E -x c - | tail -n 1)
-PATCHLEVEL=$(echo __GNUC_PATCHLEVEL__ | $compiler -E -x c - | tail -n 1)
-printf "%d%02d%02d\\n" $MAJOR $MINOR $PATCHLEVEL
index 12475508751082064b823da637853a9d10797647..48941faa6ea696a77fe2e54dfda43d9a8ac885cc 100644 (file)
@@ -7,7 +7,7 @@ symlinks := $(patsubst $(srctree)/$(src)/%,%,$(wildcard $(srctree)/$(src)/*.py))
 quiet_cmd_symlink = SYMLINK $@
       cmd_symlink = ln -fsn $(patsubst $(obj)/%,$(abspath $(srctree))/$(src)/%,$@) $@
 
-extra-y += $(symlinks)
+always-y += $(symlinks)
 $(addprefix $(obj)/, $(symlinks)): FORCE
        $(call if_changed,symlink)
 
@@ -18,7 +18,7 @@ quiet_cmd_gen_constants_py = GEN     $@
        $(CPP) -E -x c -P $(c_flags) $< > $@ ;\
        sed -i '1,/<!-- end-c-headers -->/d;' $@
 
-extra-y += constants.py
+always-y += constants.py
 $(obj)/constants.py: $(src)/constants.py.in FORCE
        $(call if_changed_dep,gen_constants_py)
 
index 23eff234184f381323ff0eb7dc93d0c4d4913e56..4827c5abe5b71fe6fb859eaebcd7d734dbec3bb3 100644 (file)
@@ -29,7 +29,7 @@ static struct symbol *symtab[HASH_BUCKETS];
 static FILE *debugfile;
 
 int cur_line = 1;
-char *cur_filename, *source_file;
+char *cur_filename;
 int in_source_file;
 
 static int flag_debug, flag_dump_defs, flag_reference, flag_dump_types,
index 2bcdb9bebab406666130da1bf551ede294926740..21ed2ec2d98ca8cdc6fe7bf28000d5d5fc7bf528 100644 (file)
@@ -47,7 +47,7 @@ typedef struct string_list **yystype;
 #define YYSTYPE yystype
 
 extern int cur_line;
-extern char *cur_filename, *source_file;
+extern char *cur_filename;
 extern int in_source_file;
 
 struct symbol *find_symbol(const char *name, enum symbol_type ns, int exact);
index ae76472efc43adb691887fb52b95a3185f62a01d..a4d7495eaf75ee26e1ef7c54ac2aab98199ff91d 100644 (file)
@@ -119,12 +119,11 @@ yylex(void)
   static enum {
     ST_NOTSTARTED, ST_NORMAL, ST_ATTRIBUTE, ST_ASM, ST_TYPEOF, ST_TYPEOF_1,
     ST_BRACKET, ST_BRACE, ST_EXPRESSION, ST_STATIC_ASSERT,
-    ST_TABLE_1, ST_TABLE_2, ST_TABLE_3, ST_TABLE_4,
-    ST_TABLE_5, ST_TABLE_6
   } lexstate = ST_NOTSTARTED;
 
   static int suppress_type_lookup, dont_want_brace_phrase;
   static struct string_list *next_node;
+  static char *source_file;
 
   int token, count = 0;
   struct string_list *cur_node;
@@ -235,7 +234,6 @@ repeat:
          lexstate = ST_EXPRESSION;
          break;
 
-       case DOTS:
        default:
          APP;
          break;
@@ -426,58 +424,6 @@ repeat:
        }
       break;
 
-    case ST_TABLE_1:
-      goto repeat;
-
-    case ST_TABLE_2:
-      if (token == IDENT && yyleng == 1 && yytext[0] == 'X')
-       {
-         token = EXPORT_SYMBOL_KEYW;
-         lexstate = ST_TABLE_5;
-         APP;
-         break;
-       }
-      lexstate = ST_TABLE_6;
-      /* FALLTHRU */
-
-    case ST_TABLE_6:
-      switch (token)
-       {
-       case '{': case '[': case '(':
-         ++count;
-         break;
-       case '}': case ']': case ')':
-         --count;
-         break;
-       case ',':
-         if (count == 0)
-           lexstate = ST_TABLE_2;
-         break;
-       };
-      goto repeat;
-
-    case ST_TABLE_3:
-      goto repeat;
-
-    case ST_TABLE_4:
-      if (token == ';')
-       lexstate = ST_NORMAL;
-      goto repeat;
-
-    case ST_TABLE_5:
-      switch (token)
-       {
-       case ',':
-         token = ';';
-         lexstate = ST_TABLE_2;
-         APP;
-         break;
-       default:
-         APP;
-         break;
-       }
-      break;
-
     default:
       exit(1);
     }
index 2c40e68853dde8adae1c921912172bb357c2ba48..8c19b82c603521753eb859fce5dd08e26723cd8d 100644 (file)
@@ -3,9 +3,6 @@
 # Kernel configuration targets
 # These targets are used from top-level makefile
 
-PHONY += xconfig gconfig menuconfig config localmodconfig localyesconfig \
-       build_menuconfig build_nconfig build_gconfig build_xconfig
-
 ifdef KBUILD_KCONFIG
 Kconfig := $(KBUILD_KCONFIG)
 else
@@ -19,29 +16,24 @@ endif
 # We need this, in case the user has it in its environment
 unexport CONFIG_
 
-xconfig: $(obj)/qconf
-       $(Q)$< $(silent) $(Kconfig)
-
-gconfig: $(obj)/gconf
-       $(Q)$< $(silent) $(Kconfig)
-
-menuconfig: $(obj)/mconf
-       $(Q)$< $(silent) $(Kconfig)
-
-config: $(obj)/conf
-       $(Q)$< $(silent) --oldaskconfig $(Kconfig)
-
-nconfig: $(obj)/nconf
-       $(Q)$< $(silent) $(Kconfig)
-
-build_menuconfig: $(obj)/mconf
+config-prog    := conf
+menuconfig-prog        := mconf
+nconfig-prog   := nconf
+gconfig-prog   := gconf
+xconfig-prog   := qconf
 
-build_nconfig: $(obj)/nconf
+define config_rule
+PHONY += $(1)
+$(1): $(obj)/$($(1)-prog)
+       $(Q)$$< $(silent) $(Kconfig)
 
-build_gconfig: $(obj)/gconf
+PHONY += build_$(1)
+build_$(1): $(obj)/$($(1)-prog)
+endef
 
-build_xconfig: $(obj)/qconf
+$(foreach c, config menuconfig nconfig gconfig xconfig, $(eval $(call config_rule,$(c))))
 
+PHONY += localmodconfig localyesconfig
 localyesconfig localmodconfig: $(obj)/conf
        $(Q)$(PERL) $(srctree)/$(src)/streamline_config.pl --$@ $(srctree) $(Kconfig) > .tmp.config
        $(Q)if [ -f .config ]; then                             \
index db03e2f45de4202496f466b8ad5b9418690de09f..957d2a0832f73b24957c7fba6c6f46a8292230c9 100644 (file)
@@ -84,8 +84,6 @@ static void xfgets(char *str, int size, FILE *in)
 
 static int conf_askvalue(struct symbol *sym, const char *def)
 {
-       enum symbol_type type = sym_get_type(sym);
-
        if (!sym_has_value(sym))
                printf("(NEW) ");
 
@@ -107,24 +105,12 @@ static int conf_askvalue(struct symbol *sym, const char *def)
                        return 0;
                }
                /* fall through */
-       case oldaskconfig:
+       default:
                fflush(stdout);
                xfgets(line, sizeof(line), stdin);
-               return 1;
-       default:
                break;
        }
 
-       switch (type) {
-       case S_INT:
-       case S_HEX:
-       case S_STRING:
-               printf("%s\n", def);
-               return 1;
-       default:
-               ;
-       }
-       printf("%s", line);
        return 1;
 }
 
@@ -137,7 +123,7 @@ static int conf_string(struct menu *menu)
                printf("%*s%s ", indent - 1, "", menu->prompt->text);
                printf("(%s) ", sym->name);
                def = sym_get_string_value(sym);
-               if (sym_get_string_value(sym))
+               if (def)
                        printf("[%s] ", def);
                if (!conf_askvalue(sym, def))
                        return 0;
@@ -419,34 +405,37 @@ static void check_conf(struct menu *menu)
                return;
 
        sym = menu->sym;
-       if (sym && !sym_has_value(sym)) {
-               if (sym_is_changeable(sym) ||
-                   (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)) {
-                       if (input_mode == listnewconfig) {
-                               if (sym->name) {
-                                       const char *str;
-
-                                       if (sym->type == S_STRING) {
-                                               str = sym_get_string_value(sym);
-                                               str = sym_escape_string_value(str);
-                                               printf("%s%s=%s\n", CONFIG_, sym->name, str);
-                                               free((void *)str);
-                                       } else {
-                                               str = sym_get_string_value(sym);
-                                               printf("%s%s=%s\n", CONFIG_, sym->name, str);
-                                       }
-                               }
-                       } else if (input_mode == helpnewconfig) {
-                               printf("-----\n");
-                               print_help(menu);
-                               printf("-----\n");
+       if (sym && !sym_has_value(sym) &&
+           (sym_is_changeable(sym) ||
+            (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes))) {
 
-                       } else {
-                               if (!conf_cnt++)
-                                       printf("*\n* Restart config...\n*\n");
-                               rootEntry = menu_get_parent_menu(menu);
-                               conf(rootEntry);
+               switch (input_mode) {
+               case listnewconfig:
+                       if (sym->name) {
+                               const char *str;
+
+                               if (sym->type == S_STRING) {
+                                       str = sym_get_string_value(sym);
+                                       str = sym_escape_string_value(str);
+                                       printf("%s%s=%s\n", CONFIG_, sym->name, str);
+                                       free((void *)str);
+                               } else {
+                                       str = sym_get_string_value(sym);
+                                       printf("%s%s=%s\n", CONFIG_, sym->name, str);
+                               }
                        }
+                       break;
+               case helpnewconfig:
+                       printf("-----\n");
+                       print_help(menu);
+                       printf("-----\n");
+                       break;
+               default:
+                       if (!conf_cnt++)
+                               printf("*\n* Restart config...\n*\n");
+                       rootEntry = menu_get_parent_menu(menu);
+                       conf(rootEntry);
+                       break;
                }
        }
 
@@ -494,6 +483,7 @@ static void conf_usage(const char *progname)
        printf("  --randconfig            New config with random answer to all options\n");
        printf("  --yes2modconfig         Change answers from yes to mod if possible\n");
        printf("  --mod2yesconfig         Change answers from mod to yes if possible\n");
+       printf("  (If none of the above is given, --oldaskconfig is the default)\n");
 }
 
 int main(int ac, char **av)
@@ -505,7 +495,7 @@ int main(int ac, char **av)
 
        tty_stdio = isatty(0) && isatty(1);
 
-       while ((opt = getopt_long(ac, av, "s", long_opts, NULL)) != -1) {
+       while ((opt = getopt_long(ac, av, "hs", long_opts, NULL)) != -1) {
                if (opt == 's') {
                        conf_set_message_callback(NULL);
                        continue;
@@ -561,7 +551,7 @@ int main(int ac, char **av)
                case yes2modconfig:
                case mod2yesconfig:
                        break;
-               case '?':
+               case 'h':
                        conf_usage(progname);
                        exit(1);
                        break;
index f2be0ff9a738aca75c014c80b7535833d1eeb1a1..a463273509b56bfce6157fc47e16b014971c3086 100755 (executable)
@@ -1,11 +1,73 @@
-#!/usr/bin/awk -f
+#!/bin/sh
 # SPDX-License-Identifier: GPL-2.0
-# extract linker version number from stdin and turn into single number
-       {
-       gsub(".*\\)", "");
-       gsub(".*version ", "");
-       gsub("-.*", "");
-       split($1,a, ".");
-       print a[1]*100000000 + a[2]*1000000 + a[3]*10000;
-       exit
-       }
+#
+# Print the linker name and its version in a 5 or 6-digit form.
+# Also, perform the minimum version check.
+
+set -e
+
+# When you raise the minimum linker version, please update
+# Documentation/process/changes.rst as well.
+bfd_min_version=2.23.0
+lld_min_version=10.0.1
+
+# Convert the version string x.y.z to a canonical 5 or 6-digit form.
+get_canonical_version()
+{
+       IFS=.
+       set -- $1
+
+       # If the 2nd or 3rd field is missing, fill it with a zero.
+       #
+       # The 4th field, if present, is ignored.
+       # This occurs in development snapshots as in 2.35.1.20201116
+       echo $((10000 * $1 + 100 * ${2:-0} + ${3:-0}))
+}
+
+orig_args="$@"
+
+# Get the first line of the --version output.
+IFS='
+'
+set -- $("$@" --version)
+
+# Split the line on spaces.
+IFS=' '
+set -- $1
+
+if [ "$1" = GNU -a "$2" = ld ]; then
+       shift $(($# - 1))
+       version=$1
+       min_version=$bfd_min_version
+       name=BFD
+       disp_name="GNU ld"
+elif [ "$1" = GNU -a "$2" = gold ]; then
+       echo "gold linker is not supported as it is not capable of linking the kernel proper." >&2
+       exit 1
+elif [ "$1" = LLD ]; then
+       version=$2
+       min_version=$lld_min_version
+       name=LLD
+       disp_name=LLD
+else
+       echo "$orig_args: unknown linker" >&2
+       exit 1
+fi
+
+# Some distributions append a package release number, as in 2.34-4.fc32
+# Trim the hyphen and any characters that follow.
+version=${version%-*}
+
+cversion=$(get_canonical_version $version)
+min_cversion=$(get_canonical_version $min_version)
+
+if [ "$cversion" -lt "$min_cversion" ]; then
+       echo >&2 "***"
+       echo >&2 "*** Linker is too old."
+       echo >&2 "***   Your $disp_name version:    $version"
+       echo >&2 "***   Minimum $disp_name version: $min_version"
+       echo >&2 "***"
+       exit 1
+fi
+
+echo $name $cversion
diff --git a/scripts/lld-version.sh b/scripts/lld-version.sh
deleted file mode 100755 (executable)
index d70edb4..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-# SPDX-License-Identifier: GPL-2.0
-#
-# Usage: $ ./scripts/lld-version.sh ld.lld
-#
-# Print the linker version of `ld.lld' in a 5 or 6-digit form
-# such as `100001' for ld.lld 10.0.1 etc.
-
-linker_string="$($* --version)"
-
-if ! ( echo $linker_string | grep -q LLD ); then
-       echo 0
-       exit 1
-fi
-
-VERSION=$(echo $linker_string | cut -d ' ' -f 2)
-MAJOR=$(echo $VERSION | cut -d . -f 1)
-MINOR=$(echo $VERSION | cut -d . -f 2)
-PATCHLEVEL=$(echo $VERSION | cut -d . -f 3)
-printf "%d%02d%02d\\n" $MAJOR $MINOR $PATCHLEVEL
diff --git a/scripts/syscallhdr.sh b/scripts/syscallhdr.sh
new file mode 100755 (executable)
index 0000000..848ac27
--- /dev/null
@@ -0,0 +1,98 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# Generate a syscall number header.
+#
+# Each line of the syscall table should have the following format:
+#
+# NR ABI NAME [NATIVE] [COMPAT]
+#
+# NR       syscall number
+# ABI      ABI name
+# NAME     syscall name
+# NATIVE   native entry point (optional)
+# COMPAT   compat entry point (optional)
+
+set -e
+
+usage() {
+       echo >&2 "usage: $0 [--abis ABIS] [--emit-nr] [--offset OFFSET] [--prefix PREFIX] INFILE OUTFILE" >&2
+       echo >&2
+       echo >&2 "  INFILE    input syscall table"
+       echo >&2 "  OUTFILE   output header file"
+       echo >&2
+       echo >&2 "options:"
+       echo >&2 "  --abis ABIS        ABI(s) to handle (By default, all lines are handled)"
+       echo >&2 "  --emit-nr          Emit the macro of the number of syscalls (__NR_syscalls)"
+       echo >&2 "  --offset OFFSET    The offset of syscall numbers"
+       echo >&2 "  --prefix PREFIX    The prefix to the macro like __NR_<PREFIX><NAME>"
+       exit 1
+}
+
+# default unless specified by options
+abis=
+emit_nr=
+offset=
+prefix=
+
+while [ $# -gt 0 ]
+do
+       case $1 in
+       --abis)
+               abis=$(echo "($2)" | tr ',' '|')
+               shift 2;;
+       --emit-nr)
+               emit_nr=1
+               shift 1;;
+       --offset)
+               offset=$2
+               shift 2;;
+       --prefix)
+               prefix=$2
+               shift 2;;
+       -*)
+               echo "$1: unknown option" >&2
+               usage;;
+       *)
+               break;;
+       esac
+done
+
+if [ $# -ne 2 ]; then
+       usage
+fi
+
+infile="$1"
+outfile="$2"
+
+guard=_UAPI_ASM_$(basename "$outfile" |
+       sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
+       -e 's/[^A-Z0-9_]/_/g' -e 's/__/_/g')
+
+grep -E "^[0-9A-Fa-fXx]+[[:space:]]+$abis" "$infile" | sort -n | {
+       echo "#ifndef $guard"
+       echo "#define $guard"
+       echo
+
+       max=0
+       while read nr abi name native compat ; do
+
+               max=$nr
+
+               if [ -n "$offset" ]; then
+                       nr="($offset + $nr)"
+               fi
+
+               echo "#define __NR_$prefix$name $nr"
+       done
+
+       if [ -n "$emit_nr" ]; then
+               echo
+               echo "#ifdef __KERNEL__"
+               echo "#define __NR_${prefix}syscalls $(($max + 1))"
+               echo "#endif"
+       fi
+
+       echo
+       echo "#endif /* $guard */"
+} > "$outfile"
diff --git a/scripts/syscalltbl.sh b/scripts/syscalltbl.sh
new file mode 100755 (executable)
index 0000000..aa6ab15
--- /dev/null
@@ -0,0 +1,73 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# Generate a syscall table header.
+#
+# Each line of the syscall table should have the following format:
+#
+# NR ABI NAME [NATIVE] [COMPAT]
+#
+# NR       syscall number
+# ABI      ABI name
+# NAME     syscall name
+# NATIVE   native entry point (optional)
+# COMPAT   compat entry point (optional)
+
+set -e
+
+usage() {
+       echo >&2 "usage: $0 [--abis ABIS] INFILE OUTFILE" >&2
+       echo >&2
+       echo >&2 "  INFILE    input syscall table"
+       echo >&2 "  OUTFILE   output header file"
+       echo >&2
+       echo >&2 "options:"
+       echo >&2 "  --abis ABIS        ABI(s) to handle (By default, all lines are handled)"
+       exit 1
+}
+
+# default unless specified by options
+abis=
+
+while [ $# -gt 0 ]
+do
+       case $1 in
+       --abis)
+               abis=$(echo "($2)" | tr ',' '|')
+               shift 2;;
+       -*)
+               echo "$1: unknown option" >&2
+               usage;;
+       *)
+               break;;
+       esac
+done
+
+if [ $# -ne 2 ]; then
+       usage
+fi
+
+infile="$1"
+outfile="$2"
+
+nxt=0
+
+grep -E "^[0-9]+[[:space:]]+$abis" "$infile" | sort -n | {
+
+       while read nr abi name native compat ; do
+
+               while [ $nxt -lt $nr ]; do
+                       echo "__SYSCALL($nxt, sys_ni_syscall)"
+                       nxt=$((nxt + 1))
+               done
+
+               if [ -n "$compat" ]; then
+                       echo "__SYSCALL_WITH_COMPAT($nr, $native, $compat)"
+               elif [ -n "$native" ]; then
+                       echo "__SYSCALL($nr, $native)"
+               else
+                       echo "__SYSCALL($nr, sys_ni_syscall)"
+               fi
+               nxt=$((nr + 1))
+       done
+} > "$outfile"
diff --git a/scripts/test_dwarf5_support.sh b/scripts/test_dwarf5_support.sh
new file mode 100755 (executable)
index 0000000..c46e245
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
+
+# Test that the assembler doesn't need -Wa,-gdwarf-5 when presented with DWARF
+# v5 input, such as `.file 0` and `md5 0x00`. Should be fixed in GNU binutils
+# 2.35.2. https://sourceware.org/bugzilla/show_bug.cgi?id=25611
+echo '.file 0 "filename" md5 0x7a0b65214090b6693bd1dc24dd248245' | \
+  $* -gdwarf-5 -Wno-unused-command-line-argument -c -x assembler -o /dev/null -
index 2599bc21c1b227ba73017b008bb9f408e836eb3d..8bbcf699fe3bebecca9436167a2c57a24d505215 100644 (file)
@@ -103,7 +103,6 @@ config RD_LZ4
 config RD_ZSTD
        bool "Support initial ramdisk/ramfs compressed using ZSTD"
        default y
-       depends on BLK_DEV_INITRD
        select DECOMPRESS_ZSTD
        help
          Support loading of a ZSTD encoded initial ramdisk or cpio buffer.