Merge tag 'kbuild-v5.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild

Pull more Kbuild updates from Masahiro Yamada:

- fix randconfig to generate a sane .config

- rename hostprogs-y / always to hostprogs / always-y, which are more
natual syntax.

- optimize scripts/kallsyms

- fix yes2modconfig and mod2yesconfig

- make multiple directory targets ('make foo/ bar/') work

* tag 'kbuild-v5.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
kbuild: make multiple directory targets work
kconfig: Invalidate all symbols after changing to y or m.
kallsyms: fix type of kallsyms_token_table[]
scripts/kallsyms: change table to store (strcut sym_entry *)
scripts/kallsyms: rename local variables in read_symbol()
kbuild: rename hostprogs-y/always to hostprogs/always-y
kbuild: fix the document to use extra-y for vmlinux.lds
kconfig: fix broken dependency in randconfig-generated .config

Changed files
+252 -261
Documentation
kbuild
arch
alpha
boot
arm
vdso
arm64
kernel
vdso32
mips
boot
compressed
tools
tools
vdso
powerpc
boot
s390
tools
sparc
boot
vdso
x86
boot
compressed
entry
vdso
realmode
tools
drivers
gpu
drm
radeon
tty
video
logo
zorro
fs
unicode
kernel
lib
net
bpfilter
samples
bpf
connector
hidraw
mei
pidfd
seccomp
uhid
vfs
scripts
usr
+18 -35
Documentation/kbuild/makefiles.rst
··· 28 28 --- 4.3 Using C++ for host programs 29 29 --- 4.4 Controlling compiler options for host programs 30 30 --- 4.5 When host programs are actually built 31 - --- 4.6 Using hostprogs-$(CONFIG_FOO) 32 31 33 32 === 5 Kbuild clean infrastructure 34 33 ··· 594 595 Two steps are required in order to use a host executable. 595 596 596 597 The first step is to tell kbuild that a host program exists. This is 597 - done utilising the variable hostprogs-y. 598 + done utilising the variable "hostprogs". 598 599 599 600 The second step is to add an explicit dependency to the executable. 600 601 This can be done in two ways. Either add the dependency in a rule, 601 - or utilise the variable $(always). 602 + or utilise the variable "always-y". 602 603 Both possibilities are described in the following. 603 604 604 605 4.1 Simple Host Program ··· 611 612 612 613 Example:: 613 614 614 - hostprogs-y := bin2hex 615 + hostprogs := bin2hex 615 616 616 617 Kbuild assumes in the above example that bin2hex is made from a single 617 618 c-source file named bin2hex.c located in the same directory as ··· 629 630 Example:: 630 631 631 632 #scripts/lxdialog/Makefile 632 - hostprogs-y := lxdialog 633 + hostprogs := lxdialog 633 634 lxdialog-objs := checklist.o lxdialog.o 634 635 635 636 Objects with extension .o are compiled from the corresponding .c ··· 649 650 Example:: 650 651 651 652 #scripts/kconfig/Makefile 652 - hostprogs-y := qconf 653 + hostprogs := qconf 653 654 qconf-cxxobjs := qconf.o 654 655 655 656 In the example above the executable is composed of the C++ file ··· 661 662 Example:: 662 663 663 664 #scripts/kconfig/Makefile 664 - hostprogs-y := qconf 665 + hostprogs := qconf 665 666 qconf-cxxobjs := qconf.o 666 667 qconf-objs := check.o 667 668 ··· 709 710 Example:: 710 711 711 712 #drivers/pci/Makefile 712 - hostprogs-y := gen-devlist 713 + hostprogs := gen-devlist 713 714 $(obj)/devlist.h: $(src)/pci.ids $(obj)/gen-devlist 714 715 ( cd $(obj); ./gen-devlist ) < $< 715 716 ··· 717 718 $(obj)/gen-devlist is updated. Note that references to 718 719 the host programs in special rules must be prefixed with $(obj). 719 720 720 - (2) Use $(always) 721 + (2) Use always-y 721 722 722 723 When there is no suitable special rule, and the host program 723 - shall be built when a makefile is entered, the $(always) 724 + shall be built when a makefile is entered, the always-y 724 725 variable shall be used. 725 726 726 727 Example:: 727 728 728 729 #scripts/lxdialog/Makefile 729 - hostprogs-y := lxdialog 730 - always := $(hostprogs-y) 730 + hostprogs := lxdialog 731 + always-y := $(hostprogs) 731 732 732 733 This will tell kbuild to build lxdialog even if not referenced in 733 734 any rule. 734 - 735 - 4.6 Using hostprogs-$(CONFIG_FOO) 736 - --------------------------------- 737 - 738 - A typical pattern in a Kbuild file looks like this: 739 - 740 - Example:: 741 - 742 - #scripts/Makefile 743 - hostprogs-$(CONFIG_KALLSYMS) += kallsyms 744 - 745 - Kbuild knows about both 'y' for built-in and 'm' for module. 746 - So if a config symbol evaluates to 'm', kbuild will still build 747 - the binary. In other words, Kbuild handles hostprogs-m exactly 748 - like hostprogs-y. But only hostprogs-y is recommended to be used 749 - when no CONFIG symbols are involved. 750 735 751 736 5 Kbuild clean infrastructure 752 737 ============================= 753 738 754 739 "make clean" deletes most generated files in the obj tree where the kernel 755 740 is compiled. This includes generated files such as host programs. 756 - Kbuild knows targets listed in $(hostprogs-y), $(hostprogs-m), $(always), 757 - $(extra-y) and $(targets). They are all deleted during "make clean". 758 - Files matching the patterns "*.[oas]", "*.ko", plus some additional files 759 - generated by kbuild are deleted all over the kernel src tree when 760 - "make clean" is executed. 741 + Kbuild knows targets listed in $(hostprogs), $(always-y), $(always-m), 742 + $(always-), $(extra-y), $(extra-) and $(targets). They are all deleted 743 + during "make clean". Files matching the patterns "*.[oas]", "*.ko", plus 744 + some additional files generated by kbuild are deleted all over the kernel 745 + source tree when "make clean" is executed. 761 746 762 747 Additional files or directories can be specified in kbuild makefiles by use of 763 748 $(clean-files). ··· 1252 1269 Example:: 1253 1270 1254 1271 #arch/x86/kernel/Makefile 1255 - always := vmlinux.lds 1272 + extra-y := vmlinux.lds 1256 1273 1257 1274 #Makefile 1258 1275 export CPPFLAGS_vmlinux.lds += -P -C -U$(ARCH) 1259 1276 1260 - The assignment to $(always) is used to tell kbuild to build the 1277 + The assignment to extra-y is used to tell kbuild to build the 1261 1278 target vmlinux.lds. 1262 1279 The assignment to $(CPPFLAGS_vmlinux.lds) tells kbuild to use the 1263 1280 specified options when building the target vmlinux.lds.
+4 -4
Kbuild
··· 7 7 8 8 bounds-file := include/generated/bounds.h 9 9 10 - always := $(bounds-file) 10 + always-y := $(bounds-file) 11 11 targets := kernel/bounds.s 12 12 13 13 $(bounds-file): kernel/bounds.s FORCE ··· 28 28 29 29 offsets-file := include/generated/asm-offsets.h 30 30 31 - always += $(offsets-file) 31 + always-y += $(offsets-file) 32 32 targets += arch/$(SRCARCH)/kernel/asm-offsets.s 33 33 34 34 arch/$(SRCARCH)/kernel/asm-offsets.s: $(timeconst-file) $(bounds-file) ··· 39 39 ##### 40 40 # Check for missing system calls 41 41 42 - always += missing-syscalls 42 + always-y += missing-syscalls 43 43 44 44 quiet_cmd_syscalls = CALL $< 45 45 cmd_syscalls = $(CONFIG_SHELL) $< $(CC) $(c_flags) $(missing_syscalls_flags) ··· 50 50 ##### 51 51 # Check atomic headers are up-to-date 52 52 53 - always += old-atomics 53 + always-y += old-atomics 54 54 55 55 quiet_cmd_atomics = CALL $< 56 56 cmd_atomics = $(CONFIG_SHELL) $<
+1 -1
Makefile
··· 1679 1679 descend: $(build-dirs) 1680 1680 $(build-dirs): prepare 1681 1681 $(Q)$(MAKE) $(build)=$@ \ 1682 - single-build=$(if $(filter-out $@/, $(single-no-ko)),1) \ 1682 + single-build=$(if $(filter-out $@/, $(filter $@/%, $(single-no-ko))),1) \ 1683 1683 need-builtin=1 need-modorder=1 1684 1684 1685 1685 clean-dirs := $(addprefix _clean_, $(clean-dirs))
+1 -1
arch/alpha/boot/Makefile
··· 8 8 # Copyright (C) 1994 by Linus Torvalds 9 9 # 10 10 11 - hostprogs-y := tools/mkbb tools/objstrip 11 + hostprogs := tools/mkbb tools/objstrip 12 12 targets := vmlinux.gz vmlinux \ 13 13 vmlinux.nh tools/lxboot tools/bootlx tools/bootph \ 14 14 tools/bootpzh bootloader bootpheader bootpzheader
+1 -1
arch/arm/vdso/Makefile
··· 5 5 ARCH_REL_TYPE_ABS := R_ARM_JUMP_SLOT|R_ARM_GLOB_DAT|R_ARM_ABS32 6 6 include $(srctree)/lib/vdso/Makefile 7 7 8 - hostprogs-y := vdsomunge 8 + hostprogs := vdsomunge 9 9 10 10 obj-vdso := vgettimeofday.o datapage.o note.o 11 11
+2 -2
arch/arm64/kernel/vdso32/Makefile
··· 115 115 116 116 # Borrow vdsomunge.c from the arm vDSO 117 117 # We have to use a relative path because scripts/Makefile.host prefixes 118 - # $(hostprogs-y) with $(obj) 118 + # $(hostprogs) with $(obj) 119 119 munge := ../../../arm/vdso/vdsomunge 120 - hostprogs-y := $(munge) 120 + hostprogs := $(munge) 121 121 122 122 c-obj-vdso := note.o 123 123 c-obj-vdso-gettimeofday := vgettimeofday.o
+1 -1
arch/mips/boot/Makefile
··· 21 21 drop-sections := .reginfo .mdebug .comment .note .pdr .options .MIPS.options 22 22 strip-flags := $(addprefix --remove-section=,$(drop-sections)) 23 23 24 - hostprogs-y := elf2ecoff 24 + hostprogs := elf2ecoff 25 25 26 26 suffix-y := bin 27 27 suffix-$(CONFIG_KERNEL_BZIP2) := bz2
+2 -2
arch/mips/boot/compressed/Makefile
··· 84 84 HOSTCFLAGS_calc_vmlinuz_load_addr.o += $(LINUXINCLUDE) 85 85 86 86 # Calculate the load address of the compressed kernel image 87 - hostprogs-y := calc_vmlinuz_load_addr 87 + hostprogs := calc_vmlinuz_load_addr 88 88 89 89 ifneq ($(zload-y),) 90 90 VMLINUZ_LOAD_ADDRESS := $(zload-y) ··· 112 112 endif 113 113 114 114 # elf2ecoff can only handle 32bit image 115 - hostprogs-y += ../elf2ecoff 115 + hostprogs += ../elf2ecoff 116 116 117 117 ifdef CONFIG_32BIT 118 118 VMLINUZ = vmlinuz
+1 -1
arch/mips/boot/tools/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 3 - hostprogs-y += relocs 3 + hostprogs += relocs 4 4 relocs-objs += relocs_32.o 5 5 relocs-objs += relocs_64.o 6 6 relocs-objs += relocs_main.o
+2 -2
arch/mips/tools/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 - hostprogs-y := elf-entry 2 + hostprogs := elf-entry 3 3 PHONY += elf-entry 4 4 elf-entry: $(obj)/elf-entry 5 5 @: 6 6 7 - hostprogs-$(CONFIG_CPU_LOONGSON3_WORKAROUNDS) += loongson3-llsc-check 7 + hostprogs += loongson3-llsc-check 8 8 PHONY += loongson3-llsc-check 9 9 loongson3-llsc-check: $(obj)/loongson3-llsc-check 10 10 @:
+1 -1
arch/mips/vdso/Makefile
··· 100 100 $(obj)/%.so.raw: $(obj)/%.so.dbg.raw FORCE 101 101 $(call if_changed,objcopy) 102 102 103 - hostprogs-y := genvdso 103 + hostprogs := genvdso 104 104 105 105 quiet_cmd_genvdso = GENVDSO $@ 106 106 define cmd_genvdso
+2 -2
arch/powerpc/boot/Makefile
··· 224 224 $(obj)/wrapper.a: $(obj-wlib) FORCE 225 225 $(call if_changed,bootar) 226 226 227 - hostprogs-y := addnote hack-coff mktree 227 + hostprogs := addnote hack-coff mktree 228 228 229 229 targets += $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a) 230 230 extra-y := $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \ ··· 464 464 INSTALL := install 465 465 466 466 extra-installed := $(patsubst $(obj)/%, $(DESTDIR)$(WRAPPER_OBJDIR)/%, $(extra-y)) 467 - hostprogs-installed := $(patsubst %, $(DESTDIR)$(WRAPPER_BINDIR)/%, $(hostprogs-y)) 467 + hostprogs-installed := $(patsubst %, $(DESTDIR)$(WRAPPER_BINDIR)/%, $(hostprogs)) 468 468 wrapper-installed := $(DESTDIR)$(WRAPPER_BINDIR)/wrapper 469 469 dts-installed := $(patsubst $(dtstree)/%, $(DESTDIR)$(WRAPPER_DTSDIR)/%, $(wildcard $(dtstree)/*.dts)) 470 470
+2 -2
arch/s390/tools/Makefile
··· 10 10 11 11 kapi: $(kapi-hdrs-y) 12 12 13 - hostprogs-y += gen_facilities 14 - hostprogs-y += gen_opcode_table 13 + hostprogs += gen_facilities 14 + hostprogs += gen_opcode_table 15 15 16 16 HOSTCFLAGS_gen_facilities.o += $(LINUXINCLUDE) 17 17
+1 -1
arch/sparc/boot/Makefile
··· 7 7 ROOT_IMG := /usr/src/root.img 8 8 ELFTOAOUT := elftoaout 9 9 10 - hostprogs-y := piggyback 10 + hostprogs := piggyback 11 11 targets := tftpboot.img image zImage vmlinux.aout 12 12 clean-files := System.map 13 13
+1 -1
arch/sparc/vdso/Makefile
··· 41 41 $(call if_changed,vdso) 42 42 43 43 HOST_EXTRACFLAGS += -I$(srctree)/tools/include 44 - hostprogs-y += vdso2c 44 + hostprogs += vdso2c 45 45 46 46 quiet_cmd_vdso2c = VDSO2C $@ 47 47 cmd_vdso2c = $(obj)/vdso2c $< $(<:%.dbg=%) $@
+2 -2
arch/x86/boot/Makefile
··· 45 45 setup-y += video-bios.o 46 46 47 47 targets += $(setup-y) 48 - hostprogs-y := tools/build 49 - hostprogs-$(CONFIG_X86_FEATURE_NAMES) += mkcpustr 48 + hostprogs := tools/build 49 + hostprogs += mkcpustr 50 50 51 51 HOST_EXTRACFLAGS += -I$(srctree)/tools/include \ 52 52 -include include/generated/autoconf.h \
+1 -1
arch/x86/boot/compressed/Makefile
··· 58 58 endif 59 59 LDFLAGS_vmlinux := -T 60 60 61 - hostprogs-y := mkpiggy 61 + hostprogs := mkpiggy 62 62 HOST_EXTRACFLAGS += -I$(srctree)/tools/include 63 63 64 64 sed-voffset := -e 's/^\([0-9a-fA-F]*\) [ABCDGRSTVW] \(_text\|__bss_start\|_end\)$$/\#define VO_\2 _AC(0x\1,UL)/p'
+1 -1
arch/x86/entry/vdso/Makefile
··· 59 59 $(call if_changed,vdso_and_check) 60 60 61 61 HOST_EXTRACFLAGS += -I$(srctree)/tools/include -I$(srctree)/include/uapi -I$(srctree)/arch/$(SUBARCH)/include/uapi 62 - hostprogs-y += vdso2c 62 + hostprogs += vdso2c 63 63 64 64 quiet_cmd_vdso2c = VDSO2C $@ 65 65 cmd_vdso2c = $(obj)/vdso2c $< $(<:%.dbg=%) $@
+1 -1
arch/x86/realmode/rm/Makefile
··· 12 12 # Prevents link failures: __sanitizer_cov_trace_pc() is not linked in. 13 13 KCOV_INSTRUMENT := n 14 14 15 - always := realmode.bin realmode.relocs 15 + always-y := realmode.bin realmode.relocs 16 16 17 17 wakeup-objs := wakeup_asm.o wakemain.o video-mode.o 18 18 wakeup-objs += copy.o bioscall.o regs.o
+2 -2
arch/x86/tools/Makefile
··· 26 26 $(call cmd,posttest) 27 27 $(call cmd,sanitytest) 28 28 29 - hostprogs-y += insn_decoder_test insn_sanity 29 + hostprogs += insn_decoder_test insn_sanity 30 30 31 31 # -I needed for generated C source and C source which in the kernel tree. 32 32 HOSTCFLAGS_insn_decoder_test.o := -Wall -I$(objtree)/arch/x86/lib/ -I$(srctree)/arch/x86/include/uapi/ -I$(srctree)/arch/x86/include/ -I$(srctree)/arch/x86/lib/ -I$(srctree)/include/uapi/ ··· 39 39 $(obj)/insn_sanity.o: $(srctree)/arch/x86/lib/insn.c $(srctree)/arch/x86/lib/inat.c $(srctree)/arch/x86/include/asm/inat_types.h $(srctree)/arch/x86/include/asm/inat.h $(srctree)/arch/x86/include/asm/insn.h $(objtree)/arch/x86/lib/inat-tables.c 40 40 41 41 HOST_EXTRACFLAGS += -I$(srctree)/tools/include 42 - hostprogs-y += relocs 42 + hostprogs += relocs 43 43 relocs-objs := relocs_32.o relocs_64.o relocs_common.o 44 44 PHONY += relocs 45 45 relocs: $(obj)/relocs
+1 -1
drivers/gpu/drm/radeon/Makefile
··· 5 5 6 6 ccflags-y := -Idrivers/gpu/drm/amd/include 7 7 8 - hostprogs-y := mkregtable 8 + hostprogs := mkregtable 9 9 clean-files := rn50_reg_safe.h r100_reg_safe.h r200_reg_safe.h rv515_reg_safe.h r300_reg_safe.h r420_reg_safe.h rs600_reg_safe.h r600_reg_safe.h evergreen_reg_safe.h cayman_reg_safe.h 10 10 11 11 quiet_cmd_mkregtable = MKREGTABLE $@
+1 -1
drivers/tty/vt/Makefile
··· 12 12 # Files generated that shall be removed upon make clean 13 13 clean-files := consolemap_deftbl.c defkeymap.c 14 14 15 - hostprogs-y += conmakehash 15 + hostprogs += conmakehash 16 16 17 17 quiet_cmd_conmk = CONMK $@ 18 18 cmd_conmk = $(obj)/conmakehash $< > $@
+1 -1
drivers/video/logo/Makefile
··· 18 18 19 19 # How to generate logo's 20 20 21 - hostprogs-y := pnmtologo 21 + hostprogs := pnmtologo 22 22 23 23 # Create commands like "pnmtologo -t mono -n logo_mac_mono -o ..." 24 24 quiet_cmd_logo = LOGO $@
+1 -1
drivers/zorro/Makefile
··· 7 7 obj-$(CONFIG_PROC_FS) += proc.o 8 8 obj-$(CONFIG_ZORRO_NAMES) += names.o 9 9 10 - hostprogs-y := gen-devlist 10 + hostprogs := gen-devlist 11 11 12 12 # Files generated that shall be removed upon make clean 13 13 clean-files := devlist.h
+1 -1
fs/unicode/Makefile
··· 35 35 endif 36 36 37 37 targets += utf8data.h 38 - hostprogs-y += mkutf8data 38 + hostprogs += mkutf8data
+3 -2
kernel/kallsyms.c
··· 44 44 extern const unsigned long kallsyms_relative_base 45 45 __attribute__((weak, section(".rodata"))); 46 46 47 - extern const u8 kallsyms_token_table[] __weak; 47 + extern const char kallsyms_token_table[] __weak; 48 48 extern const u16 kallsyms_token_index[] __weak; 49 49 50 50 extern const unsigned int kallsyms_markers[] __weak; ··· 58 58 char *result, size_t maxlen) 59 59 { 60 60 int len, skipped_first = 0; 61 - const u8 *tptr, *data; 61 + const char *tptr; 62 + const u8 *data; 62 63 63 64 /* Get the compressed symbol length from the first symbol byte. */ 64 65 data = &kallsyms_names[off];
+2 -2
lib/Makefile
··· 241 241 242 242 obj-$(CONFIG_FONT_SUPPORT) += fonts/ 243 243 244 - hostprogs-y := gen_crc32table 245 - hostprogs-y += gen_crc64table 244 + hostprogs := gen_crc32table 245 + hostprogs += gen_crc64table 246 246 clean-files := crc32table.h 247 247 clean-files += crc64table.h 248 248
+1 -1
lib/raid6/Makefile
··· 10 10 raid6_pq-$(CONFIG_KERNEL_MODE_NEON) += neon.o neon1.o neon2.o neon4.o neon8.o recov_neon.o recov_neon_inner.o 11 11 raid6_pq-$(CONFIG_S390) += s390vx8.o recov_s390xc.o 12 12 13 - hostprogs-y += mktables 13 + hostprogs += mktables 14 14 15 15 ifeq ($(CONFIG_ALTIVEC),y) 16 16 altivec_flags := -maltivec $(call cc-option,-mabi=altivec)
+1 -1
net/bpfilter/Makefile
··· 3 3 # Makefile for the Linux BPFILTER layer. 4 4 # 5 5 6 - hostprogs-y := bpfilter_umh 6 + hostprogs := bpfilter_umh 7 7 bpfilter_umh-objs := main.o 8 8 KBUILD_HOSTCFLAGS += -I $(srctree)/tools/include/ -I $(srctree)/tools/include/uapi 9 9 HOSTCC := $(CC)
+59 -59
samples/bpf/Makefile
··· 111 111 hbm-objs := bpf_load.o hbm.o $(CGROUP_HELPERS) 112 112 113 113 # Tell kbuild to always build the programs 114 - always := $(tprogs-y) 115 - always += sockex1_kern.o 116 - always += sockex2_kern.o 117 - always += sockex3_kern.o 118 - always += tracex1_kern.o 119 - always += tracex2_kern.o 120 - always += tracex3_kern.o 121 - always += tracex4_kern.o 122 - always += tracex5_kern.o 123 - always += tracex6_kern.o 124 - always += tracex7_kern.o 125 - always += sock_flags_kern.o 126 - always += test_probe_write_user_kern.o 127 - always += trace_output_kern.o 128 - always += tcbpf1_kern.o 129 - always += tc_l2_redirect_kern.o 130 - always += lathist_kern.o 131 - always += offwaketime_kern.o 132 - always += spintest_kern.o 133 - always += map_perf_test_kern.o 134 - always += test_overhead_tp_kern.o 135 - always += test_overhead_raw_tp_kern.o 136 - always += test_overhead_kprobe_kern.o 137 - always += parse_varlen.o parse_simple.o parse_ldabs.o 138 - always += test_cgrp2_tc_kern.o 139 - always += xdp1_kern.o 140 - always += xdp2_kern.o 141 - always += xdp_router_ipv4_kern.o 142 - always += test_current_task_under_cgroup_kern.o 143 - always += trace_event_kern.o 144 - always += sampleip_kern.o 145 - always += lwt_len_hist_kern.o 146 - always += xdp_tx_iptunnel_kern.o 147 - always += test_map_in_map_kern.o 148 - always += tcp_synrto_kern.o 149 - always += tcp_rwnd_kern.o 150 - always += tcp_bufs_kern.o 151 - always += tcp_cong_kern.o 152 - always += tcp_iw_kern.o 153 - always += tcp_clamp_kern.o 154 - always += tcp_basertt_kern.o 155 - always += tcp_tos_reflect_kern.o 156 - always += tcp_dumpstats_kern.o 157 - always += xdp_redirect_kern.o 158 - always += xdp_redirect_map_kern.o 159 - always += xdp_redirect_cpu_kern.o 160 - always += xdp_monitor_kern.o 161 - always += xdp_rxq_info_kern.o 162 - always += xdp2skb_meta_kern.o 163 - always += syscall_tp_kern.o 164 - always += cpustat_kern.o 165 - always += xdp_adjust_tail_kern.o 166 - always += xdp_fwd_kern.o 167 - always += task_fd_query_kern.o 168 - always += xdp_sample_pkts_kern.o 169 - always += ibumad_kern.o 170 - always += hbm_out_kern.o 171 - always += hbm_edt_kern.o 172 - always += xdpsock_kern.o 114 + always-y := $(tprogs-y) 115 + always-y += sockex1_kern.o 116 + always-y += sockex2_kern.o 117 + always-y += sockex3_kern.o 118 + always-y += tracex1_kern.o 119 + always-y += tracex2_kern.o 120 + always-y += tracex3_kern.o 121 + always-y += tracex4_kern.o 122 + always-y += tracex5_kern.o 123 + always-y += tracex6_kern.o 124 + always-y += tracex7_kern.o 125 + always-y += sock_flags_kern.o 126 + always-y += test_probe_write_user_kern.o 127 + always-y += trace_output_kern.o 128 + always-y += tcbpf1_kern.o 129 + always-y += tc_l2_redirect_kern.o 130 + always-y += lathist_kern.o 131 + always-y += offwaketime_kern.o 132 + always-y += spintest_kern.o 133 + always-y += map_perf_test_kern.o 134 + always-y += test_overhead_tp_kern.o 135 + always-y += test_overhead_raw_tp_kern.o 136 + always-y += test_overhead_kprobe_kern.o 137 + always-y += parse_varlen.o parse_simple.o parse_ldabs.o 138 + always-y += test_cgrp2_tc_kern.o 139 + always-y += xdp1_kern.o 140 + always-y += xdp2_kern.o 141 + always-y += xdp_router_ipv4_kern.o 142 + always-y += test_current_task_under_cgroup_kern.o 143 + always-y += trace_event_kern.o 144 + always-y += sampleip_kern.o 145 + always-y += lwt_len_hist_kern.o 146 + always-y += xdp_tx_iptunnel_kern.o 147 + always-y += test_map_in_map_kern.o 148 + always-y += tcp_synrto_kern.o 149 + always-y += tcp_rwnd_kern.o 150 + always-y += tcp_bufs_kern.o 151 + always-y += tcp_cong_kern.o 152 + always-y += tcp_iw_kern.o 153 + always-y += tcp_clamp_kern.o 154 + always-y += tcp_basertt_kern.o 155 + always-y += tcp_tos_reflect_kern.o 156 + always-y += tcp_dumpstats_kern.o 157 + always-y += xdp_redirect_kern.o 158 + always-y += xdp_redirect_map_kern.o 159 + always-y += xdp_redirect_cpu_kern.o 160 + always-y += xdp_monitor_kern.o 161 + always-y += xdp_rxq_info_kern.o 162 + always-y += xdp2skb_meta_kern.o 163 + always-y += syscall_tp_kern.o 164 + always-y += cpustat_kern.o 165 + always-y += xdp_adjust_tail_kern.o 166 + always-y += xdp_fwd_kern.o 167 + always-y += task_fd_query_kern.o 168 + always-y += xdp_sample_pkts_kern.o 169 + always-y += ibumad_kern.o 170 + always-y += hbm_out_kern.o 171 + always-y += hbm_edt_kern.o 172 + always-y += xdpsock_kern.o 173 173 174 174 ifeq ($(ARCH), arm) 175 175 # Strip all except -D__LINUX_ARM_ARCH__ option needed to handle linux
+2 -6
samples/connector/Makefile
··· 2 2 obj-$(CONFIG_SAMPLE_CONNECTOR) += cn_test.o 3 3 4 4 # List of programs to build 5 - ifdef CONFIG_SAMPLE_CONNECTOR 6 - hostprogs-y := ucon 7 - endif 8 - 9 - # Tell kbuild to always build the programs 10 - always := $(hostprogs-y) 5 + hostprogs := ucon 6 + always-y := $(hostprogs) 11 7 12 8 HOSTCFLAGS_ucon.o += -I$(objtree)/usr/include 13 9
+2 -4
samples/hidraw/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 # List of programs to build 3 - hostprogs-y := hid-example 4 - 5 - # Tell kbuild to always build the programs 6 - always := $(hostprogs-y) 3 + hostprogs := hid-example 4 + always-y := $(hostprogs) 7 5 8 6 HOSTCFLAGS_hid-example.o += -I$(objtree)/usr/include 9 7
+2 -2
samples/mei/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 # Copyright (c) 2012-2019, Intel Corporation. All rights reserved. 3 3 4 - hostprogs-y := mei-amt-version 4 + hostprogs := mei-amt-version 5 5 6 6 HOSTCFLAGS_mei-amt-version.o += -I$(objtree)/usr/include 7 7 8 - always := $(hostprogs-y) 8 + always-y := $(hostprogs) 9 9 10 10 all: mei-amt-version
+2 -2
samples/pidfd/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 3 - hostprogs-y := pidfd-metadata 4 - always := $(hostprogs-y) 3 + hostprogs := pidfd-metadata 4 + always-y := $(hostprogs) 5 5 HOSTCFLAGS_pidfd-metadata.o += -I$(objtree)/usr/include 6 6 all: pidfd-metadata
+2 -2
samples/seccomp/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 ifndef CROSS_COMPILE 3 - hostprogs-y := bpf-fancy dropper bpf-direct user-trap 3 + hostprogs := bpf-fancy dropper bpf-direct user-trap 4 4 5 5 HOSTCFLAGS_bpf-fancy.o += -I$(objtree)/usr/include 6 6 HOSTCFLAGS_bpf-fancy.o += -idirafter $(objtree)/include ··· 40 40 HOSTLDLIBS_dropper += $(MFLAG) 41 41 HOSTLDLIBS_user-trap += $(MFLAG) 42 42 endif 43 - always := $(hostprogs-y) 43 + always-y := $(hostprogs) 44 44 endif
+2 -2
samples/uhid/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 2 # List of programs to build 3 - hostprogs-y := uhid-example 3 + hostprogs := uhid-example 4 4 5 5 # Tell kbuild to always build the programs 6 - always := $(hostprogs-y) 6 + always-y := $(hostprogs) 7 7 8 8 HOSTCFLAGS_uhid-example.o += -I$(objtree)/usr/include
+2 -3
samples/vfs/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 2 # List of programs to build 3 - hostprogs-y := \ 3 + hostprogs := \ 4 4 test-fsmount \ 5 5 test-statx 6 6 7 - # Tell kbuild to always build the programs 8 - always := $(hostprogs-y) 7 + always-y := $(hostprogs) 9 8 10 9 HOSTCFLAGS_test-fsmount.o += -I$(objtree)/usr/include 11 10 HOSTCFLAGS_test-statx.o += -I$(objtree)/usr/include
+11 -11
scripts/Makefile
··· 7 7 8 8 HOST_EXTRACFLAGS += -I$(srctree)/tools/include 9 9 10 - hostprogs-$(CONFIG_BUILD_BIN2C) += bin2c 11 - hostprogs-$(CONFIG_KALLSYMS) += kallsyms 12 - hostprogs-$(BUILD_C_RECORDMCOUNT) += recordmcount 13 - hostprogs-$(CONFIG_BUILDTIME_TABLE_SORT) += sorttable 14 - hostprogs-$(CONFIG_ASN1) += asn1_compiler 15 - hostprogs-$(CONFIG_MODULE_SIG_FORMAT) += sign-file 16 - hostprogs-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += extract-cert 17 - hostprogs-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert 10 + always-$(CONFIG_BUILD_BIN2C) += bin2c 11 + always-$(CONFIG_KALLSYMS) += kallsyms 12 + always-$(BUILD_C_RECORDMCOUNT) += recordmcount 13 + always-$(CONFIG_BUILDTIME_TABLE_SORT) += sorttable 14 + always-$(CONFIG_ASN1) += asn1_compiler 15 + always-$(CONFIG_MODULE_SIG_FORMAT) += sign-file 16 + always-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += extract-cert 17 + always-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert 18 18 19 19 HOSTCFLAGS_sorttable.o = -I$(srctree)/tools/include 20 20 HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include ··· 30 30 HOSTLDLIBS_sorttable = -lpthread 31 31 endif 32 32 33 - always := $(hostprogs-y) $(hostprogs-m) 33 + hostprogs := $(always-y) $(always-m) 34 34 35 - # The following hostprogs-y programs are only build on demand 36 - hostprogs-y += unifdef 35 + # The following programs are only built on demand 36 + hostprogs += unifdef 37 37 38 38 subdir-$(CONFIG_GCC_PLUGINS) += gcc-plugins 39 39 subdir-$(CONFIG_MODVERSIONS) += genksyms
+5 -3
scripts/Makefile.build
··· 16 16 lib-y := 17 17 lib-m := 18 18 always := 19 + always-y := 20 + always-m := 19 21 targets := 20 22 subdir-y := 21 23 subdir-m := ··· 46 44 include scripts/Makefile.lib 47 45 48 46 # Do not include host rules unless needed 49 - ifneq ($(hostprogs-y)$(hostprogs-m)$(hostlibs-y)$(hostlibs-m)$(hostcxxlibs-y)$(hostcxxlibs-m),) 47 + ifneq ($(hostprogs)$(hostlibs-y)$(hostlibs-m)$(hostcxxlibs-y)$(hostcxxlibs-m),) 50 48 include scripts/Makefile.host 51 49 endif 52 50 ··· 350 348 $(call if_changed_rule,as_o_S) 351 349 352 350 targets += $(filter-out $(subdir-obj-y), $(real-obj-y)) $(real-obj-m) $(lib-y) 353 - targets += $(extra-y) $(MAKECMDGOALS) $(always) 351 + targets += $(extra-y) $(always-y) $(MAKECMDGOALS) 354 352 355 353 # Linker scripts preprocessor (.lds.S -> .lds) 356 354 # --------------------------------------------------------------------------- ··· 492 490 493 491 __build: $(if $(KBUILD_BUILTIN),$(builtin-target) $(lib-target) $(extra-y)) \ 494 492 $(if $(KBUILD_MODULES),$(obj-m) $(mod-targets) $(modorder-target)) \ 495 - $(subdir-ym) $(always) 493 + $(subdir-ym) $(always-y) 496 494 @: 497 495 498 496 endif
+2 -2
scripts/Makefile.clean
··· 28 28 # directory 29 29 30 30 __clean-files := $(extra-y) $(extra-m) $(extra-) \ 31 - $(always) $(targets) $(clean-files) \ 32 - $(hostprogs-y) $(hostprogs-m) $(hostprogs-) \ 31 + $(always) $(always-y) $(always-m) $(always-) $(targets) $(clean-files) \ 32 + $(hostprogs) $(hostprogs-y) $(hostprogs-m) $(hostprogs-) \ 33 33 $(hostlibs-y) $(hostlibs-m) $(hostlibs-) \ 34 34 $(hostcxxlibs-y) $(hostcxxlibs-m) 35 35
+4 -4
scripts/Makefile.host
··· 24 24 # Both C and C++ are supported, but preferred language is C for such utilities. 25 25 # 26 26 # Sample syntax (see Documentation/kbuild/makefiles.rst for reference) 27 - # hostprogs-y := bin2hex 27 + # hostprogs := bin2hex 28 28 # Will compile bin2hex.c and create an executable named bin2hex 29 29 # 30 - # hostprogs-y := lxdialog 30 + # hostprogs := lxdialog 31 31 # lxdialog-objs := checklist.o lxdialog.o 32 32 # Will compile lxdialog.c and checklist.c, and then link the executable 33 33 # lxdialog, based on checklist.o and lxdialog.o 34 34 # 35 - # hostprogs-y := qconf 35 + # hostprogs := qconf 36 36 # qconf-cxxobjs := qconf.o 37 37 # qconf-objs := menu.o 38 38 # Will compile qconf as a C++ program, and menu as a C program. 39 39 # They are linked as C++ code to the executable qconf 40 40 41 - __hostprogs := $(sort $(hostprogs-y) $(hostprogs-m)) 41 + __hostprogs := $(sort $(hostprogs)) 42 42 host-cshlib := $(sort $(hostlibs-y) $(hostlibs-m)) 43 43 host-cxxshlib := $(sort $(hostcxxlibs-y) $(hostcxxlibs-m)) 44 44
+5 -1
scripts/Makefile.lib
··· 4 4 ccflags-y += $(EXTRA_CFLAGS) 5 5 cppflags-y += $(EXTRA_CPPFLAGS) 6 6 ldflags-y += $(EXTRA_LDFLAGS) 7 + always-y += $(always) 8 + hostprogs += $(hostprogs-y) $(hostprogs-m) 7 9 8 10 # flags that take effect in current and sub directories 9 11 KBUILD_AFLAGS += $(subdir-asflags-y) ··· 61 59 real-obj-y := $(foreach m, $(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m))) 62 60 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))) 63 61 62 + always-y += $(always-m) 63 + 64 64 # DTB 65 65 # If CONFIG_OF_ALL_DTBS is enabled, all DT blobs are built 66 66 extra-y += $(dtb-y) ··· 76 72 # Add subdir path 77 73 78 74 extra-y := $(addprefix $(obj)/,$(extra-y)) 79 - always := $(addprefix $(obj)/,$(always)) 75 + always-y := $(addprefix $(obj)/,$(always-y)) 80 76 targets := $(addprefix $(obj)/,$(targets)) 81 77 modorder := $(addprefix $(obj)/,$(modorder)) 82 78 obj-m := $(addprefix $(obj)/,$(obj-m))
+2 -2
scripts/basic/Makefile
··· 2 2 # 3 3 # fixdep: used to generate dependency information during build process 4 4 5 - hostprogs-y := fixdep 6 - always := $(hostprogs-y) 5 + hostprogs := fixdep 6 + always-y := $(hostprogs)
+2 -2
scripts/dtc/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 # scripts/dtc makefile 3 3 4 - hostprogs-$(CONFIG_DTC) := dtc 5 - always := $(hostprogs-y) 4 + hostprogs := dtc 5 + always-$(CONFIG_DTC) := $(hostprogs) 6 6 7 7 dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \ 8 8 srcpos.o checks.o util.o
+1 -1
scripts/gcc-plugins/Makefile
··· 23 23 targets = randomize_layout_seed.h randomize_layout_hash.h 24 24 25 25 $(HOSTLIBS)-y := $(foreach p,$(GCC_PLUGIN),$(if $(findstring /,$(p)),,$(p))) 26 - always := $($(HOSTLIBS)-y) 26 + always-y := $($(HOSTLIBS)-y) 27 27 28 28 $(foreach p,$($(HOSTLIBS)-y:%.so=%),$(eval $(p)-objs := $(p).o)) 29 29
+2 -2
scripts/genksyms/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 3 - hostprogs-y := genksyms 4 - always := $(hostprogs-y) 3 + hostprogs := genksyms 4 + always-y := $(hostprogs) 5 5 6 6 genksyms-objs := genksyms.o parse.tab.o lex.lex.o 7 7
+71 -62
scripts/kallsyms.c
··· 33 33 unsigned long long addr; 34 34 unsigned int len; 35 35 unsigned int start_pos; 36 - unsigned char *sym; 37 36 unsigned int percpu_absolute; 37 + unsigned char sym[0]; 38 38 }; 39 39 40 40 struct addr_range { ··· 55 55 "__per_cpu_start", "__per_cpu_end", -1ULL, 0 56 56 }; 57 57 58 - static struct sym_entry *table; 58 + static struct sym_entry **table; 59 59 static unsigned int table_size, table_cnt; 60 60 static int all_symbols; 61 61 static int absolute_percpu; ··· 174 174 } 175 175 } 176 176 177 - static int read_symbol(FILE *in, struct sym_entry *s) 177 + static struct sym_entry *read_symbol(FILE *in) 178 178 { 179 - char sym[500], stype; 179 + char name[500], type; 180 + unsigned long long addr; 181 + unsigned int len; 182 + struct sym_entry *sym; 180 183 int rc; 181 184 182 - rc = fscanf(in, "%llx %c %499s\n", &s->addr, &stype, sym); 185 + rc = fscanf(in, "%llx %c %499s\n", &addr, &type, name); 183 186 if (rc != 3) { 184 - if (rc != EOF && fgets(sym, 500, in) == NULL) 187 + if (rc != EOF && fgets(name, 500, in) == NULL) 185 188 fprintf(stderr, "Read error or end of file.\n"); 186 - return -1; 189 + return NULL; 187 190 } 188 - if (strlen(sym) >= KSYM_NAME_LEN) { 191 + if (strlen(name) >= KSYM_NAME_LEN) { 189 192 fprintf(stderr, "Symbol %s too long for kallsyms (%zu >= %d).\n" 190 193 "Please increase KSYM_NAME_LEN both in kernel and kallsyms.c\n", 191 - sym, strlen(sym), KSYM_NAME_LEN); 192 - return -1; 194 + name, strlen(name), KSYM_NAME_LEN); 195 + return NULL; 193 196 } 194 197 195 - if (is_ignored_symbol(sym, stype)) 196 - return -1; 198 + if (is_ignored_symbol(name, type)) 199 + return NULL; 197 200 198 201 /* Ignore most absolute/undefined (?) symbols. */ 199 - if (strcmp(sym, "_text") == 0) 200 - _text = s->addr; 202 + if (strcmp(name, "_text") == 0) 203 + _text = addr; 201 204 202 - check_symbol_range(sym, s->addr, text_ranges, ARRAY_SIZE(text_ranges)); 203 - check_symbol_range(sym, s->addr, &percpu_range, 1); 205 + check_symbol_range(name, addr, text_ranges, ARRAY_SIZE(text_ranges)); 206 + check_symbol_range(name, addr, &percpu_range, 1); 204 207 205 208 /* include the type field in the symbol name, so that it gets 206 209 * compressed together */ 207 - s->len = strlen(sym) + 1; 208 - s->sym = malloc(s->len + 1); 209 - if (!s->sym) { 210 + 211 + len = strlen(name) + 1; 212 + 213 + sym = malloc(sizeof(*sym) + len); 214 + if (!sym) { 210 215 fprintf(stderr, "kallsyms failure: " 211 216 "unable to allocate required amount of memory\n"); 212 217 exit(EXIT_FAILURE); 213 218 } 214 - strcpy(sym_name(s), sym); 215 - s->sym[0] = stype; 219 + sym->addr = addr; 220 + sym->len = len; 221 + sym->sym[0] = type; 222 + memcpy(sym_name(sym), name, len); 223 + sym->percpu_absolute = 0; 216 224 217 - s->percpu_absolute = 0; 218 - 219 - return 0; 225 + return sym; 220 226 } 221 227 222 228 static int symbol_in_range(const struct sym_entry *s, ··· 274 268 275 269 pos = 0; 276 270 for (i = 0; i < table_cnt; i++) { 277 - if (symbol_valid(&table[i])) { 271 + if (symbol_valid(table[i])) { 278 272 if (pos != i) 279 273 table[pos] = table[i]; 280 274 pos++; 281 275 } else { 282 - free(table[i].sym); 276 + free(table[i]); 283 277 } 284 278 } 285 279 table_cnt = pos; ··· 293 287 294 288 static void read_map(FILE *in) 295 289 { 290 + struct sym_entry *sym; 291 + 296 292 while (!feof(in)) { 293 + sym = read_symbol(in); 294 + if (!sym) 295 + continue; 296 + 297 + sym->start_pos = table_cnt; 298 + 297 299 if (table_cnt >= table_size) { 298 300 table_size += 10000; 299 301 table = realloc(table, sizeof(*table) * table_size); ··· 310 296 exit (1); 311 297 } 312 298 } 313 - if (read_symbol(in, &table[table_cnt]) == 0) { 314 - table[table_cnt].start_pos = table_cnt; 315 - table_cnt++; 316 - } 299 + 300 + table[table_cnt++] = sym; 317 301 } 318 302 } 319 303 ··· 399 387 int overflow; 400 388 401 389 if (!absolute_percpu) { 402 - offset = table[i].addr - relative_base; 390 + offset = table[i]->addr - relative_base; 403 391 overflow = (offset < 0 || offset > UINT_MAX); 404 - } else if (symbol_absolute(&table[i])) { 405 - offset = table[i].addr; 392 + } else if (symbol_absolute(table[i])) { 393 + offset = table[i]->addr; 406 394 overflow = (offset < 0 || offset > INT_MAX); 407 395 } else { 408 - offset = relative_base - table[i].addr - 1; 396 + offset = relative_base - table[i]->addr - 1; 409 397 overflow = (offset < INT_MIN || offset >= 0); 410 398 } 411 399 if (overflow) { 412 400 fprintf(stderr, "kallsyms failure: " 413 401 "%s symbol value %#llx out of range in relative mode\n", 414 - symbol_absolute(&table[i]) ? "absolute" : "relative", 415 - table[i].addr); 402 + symbol_absolute(table[i]) ? "absolute" : "relative", 403 + table[i]->addr); 416 404 exit(EXIT_FAILURE); 417 405 } 418 406 printf("\t.long\t%#x\n", (int)offset); 419 - } else if (!symbol_absolute(&table[i])) { 420 - output_address(table[i].addr); 407 + } else if (!symbol_absolute(table[i])) { 408 + output_address(table[i]->addr); 421 409 } else { 422 - printf("\tPTR\t%#llx\n", table[i].addr); 410 + printf("\tPTR\t%#llx\n", table[i]->addr); 423 411 } 424 412 } 425 413 printf("\n"); ··· 449 437 if ((i & 0xFF) == 0) 450 438 markers[i >> 8] = off; 451 439 452 - printf("\t.byte 0x%02x", table[i].len); 453 - for (k = 0; k < table[i].len; k++) 454 - printf(", 0x%02x", table[i].sym[k]); 440 + printf("\t.byte 0x%02x", table[i]->len); 441 + for (k = 0; k < table[i]->len; k++) 442 + printf(", 0x%02x", table[i]->sym[k]); 455 443 printf("\n"); 456 444 457 - off += table[i].len + 1; 445 + off += table[i]->len + 1; 458 446 } 459 447 printf("\n"); 460 448 ··· 508 496 unsigned int i; 509 497 510 498 for (i = 0; i < table_cnt; i++) 511 - learn_symbol(table[i].sym, table[i].len); 499 + learn_symbol(table[i]->sym, table[i]->len); 512 500 } 513 501 514 502 static unsigned char *find_token(unsigned char *str, int len, ··· 532 520 533 521 for (i = 0; i < table_cnt; i++) { 534 522 535 - len = table[i].len; 536 - p1 = table[i].sym; 523 + len = table[i]->len; 524 + p1 = table[i]->sym; 537 525 538 526 /* find the token on the symbol */ 539 527 p2 = find_token(p1, len, str); 540 528 if (!p2) continue; 541 529 542 530 /* decrease the counts for this symbol's tokens */ 543 - forget_symbol(table[i].sym, len); 531 + forget_symbol(table[i]->sym, len); 544 532 545 533 size = len; 546 534 ··· 559 547 560 548 } while (p2); 561 549 562 - table[i].len = len; 550 + table[i]->len = len; 563 551 564 552 /* increase the counts for this symbol's new tokens */ 565 - learn_symbol(table[i].sym, len); 553 + learn_symbol(table[i]->sym, len); 566 554 } 567 555 } 568 556 ··· 618 606 unsigned int i, j, c; 619 607 620 608 for (i = 0; i < table_cnt; i++) { 621 - for (j = 0; j < table[i].len; j++) { 622 - c = table[i].sym[j]; 609 + for (j = 0; j < table[i]->len; j++) { 610 + c = table[i]->sym[j]; 623 611 best_table[c][0]=c; 624 612 best_table_len[c]=1; 625 613 } ··· 672 660 673 661 static int compare_symbols(const void *a, const void *b) 674 662 { 675 - const struct sym_entry *sa; 676 - const struct sym_entry *sb; 663 + const struct sym_entry *sa = *(const struct sym_entry **)a; 664 + const struct sym_entry *sb = *(const struct sym_entry **)b; 677 665 int wa, wb; 678 - 679 - sa = a; 680 - sb = b; 681 666 682 667 /* sort by address first */ 683 668 if (sa->addr > sb->addr) ··· 706 697 707 698 static void sort_symbols(void) 708 699 { 709 - qsort(table, table_cnt, sizeof(struct sym_entry), compare_symbols); 700 + qsort(table, table_cnt, sizeof(table[0]), compare_symbols); 710 701 } 711 702 712 703 static void make_percpus_absolute(void) ··· 714 705 unsigned int i; 715 706 716 707 for (i = 0; i < table_cnt; i++) 717 - if (symbol_in_range(&table[i], &percpu_range, 1)) { 708 + if (symbol_in_range(table[i], &percpu_range, 1)) { 718 709 /* 719 710 * Keep the 'A' override for percpu symbols to 720 711 * ensure consistent behavior compared to older 721 712 * versions of this tool. 722 713 */ 723 - table[i].sym[0] = 'A'; 724 - table[i].percpu_absolute = 1; 714 + table[i]->sym[0] = 'A'; 715 + table[i]->percpu_absolute = 1; 725 716 } 726 717 } 727 718 ··· 731 722 unsigned int i; 732 723 733 724 for (i = 0; i < table_cnt; i++) 734 - if (!symbol_absolute(&table[i])) { 725 + if (!symbol_absolute(table[i])) { 735 726 /* 736 727 * The table is sorted by address. 737 728 * Take the first non-absolute symbol value. 738 729 */ 739 - relative_base = table[i].addr; 730 + relative_base = table[i]->addr; 740 731 return; 741 732 } 742 733 }
+5 -5
scripts/kconfig/Makefile
··· 157 157 HOSTCFLAGS_parser.tab.o := -I $(srctree)/$(src) 158 158 159 159 # conf: Used for defconfig, oldconfig and related targets 160 - hostprogs-y += conf 160 + hostprogs += conf 161 161 conf-objs := conf.o $(common-objs) 162 162 163 163 # nconf: Used for the nconfig target based on ncurses 164 - hostprogs-y += nconf 164 + hostprogs += nconf 165 165 nconf-objs := nconf.o nconf.gui.o $(common-objs) 166 166 167 167 HOSTLDLIBS_nconf = $(shell . $(obj)/nconf-cfg && echo $$libs) ··· 171 171 $(obj)/nconf.o $(obj)/nconf.gui.o: $(obj)/nconf-cfg 172 172 173 173 # mconf: Used for the menuconfig target based on lxdialog 174 - hostprogs-y += mconf 174 + hostprogs += mconf 175 175 lxdialog := $(addprefix lxdialog/, \ 176 176 checklist.o inputbox.o menubox.o textbox.o util.o yesno.o) 177 177 mconf-objs := mconf.o $(lxdialog) $(common-objs) ··· 183 183 $(addprefix $(obj)/, mconf.o $(lxdialog)): $(obj)/mconf-cfg 184 184 185 185 # qconf: Used for the xconfig target based on Qt 186 - hostprogs-y += qconf 186 + hostprogs += qconf 187 187 qconf-cxxobjs := qconf.o 188 188 qconf-objs := images.o $(common-objs) 189 189 ··· 199 199 $(call cmd,moc) 200 200 201 201 # gconf: Used for the gconfig target based on GTK+ 202 - hostprogs-y += gconf 202 + hostprogs += gconf 203 203 gconf-objs := gconf.o images.o $(common-objs) 204 204 205 205 HOSTLDLIBS_gconf = $(shell . $(obj)/gconf-cfg && echo $$libs)
+3 -4
scripts/kconfig/confdata.c
··· 1312 1312 1313 1313 sym_calc_value(csym); 1314 1314 if (mode == def_random) 1315 - has_changed = randomize_choice_values(csym); 1315 + has_changed |= randomize_choice_values(csym); 1316 1316 else { 1317 1317 set_all_choice_values(csym); 1318 1318 has_changed = true; ··· 1331 1331 1332 1332 for_all_symbols(i, sym) { 1333 1333 if (sym_get_type(sym) == S_TRISTATE && 1334 - sym->def[S_DEF_USER].tri == old_val) { 1334 + sym->def[S_DEF_USER].tri == old_val) 1335 1335 sym->def[S_DEF_USER].tri = new_val; 1336 - sym_add_change_count(1); 1337 - } 1338 1336 } 1337 + sym_clear_all_valid(); 1339 1338 }
+2 -2
scripts/mod/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 OBJECT_FILES_NON_STANDARD := y 3 3 4 - hostprogs-y := modpost mk_elfconfig 5 - always := $(hostprogs-y) empty.o 4 + hostprogs := modpost mk_elfconfig 5 + always-y := $(hostprogs) empty.o 6 6 7 7 modpost-objs := modpost.o file2alias.o sumversion.o 8 8
+2 -2
scripts/selinux/genheaders/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 - hostprogs-y := genheaders 2 + hostprogs := genheaders 3 3 HOST_EXTRACFLAGS += \ 4 4 -I$(srctree)/include/uapi -I$(srctree)/include \ 5 5 -I$(srctree)/security/selinux/include 6 6 7 - always := $(hostprogs-y) 7 + always-y := $(hostprogs)
+2 -2
scripts/selinux/mdp/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 - hostprogs-y := mdp 2 + hostprogs := mdp 3 3 HOST_EXTRACFLAGS += \ 4 4 -I$(srctree)/include/uapi -I$(srctree)/include \ 5 5 -I$(srctree)/security/selinux/include -I$(objtree)/include 6 6 7 - always := $(hostprogs-y) 7 + always-y := $(hostprogs) 8 8 clean-files := policy.* file_contexts
+1 -1
usr/Makefile
··· 52 52 53 53 cpio-data := $(obj)/initramfs_data.cpio 54 54 55 - hostprogs-y := gen_init_cpio 55 + hostprogs := gen_init_cpio 56 56 57 57 # .initramfs_data.cpio.d is used to identify all files included 58 58 # in initramfs and to detect if any files are added/removed.