Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'kbuild-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild

Pull Kbuild updates from Masahiro Yamada:

- verify depmod is installed before modules_install

- support build salt in case build ids must be unique between builds

- allow users to specify additional host compiler flags via HOST*FLAGS,
and rename internal variables to KBUILD_HOST*FLAGS

- update buildtar script to drop vax support, add arm64 support

- update builddeb script for better debarch support

- document the pit-fall of if_changed usage

- fix parallel build of UML with O= option

- make 'samples' target depend on headers_install to fix build errors

- remove deprecated host-progs variable

- add a new coccinelle script for refcount_t vs atomic_t check

- improve double-test coccinelle script

- misc cleanups and fixes

* tag 'kbuild-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (41 commits)
coccicheck: return proper error code on fail
Coccinelle: doubletest: reduce side effect false positives
kbuild: remove deprecated host-progs variable
kbuild: make samples really depend on headers_install
um: clean up archheaders recipe
kbuild: add %asm-generic to no-dot-config-targets
um: fix parallel building with O= option
scripts: Add Python 3 support to tracing/draw_functrace.py
builddeb: Add automatic support for sh{3,4}{,eb} architectures
builddeb: Add automatic support for riscv* architectures
builddeb: Add automatic support for m68k architecture
builddeb: Add automatic support for or1k architecture
builddeb: Add automatic support for sparc64 architecture
builddeb: Add automatic support for mips{,64}r6{,el} architectures
builddeb: Add automatic support for mips64el architecture
builddeb: Add automatic support for ppc64 and powerpcspe architectures
builddeb: Introduce functions to simplify kconfig tests in set_debarch
builddeb: Drop check for 32-bit s390
builddeb: Change architecture detection fallback to use dpkg-architecture
builddeb: Skip architecture detection when KBUILD_DEBARCH is set
...

+373 -169
+16
Documentation/kbuild/kbuild.txt
··· 50 50 -------------------------------------------------- 51 51 Additional options used for $(LD) when linking modules. 52 52 53 + HOSTCFLAGS 54 + -------------------------------------------------- 55 + Additional flags to be passed to $(HOSTCC) when building host programs. 56 + 57 + HOSTCXXFLAGS 58 + -------------------------------------------------- 59 + Additional flags to be passed to $(HOSTCXX) when building host programs. 60 + 61 + HOSTLDFLAGS 62 + -------------------------------------------------- 63 + Additional flags to be passed when linking host programs. 64 + 65 + HOSTLDLIBS 66 + -------------------------------------------------- 67 + Additional libraries to link against when building host programs. 68 + 53 69 KBUILD_KCONFIG 54 70 -------------------------------------------------- 55 71 Set the top-level Kconfig file to the value of this environment
+7 -1
Documentation/kbuild/makefiles.txt
··· 661 661 662 662 When compiling host programs, it is possible to set specific flags. 663 663 The programs will always be compiled utilising $(HOSTCC) passed 664 - the options specified in $(HOSTCFLAGS). 664 + the options specified in $(KBUILD_HOSTCFLAGS). 665 665 To set flags that will take effect for all host programs created 666 666 in that Makefile, use the variable HOST_EXTRACFLAGS. 667 667 ··· 1104 1104 after the comma): 1105 1105 target: source(s) FORCE 1106 1106 #WRONG!# $(call if_changed, ld/objcopy/gzip/...) 1107 + 1108 + Note: if_changed should not be used more than once per target. 1109 + It stores the executed command in a corresponding .cmd 1110 + file and multiple calls would result in overwrites and 1111 + unwanted results when the target is up to date and only the 1112 + tests on changed commands trigger execution of commands. 1107 1113 1108 1114 ld 1109 1115 Link target. Often, LDFLAGS_$@ is used to set specific options to ld.
+7 -12
Documentation/process/changes.rst
··· 35 35 flex 2.5.35 flex --version 36 36 bison 2.0 bison --version 37 37 util-linux 2.10o fdformat --version 38 - module-init-tools 0.9.10 depmod -V 38 + kmod 13 depmod -V 39 39 e2fsprogs 1.41.4 e2fsck -V 40 40 jfsutils 1.1.3 fsck.jfs -V 41 41 reiserfsprogs 3.6.3 reiserfsck -V ··· 155 155 is not build with ``CONFIG_KALLSYMS`` and you have no way to rebuild and 156 156 reproduce the Oops with that option, then you can still decode that Oops 157 157 with ksymoops. 158 - 159 - Module-Init-Tools 160 - ----------------- 161 - 162 - A new module loader is now in the kernel that requires ``module-init-tools`` 163 - to use. It is backward compatible with the 2.4.x series kernels. 164 158 165 159 Mkinitrd 166 160 -------- ··· 365 371 366 372 - <https://www.kernel.org/pub/linux/utils/util-linux/> 367 373 374 + Kmod 375 + ---- 376 + 377 + - <https://www.kernel.org/pub/linux/utils/kernel/kmod/> 378 + - <https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git> 379 + 368 380 Ksymoops 369 381 -------- 370 382 371 383 - <https://www.kernel.org/pub/linux/utils/kernel/ksymoops/v2.4/> 372 - 373 - Module-Init-Tools 374 - ----------------- 375 - 376 - - <https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/> 377 384 378 385 Mkinitrd 379 386 --------
+13 -11
Makefile
··· 224 224 no-dot-config-targets := $(clean-targets) \ 225 225 cscope gtags TAGS tags help% %docs check% coccicheck \ 226 226 $(version_h) headers_% archheaders archscripts \ 227 - kernelversion %src-pkg 227 + %asm-generic kernelversion %src-pkg 228 228 229 229 config-targets := 0 230 230 mixed-targets := 0 ··· 359 359 360 360 HOSTCC = gcc 361 361 HOSTCXX = g++ 362 - HOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 \ 363 - -fomit-frame-pointer -std=gnu89 $(HOST_LFS_CFLAGS) 364 - HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS) 365 - HOSTLDFLAGS := $(HOST_LFS_LDFLAGS) 366 - HOST_LOADLIBES := $(HOST_LFS_LIBS) 362 + KBUILD_HOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 \ 363 + -fomit-frame-pointer -std=gnu89 $(HOST_LFS_CFLAGS) \ 364 + $(HOSTCFLAGS) 365 + KBUILD_HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS) 366 + KBUILD_HOSTLDFLAGS := $(HOST_LFS_LDFLAGS) $(HOSTLDFLAGS) 367 + KBUILD_HOSTLDLIBS := $(HOST_LFS_LIBS) $(HOSTLDLIBS) 367 368 368 369 # Make variables (CC, etc...) 369 370 AS = $(CROSS_COMPILE)as ··· 430 429 LDFLAGS := 431 430 GCC_PLUGINS_CFLAGS := 432 431 433 - export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC 434 - export CPP AR NM STRIP OBJCOPY OBJDUMP HOSTLDFLAGS HOST_LOADLIBES 432 + export ARCH SRCARCH CONFIG_SHELL HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS LD CC 433 + export CPP AR NM STRIP OBJCOPY OBJDUMP KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS 435 434 export MAKE LEX YACC AWK GENKSYMS INSTALLKERNEL PERL PYTHON PYTHON2 PYTHON3 UTS_MACHINE 436 - export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS 435 + export HOSTCXX KBUILD_HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS 437 436 438 437 export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS 439 438 export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE ··· 1010 1009 endif 1011 1010 +$(call if_changed,link-vmlinux) 1012 1011 1013 - # Build samples along the rest of the kernel 1012 + # Build samples along the rest of the kernel. This needs headers_install. 1014 1013 ifdef CONFIG_SAMPLES 1015 1014 vmlinux-dirs += samples 1015 + samples: headers_install 1016 1016 endif 1017 1017 1018 1018 # The actual objects are generated when descending, ··· 1118 1116 echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';) 1119 1117 endef 1120 1118 1121 - $(version_h): $(srctree)/Makefile FORCE 1119 + $(version_h): FORCE 1122 1120 $(call filechk,version.h) 1123 1121 $(Q)rm -f $(old_version_h) 1124 1122
+1 -1
arch/alpha/boot/Makefile
··· 14 14 tools/bootpzh bootloader bootpheader bootpzheader 15 15 OBJSTRIP := $(obj)/tools/objstrip 16 16 17 - HOSTCFLAGS := -Wall -I$(objtree)/usr/include 17 + KBUILD_HOSTCFLAGS := -Wall -I$(objtree)/usr/include 18 18 BOOTCFLAGS += -I$(objtree)/$(obj) -I$(srctree)/$(obj) 19 19 20 20 # SRM bootable image. Copy to offset 512 of a partition.
-3
arch/arm/Makefile
··· 10 10 # 11 11 # Copyright (C) 1995-2001 by Russell King 12 12 13 - # Ensure linker flags are correct 14 - LDFLAGS := 15 - 16 13 LDFLAGS_vmlinux :=-p --no-undefined -X --pic-veneer 17 14 ifeq ($(CONFIG_CPU_ENDIAN_BE8),y) 18 15 LDFLAGS_vmlinux += --be8
-25
arch/arm/mach-at91/Makefile
··· 19 19 CFLAGS_pm.o += -DDEBUG 20 20 endif 21 21 22 - # Default sed regexp - multiline due to syntax constraints 23 - define sed-y 24 - "/^->/{s:->#\(.*\):/* \1 */:; \ 25 - s:^->\([^ ]*\) [\$$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; \ 26 - s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \ 27 - s:->::; p;}" 28 - endef 29 - 30 - # Use filechk to avoid rebuilds when a header changes, but the resulting file 31 - # does not 32 - define filechk_offsets 33 - (set -e; \ 34 - echo "#ifndef $2"; \ 35 - echo "#define $2"; \ 36 - echo "/*"; \ 37 - echo " * DO NOT MODIFY."; \ 38 - echo " *"; \ 39 - echo " * This file was generated by Kbuild"; \ 40 - echo " */"; \ 41 - echo ""; \ 42 - sed -ne $(sed-y); \ 43 - echo ""; \ 44 - echo "#endif" ) 45 - endef 46 - 47 22 arch/arm/mach-at91/pm_data-offsets.s: arch/arm/mach-at91/pm_data-offsets.c 48 23 $(call if_changed_dep,cc_s_c) 49 24
+3
arch/arm64/kernel/vdso/note.S
··· 22 22 #include <linux/uts.h> 23 23 #include <linux/version.h> 24 24 #include <linux/elfnote.h> 25 + #include <linux/build-salt.h> 25 26 26 27 ELFNOTE_START(Linux, 0, "a") 27 28 .long LINUX_VERSION_CODE 28 29 ELFNOTE_END 30 + 31 + BUILD_SALT
-1
arch/openrisc/Makefile
··· 19 19 20 20 KBUILD_DEFCONFIG := or1ksim_defconfig 21 21 22 - LDFLAGS := 23 22 OBJCOPYFLAGS := -O binary -R .note -R .comment -S 24 23 LDFLAGS_vmlinux := 25 24 LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
+3
arch/powerpc/kernel/vdso32/note.S
··· 5 5 6 6 #include <linux/uts.h> 7 7 #include <linux/version.h> 8 + #include <linux/build-salt.h> 8 9 9 10 #define ASM_ELF_NOTE_BEGIN(name, flags, vendor, type) \ 10 11 .section name, flags; \ ··· 24 23 ASM_ELF_NOTE_BEGIN(".note.kernel-version", "a", UTS_SYSNAME, 0) 25 24 .long LINUX_VERSION_CODE 26 25 ASM_ELF_NOTE_END 26 + 27 + BUILD_SALT
+1 -2
arch/powerpc/purgatory/Makefile
··· 6 6 $(obj)/purgatory.ro: $(obj)/trampoline.o FORCE 7 7 $(call if_changed,ld) 8 8 9 - CMD_BIN2C = $(objtree)/scripts/basic/bin2c 10 9 quiet_cmd_bin2c = BIN2C $@ 11 - cmd_bin2c = $(CMD_BIN2C) kexec_purgatory < $< > $@ 10 + cmd_bin2c = $(objtree)/scripts/bin2c kexec_purgatory < $< > $@ 12 11 13 12 $(obj)/kexec-purgatory.c: $(obj)/purgatory.ro FORCE 14 13 $(call if_changed,bin2c)
-1
arch/riscv/Makefile
··· 8 8 # for more details. 9 9 # 10 10 11 - LDFLAGS := 12 11 OBJCOPYFLAGS := -O binary 13 12 LDFLAGS_vmlinux := 14 13 ifeq ($(CONFIG_DYNAMIC_FTRACE),y)
+3 -3
arch/s390/kernel/syscalls/Makefile
··· 25 25 $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') 26 26 27 27 define filechk_syshdr 28 - $(CONFIG_SHELL) '$(systbl)' -H -a $(syshdr_abi_$(basetarget)) -f "$2" 28 + $(CONFIG_SHELL) '$(systbl)' -H -a $(syshdr_abi_$(basetarget)) -f "$2" < $< 29 29 endef 30 30 31 31 define filechk_sysnr 32 - $(CONFIG_SHELL) '$(systbl)' -N -a $(sysnr_abi_$(basetarget)) 32 + $(CONFIG_SHELL) '$(systbl)' -N -a $(sysnr_abi_$(basetarget)) < $< 33 33 endef 34 34 35 35 define filechk_syscalls 36 - $(CONFIG_SHELL) '$(systbl)' -S 36 + $(CONFIG_SHELL) '$(systbl)' -S < $< 37 37 endef 38 38 39 39 syshdr_abi_unistd_32 := common,32
+1 -2
arch/s390/purgatory/Makefile
··· 28 28 $(obj)/purgatory.ro: $(PURGATORY_OBJS) FORCE 29 29 $(call if_changed,ld) 30 30 31 - CMD_BIN2C = $(objtree)/scripts/basic/bin2c 32 31 quiet_cmd_bin2c = BIN2C $@ 33 - cmd_bin2c = $(CMD_BIN2C) kexec_purgatory < $< > $@ 32 + cmd_bin2c = $(objtree)/scripts/bin2c kexec_purgatory < $< > $@ 34 33 35 34 $(obj)/kexec-purgatory.c: $(obj)/purgatory.ro FORCE 36 35 $(call if_changed,bin2c)
+2 -9
arch/um/Makefile
··· 116 116 KBUILD_KCONFIG := $(HOST_DIR)/um/Kconfig 117 117 118 118 archheaders: 119 - $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.asm-generic \ 120 - kbuild-file=$(HOST_DIR)/include/asm/Kbuild \ 121 - obj=$(HOST_DIR)/include/generated/asm 122 - $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.asm-generic \ 123 - kbuild-file=$(HOST_DIR)/include/uapi/asm/Kbuild \ 124 - obj=$(HOST_DIR)/include/generated/uapi/asm 125 - $(Q)$(MAKE) KBUILD_SRC= ARCH=$(HEADER_ARCH) archheaders 126 - 119 + $(Q)$(MAKE) -f $(srctree)/Makefile ARCH=$(HEADER_ARCH) asm-generic archheaders 127 120 128 121 archprepare: include/generated/user_constants.h 129 122 ··· 162 169 echo " *"; \ 163 170 echo " */"; \ 164 171 echo ""; \ 165 - sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \ 172 + sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}" < $<; \ 166 173 echo ""; ) 167 174 endef 168 175
+2 -2
arch/um/drivers/Makefile
··· 25 25 targets := pcap_kern.o pcap_user.o vde_kern.o vde_user.o 26 26 27 27 $(obj)/pcap.o: $(obj)/pcap_kern.o $(obj)/pcap_user.o 28 - $(LD) -r -dp -o $@ $^ $(LDFLAGS) $(LDFLAGS_pcap.o) 28 + $(LD) -r -dp -o $@ $^ $(ld_flags) 29 29 30 30 $(obj)/vde.o: $(obj)/vde_kern.o $(obj)/vde_user.o 31 - $(LD) -r -dp -o $@ $^ $(LDFLAGS) $(LDFLAGS_vde.o) 31 + $(LD) -r -dp -o $@ $^ $(ld_flags) 32 32 33 33 #XXX: The call below does not work because the flags are added before the 34 34 # object name, so nothing from the library gets linked.
-2
arch/x86/Makefile.um
··· 13 13 KBUILD_AFLAGS += $(call cc-option,-m32) 14 14 LINK-y += $(call cc-option,-m32) 15 15 16 - export LDFLAGS 17 - 18 16 LDS_EXTRA := -Ui386 19 17 export LDS_EXTRA 20 18
+3
arch/x86/entry/vdso/vdso-note.S
··· 3 3 * Here we can supply some information useful to userland. 4 4 */ 5 5 6 + #include <linux/build-salt.h> 6 7 #include <linux/uts.h> 7 8 #include <linux/version.h> 8 9 #include <linux/elfnote.h> ··· 11 10 ELFNOTE_START(Linux, 0, "a") 12 11 .long LINUX_VERSION_CODE 13 12 ELFNOTE_END 13 + 14 + BUILD_SALT
+3
arch/x86/entry/vdso/vdso32/note.S
··· 4 4 * Here we can supply some information useful to userland. 5 5 */ 6 6 7 + #include <linux/build-salt.h> 7 8 #include <linux/version.h> 8 9 #include <linux/elfnote.h> 9 10 ··· 14 13 ELFNOTE_START(Linux, 0, "a") 15 14 .long LINUX_VERSION_CODE 16 15 ELFNOTE_END 16 + 17 + BUILD_SALT 17 18 18 19 #ifdef CONFIG_XEN 19 20 /*
+1 -2
arch/x86/purgatory/Makefile
··· 28 28 29 29 targets += kexec-purgatory.c 30 30 31 - CMD_BIN2C = $(objtree)/scripts/basic/bin2c 32 31 quiet_cmd_bin2c = BIN2C $@ 33 - cmd_bin2c = $(CMD_BIN2C) kexec_purgatory < $< > $@ 32 + cmd_bin2c = $(objtree)/scripts/bin2c kexec_purgatory < $< > $@ 34 33 35 34 $(obj)/kexec-purgatory.c: $(obj)/purgatory.ro FORCE 36 35 $(call if_changed,bin2c)
+1 -2
arch/xtensa/boot/Makefile
··· 30 30 zImage: boot-redboot 31 31 uImage: $(obj)/uImage 32 32 33 - boot-elf boot-redboot: $(addprefix $(obj)/,$(subdir-y)) \ 34 - $(addprefix $(obj)/,$(host-progs)) 33 + boot-elf boot-redboot: $(addprefix $(obj)/,$(subdir-y)) 35 34 $(Q)$(MAKE) $(build)=$(obj)/$@ $(MAKECMDGOALS) 36 35 37 36 OBJCOPYFLAGS = --strip-all -R .comment -R .note.gnu.build-id -O binary
+20
include/linux/build-salt.h
··· 1 + #ifndef __BUILD_SALT_H 2 + #define __BUILD_SALT_H 3 + 4 + #include <linux/elfnote.h> 5 + 6 + #define LINUX_ELFNOTE_BUILD_SALT 0x100 7 + 8 + #ifdef __ASSEMBLER__ 9 + 10 + #define BUILD_SALT \ 11 + ELFNOTE(Linux, LINUX_ELFNOTE_BUILD_SALT, .asciz CONFIG_BUILD_SALT) 12 + 13 + #else 14 + 15 + #define BUILD_SALT \ 16 + ELFNOTE32("Linux", LINUX_ELFNOTE_BUILD_SALT, CONFIG_BUILD_SALT) 17 + 18 + #endif 19 + 20 + #endif /* __BUILD_SALT_H */
+9
init/Kconfig
··· 107 107 108 108 which is done within the script "scripts/setlocalversion".) 109 109 110 + config BUILD_SALT 111 + string "Build ID Salt" 112 + default "" 113 + help 114 + The build ID is used to link binaries and their debug info. Setting 115 + this option will use the value in the calculation of the build id. 116 + This is mostly useful for distributions which want to ensure the 117 + build is unique between builds. It's safe to leave the default. 118 + 110 119 config HAVE_KERNEL_GZIP 111 120 bool 112 121
+3
init/version.c
··· 7 7 */ 8 8 9 9 #include <generated/compile.h> 10 + #include <linux/build-salt.h> 10 11 #include <linux/export.h> 11 12 #include <linux/uts.h> 12 13 #include <linux/utsname.h> ··· 50 49 "%s version %s" 51 50 " (" LINUX_COMPILE_BY "@" LINUX_COMPILE_HOST ")" 52 51 " (" LINUX_COMPILER ") %s\n"; 52 + 53 + BUILD_SALT;
+1 -1
kernel/Makefile
··· 123 123 $(obj)/config_data.gz: $(KCONFIG_CONFIG) FORCE 124 124 $(call if_changed,gzip) 125 125 126 - filechk_ikconfiggz = (echo "static const char kernel_config_data[] __used = MAGIC_START"; cat $< | scripts/basic/bin2c; echo "MAGIC_END;") 126 + filechk_ikconfiggz = (echo "static const char kernel_config_data[] __used = MAGIC_START"; cat $< | scripts/bin2c; echo "MAGIC_END;") 127 127 targets += config_data.h 128 128 $(obj)/config_data.h: $(obj)/config_data.gz FORCE 129 129 $(call filechk,ikconfiggz)
+2 -2
net/bpfilter/Makefile
··· 5 5 6 6 hostprogs-y := bpfilter_umh 7 7 bpfilter_umh-objs := main.o 8 - HOSTCFLAGS += -I. -Itools/include/ -Itools/include/uapi 8 + KBUILD_HOSTCFLAGS += -I. -Itools/include/ -Itools/include/uapi 9 9 HOSTCC := $(CC) 10 10 11 11 ifeq ($(CONFIG_BPFILTER_UMH), y) 12 12 # builtin bpfilter_umh should be compiled with -static 13 13 # since rootfs isn't mounted at the time of __init 14 14 # function is called and do_execv won't find elf interpreter 15 - HOSTLDFLAGS += -static 15 + KBUILD_HOSTLDFLAGS += -static 16 16 endif 17 17 18 18 $(obj)/bpfilter_umh_blob.o: $(obj)/bpfilter_umh
+11 -11
samples/bpf/Makefile
··· 164 164 always += xdp_fwd_kern.o 165 165 always += task_fd_query_kern.o 166 166 167 - HOSTCFLAGS += -I$(objtree)/usr/include 168 - HOSTCFLAGS += -I$(srctree)/tools/lib/ 169 - HOSTCFLAGS += -I$(srctree)/tools/testing/selftests/bpf/ 170 - HOSTCFLAGS += -I$(srctree)/tools/lib/ -I$(srctree)/tools/include 171 - HOSTCFLAGS += -I$(srctree)/tools/perf 167 + KBUILD_HOSTCFLAGS += -I$(objtree)/usr/include 168 + KBUILD_HOSTCFLAGS += -I$(srctree)/tools/lib/ 169 + KBUILD_HOSTCFLAGS += -I$(srctree)/tools/testing/selftests/bpf/ 170 + KBUILD_HOSTCFLAGS += -I$(srctree)/tools/lib/ -I$(srctree)/tools/include 171 + KBUILD_HOSTCFLAGS += -I$(srctree)/tools/perf 172 172 173 173 HOSTCFLAGS_bpf_load.o += -I$(objtree)/usr/include -Wno-unused-variable 174 174 HOSTCFLAGS_trace_helpers.o += -I$(srctree)/tools/lib/bpf/ ··· 180 180 HOSTCFLAGS_sampleip_user.o += -I$(srctree)/tools/lib/bpf/ 181 181 HOSTCFLAGS_task_fd_query_user.o += -I$(srctree)/tools/lib/bpf/ 182 182 183 - HOST_LOADLIBES += $(LIBBPF) -lelf 184 - HOSTLOADLIBES_tracex4 += -lrt 185 - HOSTLOADLIBES_trace_output += -lrt 186 - HOSTLOADLIBES_map_perf_test += -lrt 187 - HOSTLOADLIBES_test_overhead += -lrt 188 - HOSTLOADLIBES_xdpsock += -pthread 183 + KBUILD_HOSTLDLIBS += $(LIBBPF) -lelf 184 + HOSTLDLIBS_tracex4 += -lrt 185 + HOSTLDLIBS_trace_output += -lrt 186 + HOSTLDLIBS_map_perf_test += -lrt 187 + HOSTLDLIBS_test_overhead += -lrt 188 + HOSTLDLIBS_xdpsock += -pthread 189 189 190 190 # Allows pointing LLC/CLANG to a LLVM backend with bpf support, redefine on cmdline: 191 191 # make samples/bpf/ LLC=~/git/llvm/build/bin/llc CLANG=~/git/llvm/build/bin/clang
+3 -3
samples/seccomp/Makefile
··· 30 30 HOSTCFLAGS_dropper.o += $(MFLAG) 31 31 HOSTCFLAGS_bpf-helper.o += $(MFLAG) 32 32 HOSTCFLAGS_bpf-fancy.o += $(MFLAG) 33 - HOSTLOADLIBES_bpf-direct += $(MFLAG) 34 - HOSTLOADLIBES_bpf-fancy += $(MFLAG) 35 - HOSTLOADLIBES_dropper += $(MFLAG) 33 + HOSTLDLIBS_bpf-direct += $(MFLAG) 34 + HOSTLDLIBS_bpf-fancy += $(MFLAG) 35 + HOSTLDLIBS_dropper += $(MFLAG) 36 36 endif 37 37 always := $(hostprogs-m) 38 38 endif
+1
scripts/.gitignore
··· 1 1 # 2 2 # Generated files 3 3 # 4 + bin2c 4 5 conmakehash 5 6 kallsyms 6 7 pnmtologo
+2 -2
scripts/Kbuild.include
··· 56 56 define filechk 57 57 $(Q)set -e; \ 58 58 mkdir -p $(dir $@); \ 59 - $(filechk_$(1)) < $< > $@.tmp; \ 59 + $(filechk_$(1)) > $@.tmp; \ 60 60 if [ -r $@ ] && cmp -s $@ $@.tmp; then \ 61 61 rm -f $@.tmp; \ 62 62 else \ ··· 126 126 # hostcc-option 127 127 # Usage: cflags-y += $(call hostcc-option,-march=winchip-c6,-march=i586) 128 128 hostcc-option = $(call __cc-option, $(HOSTCC),\ 129 - $(HOSTCFLAGS) $(HOST_EXTRACFLAGS),$(1),$(2)) 129 + $(KBUILD_HOSTCFLAGS) $(HOST_EXTRACFLAGS),$(1),$(2)) 130 130 131 131 # cc-option-yn 132 132 # Usage: flag := $(call cc-option-yn,-march=winchip-c6)
+3 -2
scripts/Makefile
··· 10 10 11 11 HOST_EXTRACFLAGS += -I$(srctree)/tools/include 12 12 13 + hostprogs-$(CONFIG_BUILD_BIN2C) += bin2c 13 14 hostprogs-$(CONFIG_KALLSYMS) += kallsyms 14 15 hostprogs-$(CONFIG_LOGO) += pnmtologo 15 16 hostprogs-$(CONFIG_VT) += conmakehash ··· 23 22 24 23 HOSTCFLAGS_sortextable.o = -I$(srctree)/tools/include 25 24 HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include 26 - HOSTLOADLIBES_sign-file = -lcrypto 27 - HOSTLOADLIBES_extract-cert = -lcrypto 25 + HOSTLDLIBS_sign-file = -lcrypto 26 + HOSTLDLIBS_extract-cert = -lcrypto 28 27 29 28 always := $(hostprogs-y) $(hostprogs-m) 30 29
-7
scripts/Makefile.build
··· 53 53 54 54 include scripts/Makefile.lib 55 55 56 - ifdef host-progs 57 - ifneq ($(hostprogs-y),$(host-progs)) 58 - $(warning kbuild: $(obj)/Makefile - Usage of host-progs is deprecated. Please replace with hostprogs-y!) 59 - hostprogs-y += $(host-progs) 60 - endif 61 - endif 62 - 63 56 # Do not include host rules unless needed 64 57 ifneq ($(hostprogs-y)$(hostprogs-m)$(hostlibs-y)$(hostlibs-m)$(hostcxxlibs-y)$(hostcxxlibs-m),) 65 58 include scripts/Makefile.host
-1
scripts/Makefile.clean
··· 38 38 39 39 __clean-files := $(extra-y) $(extra-m) $(extra-) \ 40 40 $(always) $(targets) $(clean-files) \ 41 - $(host-progs) \ 42 41 $(hostprogs-y) $(hostprogs-m) $(hostprogs-) \ 43 42 $(hostlibs-y) $(hostlibs-m) $(hostlibs-) \ 44 43 $(hostcxxlibs-y) $(hostcxxlibs-m)
+12 -12
scripts/Makefile.host
··· 62 62 ##### 63 63 # Handle options to gcc. Support building with separate output directory 64 64 65 - _hostc_flags = $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) \ 65 + _hostc_flags = $(KBUILD_HOSTCFLAGS) $(HOST_EXTRACFLAGS) \ 66 66 $(HOSTCFLAGS_$(basetarget).o) 67 - _hostcxx_flags = $(HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) \ 67 + _hostcxx_flags = $(KBUILD_HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) \ 68 68 $(HOSTCXXFLAGS_$(basetarget).o) 69 69 70 70 ifeq ($(KBUILD_SRC),) ··· 84 84 # Create executable from a single .c file 85 85 # host-csingle -> Executable 86 86 quiet_cmd_host-csingle = HOSTCC $@ 87 - cmd_host-csingle = $(HOSTCC) $(hostc_flags) $(HOSTLDFLAGS) -o $@ $< \ 88 - $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) 87 + cmd_host-csingle = $(HOSTCC) $(hostc_flags) $(KBUILD_HOSTLDFLAGS) -o $@ $< \ 88 + $(KBUILD_HOSTLDLIBS) $(HOSTLDLIBS_$(@F)) 89 89 $(host-csingle): $(obj)/%: $(src)/%.c FORCE 90 90 $(call if_changed_dep,host-csingle) 91 91 92 92 # Link an executable based on list of .o files, all plain c 93 93 # host-cmulti -> executable 94 94 quiet_cmd_host-cmulti = HOSTLD $@ 95 - cmd_host-cmulti = $(HOSTCC) $(HOSTLDFLAGS) -o $@ \ 95 + cmd_host-cmulti = $(HOSTCC) $(KBUILD_HOSTLDFLAGS) -o $@ \ 96 96 $(addprefix $(obj)/,$($(@F)-objs)) \ 97 - $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) 97 + $(KBUILD_HOSTLDLIBS) $(HOSTLDLIBS_$(@F)) 98 98 $(host-cmulti): FORCE 99 99 $(call if_changed,host-cmulti) 100 100 $(call multi_depend, $(host-cmulti), , -objs) ··· 109 109 # Link an executable based on list of .o files, a mixture of .c and .cc 110 110 # host-cxxmulti -> executable 111 111 quiet_cmd_host-cxxmulti = HOSTLD $@ 112 - cmd_host-cxxmulti = $(HOSTCXX) $(HOSTLDFLAGS) -o $@ \ 112 + cmd_host-cxxmulti = $(HOSTCXX) $(KBUILD_HOSTLDFLAGS) -o $@ \ 113 113 $(foreach o,objs cxxobjs,\ 114 114 $(addprefix $(obj)/,$($(@F)-$(o)))) \ 115 - $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) 115 + $(KBUILD_HOSTLDLIBS) $(HOSTLDLIBS_$(@F)) 116 116 $(host-cxxmulti): FORCE 117 117 $(call if_changed,host-cxxmulti) 118 118 $(call multi_depend, $(host-cxxmulti), , -objs -cxxobjs) ··· 143 143 # Link a shared library, based on position independent .o files 144 144 # *.o -> .so shared library (host-cshlib) 145 145 quiet_cmd_host-cshlib = HOSTLLD -shared $@ 146 - cmd_host-cshlib = $(HOSTCC) $(HOSTLDFLAGS) -shared -o $@ \ 146 + cmd_host-cshlib = $(HOSTCC) $(KBUILD_HOSTLDFLAGS) -shared -o $@ \ 147 147 $(addprefix $(obj)/,$($(@F:.so=-objs))) \ 148 - $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) 148 + $(KBUILD_HOSTLDLIBS) $(HOSTLDLIBS_$(@F)) 149 149 $(host-cshlib): FORCE 150 150 $(call if_changed,host-cshlib) 151 151 $(call multi_depend, $(host-cshlib), .so, -objs) ··· 153 153 # Link a shared library, based on position independent .o files 154 154 # *.o -> .so shared library (host-cxxshlib) 155 155 quiet_cmd_host-cxxshlib = HOSTLLD -shared $@ 156 - cmd_host-cxxshlib = $(HOSTCXX) $(HOSTLDFLAGS) -shared -o $@ \ 156 + cmd_host-cxxshlib = $(HOSTCXX) $(KBUILD_HOSTLDFLAGS) -shared -o $@ \ 157 157 $(addprefix $(obj)/,$($(@F:.so=-objs))) \ 158 - $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) 158 + $(KBUILD_HOSTLDLIBS) $(HOSTLDLIBS_$(@F)) 159 159 $(host-cxxshlib): FORCE 160 160 $(call if_changed,host-cxxshlib) 161 161 $(call multi_depend, $(host-cxxshlib), .so, -objs)
+3 -4
scripts/Makefile.lib
··· 162 162 cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \ 163 163 $(__cpp_flags) 164 164 165 - ld_flags = $(LDFLAGS) $(ldflags-y) 165 + ld_flags = $(LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F)) 166 166 167 167 DTC_INCLUDE := $(srctree)/scripts/dtc/include-prefixes 168 168 ··· 225 225 # --------------------------------------------------------------------------- 226 226 227 227 quiet_cmd_ld = LD $@ 228 - cmd_ld = $(LD) $(LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F)) \ 229 - $(filter-out FORCE,$^) -o $@ 228 + cmd_ld = $(LD) $(ld_flags) $(filter-out FORCE,$^) -o $@ 230 229 231 230 # Objcopy 232 231 # --------------------------------------------------------------------------- ··· 415 416 echo " * This file was generated by Kbuild"; \ 416 417 echo " */"; \ 417 418 echo ""; \ 418 - sed -ne $(sed-offsets); \ 419 + sed -ne $(sed-offsets) < $<; \ 419 420 echo ""; \ 420 421 echo "#endif" ) 421 422 endef
-1
scripts/basic/.gitignore
··· 1 1 fixdep 2 - bin2c
-1
scripts/basic/Makefile
··· 9 9 # fixdep: Used to generate dependency information during build process 10 10 11 11 hostprogs-y := fixdep 12 - hostprogs-$(CONFIG_BUILD_BIN2C) += bin2c 13 12 always := $(hostprogs-y) 14 13 15 14 # fixdep is needed to compile other host programs
scripts/basic/bin2c.c scripts/bin2c.c
+3 -2
scripts/coccicheck
··· 128 128 fi 129 129 echo $@ >>$DEBUG_FILE 130 130 $@ 2>>$DEBUG_FILE 131 - if [[ $? -ne 0 ]]; then 131 + err=$? 132 + if [[ $err -ne 0 ]]; then 132 133 echo "coccicheck failed" 133 - exit $? 134 + exit $err 134 135 fi 135 136 } 136 137
+129
scripts/coccinelle/api/atomic_as_refcounter.cocci
··· 1 + // Check if refcount_t type and API should be used 2 + // instead of atomic_t type when dealing with refcounters 3 + // 4 + // Copyright (c) 2016-2017, Elena Reshetova, Intel Corporation 5 + // 6 + // Confidence: Moderate 7 + // URL: http://coccinelle.lip6.fr/ 8 + // Options: --include-headers --very-quiet 9 + 10 + virtual report 11 + 12 + @r1 exists@ 13 + identifier a, x; 14 + position p1, p2; 15 + identifier fname =~ ".*free.*"; 16 + identifier fname2 =~ ".*destroy.*"; 17 + identifier fname3 =~ ".*del.*"; 18 + identifier fname4 =~ ".*queue_work.*"; 19 + identifier fname5 =~ ".*schedule_work.*"; 20 + identifier fname6 =~ ".*call_rcu.*"; 21 + 22 + @@ 23 + 24 + ( 25 + atomic_dec_and_test@p1(&(a)->x) 26 + | 27 + atomic_dec_and_lock@p1(&(a)->x, ...) 28 + | 29 + atomic_long_dec_and_lock@p1(&(a)->x, ...) 30 + | 31 + atomic_long_dec_and_test@p1(&(a)->x) 32 + | 33 + atomic64_dec_and_test@p1(&(a)->x) 34 + | 35 + local_dec_and_test@p1(&(a)->x) 36 + ) 37 + ... 38 + ( 39 + fname@p2(a, ...); 40 + | 41 + fname2@p2(...); 42 + | 43 + fname3@p2(...); 44 + | 45 + fname4@p2(...); 46 + | 47 + fname5@p2(...); 48 + | 49 + fname6@p2(...); 50 + ) 51 + 52 + 53 + @script:python depends on report@ 54 + p1 << r1.p1; 55 + p2 << r1.p2; 56 + @@ 57 + msg = "atomic_dec_and_test variation before object free at line %s." 58 + coccilib.report.print_report(p1[0], msg % (p2[0].line)) 59 + 60 + @r4 exists@ 61 + identifier a, x, y; 62 + position p1, p2; 63 + identifier fname =~ ".*free.*"; 64 + 65 + @@ 66 + 67 + ( 68 + atomic_dec_and_test@p1(&(a)->x) 69 + | 70 + atomic_dec_and_lock@p1(&(a)->x, ...) 71 + | 72 + atomic_long_dec_and_lock@p1(&(a)->x, ...) 73 + | 74 + atomic_long_dec_and_test@p1(&(a)->x) 75 + | 76 + atomic64_dec_and_test@p1(&(a)->x) 77 + | 78 + local_dec_and_test@p1(&(a)->x) 79 + ) 80 + ... 81 + y=a 82 + ... 83 + fname@p2(y, ...); 84 + 85 + 86 + @script:python depends on report@ 87 + p1 << r4.p1; 88 + p2 << r4.p2; 89 + @@ 90 + msg = "atomic_dec_and_test variation before object free at line %s." 91 + coccilib.report.print_report(p1[0], msg % (p2[0].line)) 92 + 93 + @r2 exists@ 94 + identifier a, x; 95 + position p1; 96 + @@ 97 + 98 + ( 99 + atomic_add_unless(&(a)->x,-1,1)@p1 100 + | 101 + atomic_long_add_unless(&(a)->x,-1,1)@p1 102 + | 103 + atomic64_add_unless(&(a)->x,-1,1)@p1 104 + ) 105 + 106 + @script:python depends on report@ 107 + p1 << r2.p1; 108 + @@ 109 + msg = "atomic_add_unless" 110 + coccilib.report.print_report(p1[0], msg) 111 + 112 + @r3 exists@ 113 + identifier x; 114 + position p1; 115 + @@ 116 + 117 + ( 118 + x = atomic_add_return@p1(-1, ...); 119 + | 120 + x = atomic_long_add_return@p1(-1, ...); 121 + | 122 + x = atomic64_add_return@p1(-1, ...); 123 + ) 124 + 125 + @script:python depends on report@ 126 + p1 << r3.p1; 127 + @@ 128 + msg = "x = atomic_add_return(-1, ...)" 129 + coccilib.report.print_report(p1[0], msg)
+26 -8
scripts/coccinelle/tests/doubletest.cocci
··· 1 1 /// Find &&/|| operations that include the same argument more than once 2 - //# A common source of false positives is when the argument performs a side 3 - //# effect. 2 + //# A common source of false positives is when the expression, or 3 + //# another expresssion in the same && or || operation, performs a 4 + //# side effect. 4 5 /// 5 6 // Confidence: Moderate 6 7 // Copyright: (C) 2010 Nicolas Palix, DIKU. GPLv2. ··· 21 20 @@ 22 21 23 22 ( 24 - * E@p 25 - || ... || E 23 + E@p || ... || E 26 24 | 27 - * E@p 28 - && ... && E 25 + E@p && ... && E 29 26 ) 30 27 31 - @script:python depends on org@ 28 + @bad@ 29 + expression r.E,e1,e2,fn; 30 + position r.p; 31 + assignment operator op; 32 + @@ 33 + 34 + ( 35 + E@p 36 + & 37 + <+... \(fn(...)\|e1 op e2\|e1++\|e1--\|++e1\|--e1\) ...+> 38 + ) 39 + 40 + @depends on context && !bad@ 41 + expression r.E; 42 + position r.p; 43 + @@ 44 + 45 + *E@p 46 + 47 + @script:python depends on org && !bad@ 32 48 p << r.p; 33 49 @@ 34 50 35 51 cocci.print_main("duplicated argument to && or ||",p) 36 52 37 - @script:python depends on report@ 53 + @script:python depends on report && !bad@ 38 54 p << r.p; 39 55 @@ 40 56
+7 -1
scripts/depmod.sh
··· 10 10 DEPMOD=$1 11 11 KERNELRELEASE=$2 12 12 13 - if ! test -r System.map -a -x "$DEPMOD"; then 13 + if ! test -r System.map ; then 14 14 exit 0 15 + fi 16 + 17 + if [ -z $(command -v $DEPMOD) ]; then 18 + echo "'make modules_install' requires $DEPMOD. Please install it." >&2 19 + echo "This is probably in the kmod package." >&2 20 + exit 1 15 21 fi 16 22 17 23 # older versions of depmod require the version string to start with three
+4 -4
scripts/kconfig/Makefile
··· 169 169 hostprogs-y += nconf 170 170 nconf-objs := nconf.o zconf.tab.o nconf.gui.o 171 171 172 - HOSTLOADLIBES_nconf = $(shell . $(obj)/.nconf-cfg && echo $$libs) 172 + HOSTLDLIBS_nconf = $(shell . $(obj)/.nconf-cfg && echo $$libs) 173 173 HOSTCFLAGS_nconf.o = $(shell . $(obj)/.nconf-cfg && echo $$cflags) 174 174 HOSTCFLAGS_nconf.gui.o = $(shell . $(obj)/.nconf-cfg && echo $$cflags) 175 175 ··· 180 180 lxdialog := checklist.o inputbox.o menubox.o textbox.o util.o yesno.o 181 181 mconf-objs := mconf.o zconf.tab.o $(addprefix lxdialog/, $(lxdialog)) 182 182 183 - HOSTLOADLIBES_mconf = $(shell . $(obj)/.mconf-cfg && echo $$libs) 183 + HOSTLDLIBS_mconf = $(shell . $(obj)/.mconf-cfg && echo $$libs) 184 184 $(foreach f, mconf.o $(lxdialog), \ 185 185 $(eval HOSTCFLAGS_$f = $$(shell . $(obj)/.mconf-cfg && echo $$$$cflags))) 186 186 ··· 191 191 qconf-cxxobjs := qconf.o 192 192 qconf-objs := zconf.tab.o 193 193 194 - HOSTLOADLIBES_qconf = $(shell . $(obj)/.qconf-cfg && echo $$libs) 194 + HOSTLDLIBS_qconf = $(shell . $(obj)/.qconf-cfg && echo $$libs) 195 195 HOSTCXXFLAGS_qconf.o = $(shell . $(obj)/.qconf-cfg && echo $$cflags) 196 196 197 197 $(obj)/qconf.o: $(obj)/.qconf-cfg $(obj)/qconf.moc ··· 206 206 hostprogs-y += gconf 207 207 gconf-objs := gconf.o zconf.tab.o 208 208 209 - HOSTLOADLIBES_gconf = $(shell . $(obj)/.gconf-cfg && echo $$libs) 209 + HOSTLDLIBS_gconf = $(shell . $(obj)/.gconf-cfg && echo $$libs) 210 210 HOSTCFLAGS_gconf.o = $(shell . $(obj)/.gconf-cfg && echo $$cflags) 211 211 212 212 $(obj)/gconf.o: $(obj)/.gconf-cfg
+3
scripts/mod/modpost.c
··· 2125 2125 **/ 2126 2126 static void add_header(struct buffer *b, struct module *mod) 2127 2127 { 2128 + buf_printf(b, "#include <linux/build-salt.h>\n"); 2128 2129 buf_printf(b, "#include <linux/module.h>\n"); 2129 2130 buf_printf(b, "#include <linux/vermagic.h>\n"); 2130 2131 buf_printf(b, "#include <linux/compiler.h>\n"); 2132 + buf_printf(b, "\n"); 2133 + buf_printf(b, "BUILD_SALT;\n"); 2131 2134 buf_printf(b, "\n"); 2132 2135 buf_printf(b, "MODULE_INFO(vermagic, VERMAGIC_STRING);\n"); 2133 2136 buf_printf(b, "MODULE_INFO(name, KBUILD_MODNAME);\n");
+8 -4
scripts/package/buildtar
··· 84 84 [ -f "${KBUILD_IMAGE}" ] && cp -v -- "${KBUILD_IMAGE}" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}" 85 85 [ -f "${objtree}/lifimage" ] && cp -v -- "${objtree}/lifimage" "${tmpdir}/boot/lifimage-${KERNELRELEASE}" 86 86 ;; 87 - vax) 88 - [ -f "${objtree}/vmlinux.SYS" ] && cp -v -- "${objtree}/vmlinux.SYS" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}.SYS" 89 - [ -f "${objtree}/vmlinux.dsk" ] && cp -v -- "${objtree}/vmlinux.dsk" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}.dsk" 90 - ;; 91 87 mips) 92 88 if [ -f "${objtree}/arch/mips/boot/compressed/vmlinux.bin" ]; then 93 89 cp -v -- "${objtree}/arch/mips/boot/compressed/vmlinux.bin" "${tmpdir}/boot/vmlinuz-${KERNELRELEASE}" ··· 104 108 elif [ -f "${objtree}/vmlinux" ]; then 105 109 cp -v -- "${objtree}/vmlinux" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}" 106 110 fi 111 + ;; 112 + arm64) 113 + for i in Image.bz2 Image.gz Image.lz4 Image.lzma Image.lzo ; do 114 + if [ -f "${objtree}/arch/arm64/boot/${i}" ] ; then 115 + cp -v -- "${objtree}/arch/arm64/boot/${i}" "${tmpdir}/boot/vmlinuz-${KERNELRELEASE}" 116 + break 117 + fi 118 + done 107 119 ;; 108 120 *) 109 121 [ -f "${KBUILD_IMAGE}" ] && cp -v -- "${KBUILD_IMAGE}" "${tmpdir}/boot/vmlinux-kbuild-${KERNELRELEASE}"
+50 -18
scripts/package/mkdebian
··· 6 6 7 7 set -e 8 8 9 + is_enabled() { 10 + grep -q "^CONFIG_$1=y" $KCONFIG_CONFIG 11 + } 12 + 13 + if_enabled_echo() { 14 + if is_enabled "$1"; then 15 + echo -n "$2" 16 + elif [ $# -ge 3 ]; then 17 + echo -n "$3" 18 + fi 19 + } 20 + 9 21 set_debarch() { 22 + if [ -n "$KBUILD_DEBARCH" ] ; then 23 + debarch="$KBUILD_DEBARCH" 24 + return 25 + fi 26 + 10 27 # Attempt to find the correct Debian architecture 11 28 case "$UTS_MACHINE" in 12 - i386|ia64|alpha) 29 + i386|ia64|alpha|m68k|riscv*) 13 30 debarch="$UTS_MACHINE" ;; 14 31 x86_64) 15 32 debarch=amd64 ;; 16 33 sparc*) 17 - debarch=sparc ;; 34 + debarch=sparc$(if_enabled_echo 64BIT 64) ;; 18 35 s390*) 19 - debarch=s390$(grep -q CONFIG_64BIT=y $KCONFIG_CONFIG && echo x || true) ;; 36 + debarch=s390x ;; 20 37 ppc*) 21 - debarch=$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo ppc64el || echo powerpc) ;; 38 + if is_enabled 64BIT; then 39 + debarch=ppc64$(if_enabled_echo CPU_LITTLE_ENDIAN el) 40 + else 41 + debarch=powerpc$(if_enabled_echo SPE spe) 42 + fi 43 + ;; 22 44 parisc*) 23 45 debarch=hppa ;; 24 46 mips*) 25 - debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo el || true) ;; 47 + if is_enabled CPU_LITTLE_ENDIAN; then 48 + debarch=mips$(if_enabled_echo 64BIT 64)$(if_enabled_echo CPU_MIPSR6 r6)el 49 + elif is_enabled CPU_MIPSR6; then 50 + debarch=mips$(if_enabled_echo 64BIT 64)r6 51 + else 52 + debarch=mips 53 + fi 54 + ;; 26 55 aarch64|arm64) 27 56 debarch=arm64 ;; 28 57 arm*) 29 - if grep -q CONFIG_AEABI=y $KCONFIG_CONFIG; then 30 - if grep -q CONFIG_VFP=y $KCONFIG_CONFIG; then 31 - debarch=armhf 32 - else 33 - debarch=armel 34 - fi 58 + if is_enabled AEABI; then 59 + debarch=arm$(if_enabled_echo VFP hf el) 35 60 else 36 - debarch=arm 61 + debarch=arm 37 62 fi 38 63 ;; 39 - *) 40 - debarch=$(dpkg --print-architecture) 64 + openrisc) 65 + debarch=or1k ;; 66 + sh) 67 + if is_enabled CPU_SH3; then 68 + debarch=sh3$(if_enabled_echo CPU_BIG_ENDIAN eb) 69 + elif is_enabled CPU_SH4; then 70 + debarch=sh4$(if_enabled_echo CPU_BIG_ENDIAN eb) 71 + fi 72 + ;; 73 + esac 74 + if [ -z "$debarch" ]; then 75 + debarch=$(dpkg-architecture -qDEB_HOST_ARCH) 41 76 echo "" >&2 42 77 echo "** ** ** WARNING ** ** **" >&2 43 78 echo "" >&2 44 79 echo "Your architecture doesn't have its equivalent" >&2 45 80 echo "Debian userspace architecture defined!" >&2 46 - echo "Falling back to using your current userspace instead!" >&2 81 + echo "Falling back to the current host architecture ($debarch)." >&2 47 82 echo "Please add support for $UTS_MACHINE to ${0} ..." >&2 48 83 echo "" >&2 49 - esac 50 - if [ -n "$KBUILD_DEBARCH" ] ; then 51 - debarch="$KBUILD_DEBARCH" 52 84 fi 53 85 } 54 86
+1 -1
scripts/tracing/draw_functrace.py
··· 123 123 tree = tree.getParent(caller) 124 124 tree = tree.calls(callee, calltime) 125 125 126 - print CallTree.ROOT 126 + print(CallTree.ROOT) 127 127 128 128 if __name__ == "__main__": 129 129 main()
+1 -1
security/tomoyo/Makefile
··· 4 4 targets += builtin-policy.h 5 5 define do_policy 6 6 echo "static char tomoyo_builtin_$(1)[] __initdata ="; \ 7 - $(objtree)/scripts/basic/bin2c <$(firstword $(wildcard $(obj)/policy/$(1).conf $(srctree)/$(src)/policy/$(1).conf.default) /dev/null); \ 7 + $(objtree)/scripts/bin2c <$(firstword $(wildcard $(obj)/policy/$(1).conf $(srctree)/$(src)/policy/$(1).conf.default) /dev/null); \ 8 8 echo ";" 9 9 endef 10 10 quiet_cmd_policy = POLICY $@
+1 -1
tools/build/Build.include
··· 98 98 ### 99 99 ## HOSTCC C flags 100 100 101 - host_c_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(HOSTCFLAGS) -D"BUILD_STR(s)=\#s" $(HOSTCFLAGS_$(basetarget).o) $(HOSTCFLAGS_$(obj)) 101 + host_c_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(KBUILD_HOSTCFLAGS) -D"BUILD_STR(s)=\#s" $(HOSTCFLAGS_$(basetarget).o) $(HOSTCFLAGS_$(obj))
+1 -1
tools/build/Makefile
··· 43 43 $(Q)$(MAKE) $(build)=fixdep 44 44 45 45 $(OUTPUT)fixdep: $(OUTPUT)fixdep-in.o 46 - $(QUIET_LINK)$(HOSTCC) $(HOSTLDFLAGS) -o $@ $< 46 + $(QUIET_LINK)$(HOSTCC) $(KBUILD_HOSTLDFLAGS) -o $@ $< 47 47 48 48 FORCE: 49 49
+2 -2
tools/objtool/Makefile
··· 31 31 -I$(srctree)/tools/arch/$(HOSTARCH)/include/uapi \ 32 32 -I$(srctree)/tools/objtool/arch/$(ARCH)/include 33 33 WARNINGS := $(EXTRA_WARNINGS) -Wno-switch-default -Wno-switch-enum -Wno-packed 34 - CFLAGS += -Werror $(WARNINGS) $(HOSTCFLAGS) -g $(INCLUDES) 35 - LDFLAGS += -lelf $(LIBSUBCMD) $(HOSTLDFLAGS) 34 + CFLAGS += -Werror $(WARNINGS) $(KBUILD_HOSTCFLAGS) -g $(INCLUDES) 35 + LDFLAGS += -lelf $(LIBSUBCMD) $(KBUILD_HOSTLDFLAGS) 36 36 37 37 # Allow old libelf to be used: 38 38 elfshdr := $(shell echo '$(pound)include <libelf.h>' | $(CC) $(CFLAGS) -x c -E - | grep elf_getshdr)