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

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull Kbuild updates from Masahiro Yamada:

- Refactor scripts/kallsyms to make it faster and easier to maintain

- Clean up menuconfig

- Provide Clang with hard-coded target triple instead of CROSS_COMPILE

- Use -z pack-relative-relocs flags instead of --use-android-relr-tags
for arm64 CONFIG_RELR

- Add srcdeb-pkg target to build only a Debian source package

- Add KDEB_SOURCE_COMPRESS option to specify the compression for a
Debian source package

- Misc cleanups and fixes

* tag 'kbuild-v6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
kbuild: deb-pkg: specify targets in debian/rules as .PHONY
sparc: unify sparc32/sparc64 archhelp
kbuild: rpm-pkg: remove kernel-drm PROVIDES
kbuild: deb-pkg: add KDEB_SOURCE_COMPRESS to specify source compression
kbuild: add srcdeb-pkg target
Makefile: use -z pack-relative-relocs
kbuild: clang: do not use CROSS_COMPILE for target triple
kconfig: menuconfig: reorder functions to remove forward declarations
kconfig: menuconfig: remove unused M_EVENT macro
kconfig: menuconfig: remove OLD_NCURSES macro
kbuild: builddeb: Eliminate debian/arch use
scripts/kallsyms: update the usage in the comment block
scripts/kallsyms: decrease expand_symbol() / cleanup_symbol_name() calls
scripts/kallsyms: change the output order
scripts/kallsyms: move compiler-generated symbol patterns to mksysmap
scripts/kallsyms: exclude symbols generated by itself dynamically
scripts/mksysmap: use sed with in-line comments
scripts/mksysmap: remove comments described in nm(1)
scripts/kallsyms: remove redundant code for omitting U and N
kallsyms: expand symbol name into comment for debugging

+510 -582
+2 -1
Makefile
··· 1113 1113 endif 1114 1114 1115 1115 ifeq ($(CONFIG_RELR),y) 1116 - LDFLAGS_vmlinux += --pack-dyn-relocs=relr --use-android-relr-tags 1116 + # ld.lld before 15 did not support -z pack-relative-relocs. 1117 + LDFLAGS_vmlinux += $(call ld-option,--pack-dyn-relocs=relr,-z pack-relative-relocs) 1117 1118 endif 1118 1119 1119 1120 # We never want expected sections to be placed heuristically by the
+4 -11
arch/sparc/Makefile
··· 83 83 KBUILD_IMAGE := $(boot)/zImage 84 84 85 85 # Don't use tabs in echo arguments. 86 - ifeq ($(ARCH),sparc) 87 86 define archhelp 88 - echo '* image - kernel image ($(boot)/image)' 89 - echo '* zImage - stripped kernel image ($(boot)/zImage)' 87 + echo '* vmlinux - standard SPARC kernel' 88 + echo ' image - kernel image ($(boot)/image)' 89 + echo '* zImage - stripped/compressed kernel image ($(boot)/zImage)' 90 90 echo ' uImage - U-Boot SPARC32 Image (only for LEON)' 91 + echo ' vmlinux.aout - a.out kernel for SPARC64' 91 92 echo ' tftpboot.img - image prepared for tftp' 92 93 endef 93 - else 94 - define archhelp 95 - echo '* vmlinux - standard sparc64 kernel' 96 - echo '* zImage - stripped and compressed sparc64 kernel ($(boot)/zImage)' 97 - echo ' vmlinux.aout - a.out kernel for sparc64' 98 - echo ' tftpboot.img - image prepared for tftp' 99 - endef 100 - endif
+2 -6
scripts/Makefile.clang
··· 13 13 CLANG_TARGET_FLAGS_um := $(CLANG_TARGET_FLAGS_$(SUBARCH)) 14 14 CLANG_TARGET_FLAGS := $(CLANG_TARGET_FLAGS_$(SRCARCH)) 15 15 16 - ifeq ($(CROSS_COMPILE),) 17 16 ifeq ($(CLANG_TARGET_FLAGS),) 18 - $(error Specify CROSS_COMPILE or add '--target=' option to scripts/Makefile.clang) 17 + $(error add '--target=' option to scripts/Makefile.clang) 19 18 else 20 19 CLANG_FLAGS += --target=$(CLANG_TARGET_FLAGS) 21 - endif # CLANG_TARGET_FLAGS 22 - else 23 - CLANG_FLAGS += --target=$(notdir $(CROSS_COMPILE:%-=%)) 24 - endif # CROSS_COMPILE 20 + endif 25 21 26 22 ifeq ($(LLVM_IAS),0) 27 23 CLANG_FLAGS += -fno-integrated-as
+47 -14
scripts/Makefile.package
··· 5 5 include $(srctree)/scripts/Makefile.lib 6 6 7 7 KERNELPATH := kernel-$(subst -,_,$(KERNELRELEASE)) 8 - KBUILD_PKG_ROOTCMD ?="fakeroot -u" 9 8 # Include only those top-level files that are needed by make, plus the GPL copy 10 9 TAR_CONTENT := Documentation LICENSES arch block certs crypto drivers fs \ 11 10 include init io_uring ipc kernel lib mm net rust \ ··· 41 42 false; \ 42 43 fi 43 44 44 - git-config-tar.gz = -c tar.tar.gz.command="$(KGZIP)" 45 - git-config-tar.bz2 = -c tar.tar.bz2.command="$(KBZIP2)" 46 - git-config-tar.xz = -c tar.tar.xz.command="$(XZ)" 47 - git-config-tar.zst = -c tar.tar.zst.command="$(ZSTD)" 45 + git-config-tar.gz = -c tar.tar.gz.command="$(KGZIP)" 46 + git-config-tar.bz2 = -c tar.tar.bz2.command="$(KBZIP2)" 47 + git-config-tar.lzma = -c tar.tar.lzma.command="$(LZMA)" 48 + git-config-tar.xz = -c tar.tar.xz.command="$(XZ)" 49 + git-config-tar.zst = -c tar.tar.zst.command="$(ZSTD)" 48 50 49 51 quiet_cmd_archive = ARCHIVE $@ 50 52 cmd_archive = git -C $(srctree) $(git-config-tar$(suffix $@)) archive \ 51 53 --output=$$(realpath $@) $(archive-args) 52 54 55 + suffix-gzip := .gz 56 + suffix-bzip2 := .bz2 57 + suffix-lzma := .lzma 58 + suffix-xz := .xz 59 + 53 60 # Linux source tarball 54 61 # --------------------------------------------------------------------------- 55 62 56 - linux-tarballs := $(addprefix linux, .tar.gz) 63 + linux-tarballs := $(addprefix linux, .tar.gz .tar.bz2 .tar.lzma .tar.xz) 57 64 58 65 targets += $(linux-tarballs) 59 66 $(linux-tarballs): archive-args = --prefix=linux/ $$(cat $<) ··· 91 86 +rpmbuild $(RPMOPTS) --define "_builddir $(objtree)" --target \ 92 87 $(UTS_MACHINE)-linux -bb $(objtree)/binkernel.spec 93 88 89 + # deb-pkg srcdeb-pkg bindeb-pkg 90 + # --------------------------------------------------------------------------- 91 + 92 + KDEB_SOURCE_COMPRESS ?= gzip 93 + 94 + supported-deb-source-compress := gzip bzip2 lzma xz 95 + 96 + PHONY += linux.tar.unsupported-deb-src-compress 97 + linux.tar.unsupported-deb-src-compress: 98 + @echo "error: KDEB_SOURCE_COMPRESS=$(KDEB_SOURCE_COMPRESS) is not supported. The supported values are: $(supported-deb-source-compress)" >&2 99 + @false 100 + 101 + debian-orig-suffix := \ 102 + $(strip $(if $(filter $(supported-deb-source-compress), $(KDEB_SOURCE_COMPRESS)), \ 103 + $(suffix-$(KDEB_SOURCE_COMPRESS)),.unsupported-deb-src-compress)) 104 + 94 105 quiet_cmd_debianize = GEN $@ 95 106 cmd_debianize = $(srctree)/scripts/package/mkdebian $(mkdebian-opts) 96 107 ··· 116 95 PHONY += debian-orig 117 96 debian-orig: private source = $(shell dpkg-parsechangelog -S Source) 118 97 debian-orig: private version = $(shell dpkg-parsechangelog -S Version | sed 's/-[^-]*$$//') 119 - debian-orig: private orig-name = $(source)_$(version).orig.tar.gz 98 + debian-orig: private orig-name = $(source)_$(version).orig.tar$(debian-orig-suffix) 120 99 debian-orig: mkdebian-opts = --need-source 121 - debian-orig: linux.tar.gz debian 100 + debian-orig: linux.tar$(debian-orig-suffix) debian 122 101 $(Q)if [ "$(df --output=target .. 2>/dev/null)" = "$(df --output=target $< 2>/dev/null)" ]; then \ 123 102 ln -f $< ../$(orig-name); \ 124 103 else \ 125 104 cp $< ../$(orig-name); \ 126 105 fi 127 106 128 - PHONY += deb-pkg 129 - deb-pkg: debian-orig 130 - +dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) $(DPKG_FLAGS) \ 131 - --build=source,binary -nc -us -uc 107 + KBUILD_PKG_ROOTCMD ?= 'fakeroot -u' 132 108 133 - PHONY += bindeb-pkg 109 + PHONY += deb-pkg srcdeb-pkg bindeb-pkg 110 + 111 + deb-pkg: private build-type := source,binary 112 + srcdeb-pkg: private build-type := source 113 + bindeb-pkg: private build-type := binary 114 + 115 + deb-pkg srcdeb-pkg: debian-orig 134 116 bindeb-pkg: debian 135 - +dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) $(DPKG_FLAGS) -b -nc -uc 117 + deb-pkg srcdeb-pkg bindeb-pkg: 118 + +$(strip dpkg-buildpackage \ 119 + --build=$(build-type) --no-pre-clean --unsigned-changes \ 120 + $(if $(findstring source, $(build-type)), \ 121 + --unsigned-source --compression=$(KDEB_SOURCE_COMPRESS)) \ 122 + $(if $(findstring binary, $(build-type)), \ 123 + -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch), \ 124 + --no-check-builddeps) \ 125 + $(DPKG_FLAGS)) 136 126 137 127 PHONY += intdeb-pkg 138 128 intdeb-pkg: ··· 240 208 @echo ' srcrpm-pkg - Build only the source kernel RPM package' 241 209 @echo ' binrpm-pkg - Build only the binary kernel RPM package' 242 210 @echo ' deb-pkg - Build both source and binary deb kernel packages' 211 + @echo ' srcdeb-pkg - Build only the source kernel deb package' 243 212 @echo ' bindeb-pkg - Build only the binary kernel deb package' 244 213 @echo ' snap-pkg - Build only the binary kernel snap package' 245 214 @echo ' (will connect to external hosts)'
+74 -155
scripts/kallsyms.c
··· 6 6 * of the GNU General Public License, incorporated herein by reference. 7 7 * 8 8 * Usage: kallsyms [--all-symbols] [--absolute-percpu] 9 - * [--base-relative] in.map > out.S 9 + * [--base-relative] [--lto-clang] in.map > out.S 10 10 * 11 11 * Table compression uses all the unused char codes on the symbols and 12 12 * maps these to the most used substrings (tokens). For instance, it might ··· 102 102 103 103 static bool is_ignored_symbol(const char *name, char type) 104 104 { 105 - /* Symbol names that exactly match to the following are ignored.*/ 106 - static const char * const ignored_symbols[] = { 107 - /* 108 - * Symbols which vary between passes. Passes 1 and 2 must have 109 - * identical symbol lists. The kallsyms_* symbols below are 110 - * only added after pass 1, they would be included in pass 2 111 - * when --all-symbols is specified so exclude them to get a 112 - * stable symbol list. 113 - */ 114 - "kallsyms_addresses", 115 - "kallsyms_offsets", 116 - "kallsyms_relative_base", 117 - "kallsyms_num_syms", 118 - "kallsyms_names", 119 - "kallsyms_markers", 120 - "kallsyms_token_table", 121 - "kallsyms_token_index", 122 - "kallsyms_seqs_of_names", 123 - /* Exclude linker generated symbols which vary between passes */ 124 - "_SDA_BASE_", /* ppc */ 125 - "_SDA2_BASE_", /* ppc */ 126 - NULL 127 - }; 128 - 129 - /* Symbol names that begin with the following are ignored.*/ 130 - static const char * const ignored_prefixes[] = { 131 - "__efistub_", /* arm64 EFI stub namespace */ 132 - "__kvm_nvhe_$", /* arm64 local symbols in non-VHE KVM namespace */ 133 - "__kvm_nvhe_.L", /* arm64 local symbols in non-VHE KVM namespace */ 134 - "__AArch64ADRPThunk_", /* arm64 lld */ 135 - "__ARMV5PILongThunk_", /* arm lld */ 136 - "__ARMV7PILongThunk_", 137 - "__ThumbV7PILongThunk_", 138 - "__LA25Thunk_", /* mips lld */ 139 - "__microLA25Thunk_", 140 - "__kcfi_typeid_", /* CFI type identifiers */ 141 - NULL 142 - }; 143 - 144 - /* Symbol names that end with the following are ignored.*/ 145 - static const char * const ignored_suffixes[] = { 146 - "_from_arm", /* arm */ 147 - "_from_thumb", /* arm */ 148 - "_veneer", /* arm */ 149 - NULL 150 - }; 151 - 152 - /* Symbol names that contain the following are ignored.*/ 153 - static const char * const ignored_matches[] = { 154 - ".long_branch.", /* ppc stub */ 155 - ".plt_branch.", /* ppc stub */ 156 - NULL 157 - }; 158 - 159 - const char * const *p; 160 - 161 - for (p = ignored_symbols; *p; p++) 162 - if (!strcmp(name, *p)) 163 - return true; 164 - 165 - for (p = ignored_prefixes; *p; p++) 166 - if (!strncmp(name, *p, strlen(*p))) 167 - return true; 168 - 169 - for (p = ignored_suffixes; *p; p++) { 170 - int l = strlen(name) - strlen(*p); 171 - 172 - if (l >= 0 && !strcmp(name + l, *p)) 173 - return true; 174 - } 175 - 176 - for (p = ignored_matches; *p; p++) { 177 - if (strstr(name, *p)) 178 - return true; 179 - } 180 - 181 - if (type == 'U' || type == 'u') 182 - return true; 183 - /* exclude debugging symbols */ 184 - if (type == 'N' || type == 'n') 105 + if (type == 'u' || type == 'n') 185 106 return true; 186 107 187 108 if (toupper(type) == 'A') { ··· 335 414 return s->percpu_absolute; 336 415 } 337 416 338 - static char * s_name(char *buf) 339 - { 340 - /* Skip the symbol type */ 341 - return buf + 1; 342 - } 343 - 344 417 static void cleanup_symbol_name(char *s) 345 418 { 346 419 char *p; 347 - 348 - if (!lto_clang) 349 - return; 350 420 351 421 /* 352 422 * ASCII[.] = 2e ··· 357 445 static int compare_names(const void *a, const void *b) 358 446 { 359 447 int ret; 360 - char sa_namebuf[KSYM_NAME_LEN]; 361 - char sb_namebuf[KSYM_NAME_LEN]; 362 448 const struct sym_entry *sa = *(const struct sym_entry **)a; 363 449 const struct sym_entry *sb = *(const struct sym_entry **)b; 364 450 365 - expand_symbol(sa->sym, sa->len, sa_namebuf); 366 - expand_symbol(sb->sym, sb->len, sb_namebuf); 367 - cleanup_symbol_name(s_name(sa_namebuf)); 368 - cleanup_symbol_name(s_name(sb_namebuf)); 369 - ret = strcmp(s_name(sa_namebuf), s_name(sb_namebuf)); 451 + ret = strcmp(sym_name(sa), sym_name(sb)); 370 452 if (!ret) { 371 453 if (sa->addr > sb->addr) 372 454 return 1; ··· 396 490 printf("#endif\n"); 397 491 398 492 printf("\t.section .rodata, \"a\"\n"); 399 - 400 - if (!base_relative) 401 - output_label("kallsyms_addresses"); 402 - else 403 - output_label("kallsyms_offsets"); 404 - 405 - for (i = 0; i < table_cnt; i++) { 406 - if (base_relative) { 407 - /* 408 - * Use the offset relative to the lowest value 409 - * encountered of all relative symbols, and emit 410 - * non-relocatable fixed offsets that will be fixed 411 - * up at runtime. 412 - */ 413 - 414 - long long offset; 415 - int overflow; 416 - 417 - if (!absolute_percpu) { 418 - offset = table[i]->addr - relative_base; 419 - overflow = (offset < 0 || offset > UINT_MAX); 420 - } else if (symbol_absolute(table[i])) { 421 - offset = table[i]->addr; 422 - overflow = (offset < 0 || offset > INT_MAX); 423 - } else { 424 - offset = relative_base - table[i]->addr - 1; 425 - overflow = (offset < INT_MIN || offset >= 0); 426 - } 427 - if (overflow) { 428 - fprintf(stderr, "kallsyms failure: " 429 - "%s symbol value %#llx out of range in relative mode\n", 430 - symbol_absolute(table[i]) ? "absolute" : "relative", 431 - table[i]->addr); 432 - exit(EXIT_FAILURE); 433 - } 434 - printf("\t.long\t%#x\n", (int)offset); 435 - } else if (!symbol_absolute(table[i])) { 436 - output_address(table[i]->addr); 437 - } else { 438 - printf("\tPTR\t%#llx\n", table[i]->addr); 439 - } 440 - } 441 - printf("\n"); 442 - 443 - if (base_relative) { 444 - output_label("kallsyms_relative_base"); 445 - output_address(relative_base); 446 - printf("\n"); 447 - } 448 493 449 494 output_label("kallsyms_num_syms"); 450 495 printf("\t.long\t%u\n", table_cnt); ··· 449 592 } 450 593 printf("\n"); 451 594 595 + /* 596 + * Now that we wrote out the compressed symbol names, restore the 597 + * original names, which are needed in some of the later steps. 598 + */ 599 + for (i = 0; i < table_cnt; i++) { 600 + expand_symbol(table[i]->sym, table[i]->len, buf); 601 + strcpy((char *)table[i]->sym, buf); 602 + } 603 + 452 604 output_label("kallsyms_markers"); 453 605 for (i = 0; i < ((table_cnt + 255) >> 8); i++) 454 606 printf("\t.long\t%u\n", markers[i]); 455 607 printf("\n"); 456 608 457 609 free(markers); 458 - 459 - sort_symbols_by_name(); 460 - output_label("kallsyms_seqs_of_names"); 461 - for (i = 0; i < table_cnt; i++) 462 - printf("\t.byte 0x%02x, 0x%02x, 0x%02x\n", 463 - (unsigned char)(table[i]->seq >> 16), 464 - (unsigned char)(table[i]->seq >> 8), 465 - (unsigned char)(table[i]->seq >> 0)); 466 - printf("\n"); 467 610 468 611 output_label("kallsyms_token_table"); 469 612 off = 0; ··· 478 621 output_label("kallsyms_token_index"); 479 622 for (i = 0; i < 256; i++) 480 623 printf("\t.short\t%d\n", best_idx[i]); 624 + printf("\n"); 625 + 626 + if (!base_relative) 627 + output_label("kallsyms_addresses"); 628 + else 629 + output_label("kallsyms_offsets"); 630 + 631 + for (i = 0; i < table_cnt; i++) { 632 + if (base_relative) { 633 + /* 634 + * Use the offset relative to the lowest value 635 + * encountered of all relative symbols, and emit 636 + * non-relocatable fixed offsets that will be fixed 637 + * up at runtime. 638 + */ 639 + 640 + long long offset; 641 + int overflow; 642 + 643 + if (!absolute_percpu) { 644 + offset = table[i]->addr - relative_base; 645 + overflow = (offset < 0 || offset > UINT_MAX); 646 + } else if (symbol_absolute(table[i])) { 647 + offset = table[i]->addr; 648 + overflow = (offset < 0 || offset > INT_MAX); 649 + } else { 650 + offset = relative_base - table[i]->addr - 1; 651 + overflow = (offset < INT_MIN || offset >= 0); 652 + } 653 + if (overflow) { 654 + fprintf(stderr, "kallsyms failure: " 655 + "%s symbol value %#llx out of range in relative mode\n", 656 + symbol_absolute(table[i]) ? "absolute" : "relative", 657 + table[i]->addr); 658 + exit(EXIT_FAILURE); 659 + } 660 + printf("\t.long\t%#x /* %s */\n", (int)offset, table[i]->sym); 661 + } else if (!symbol_absolute(table[i])) { 662 + output_address(table[i]->addr); 663 + } else { 664 + printf("\tPTR\t%#llx\n", table[i]->addr); 665 + } 666 + } 667 + printf("\n"); 668 + 669 + if (base_relative) { 670 + output_label("kallsyms_relative_base"); 671 + output_address(relative_base); 672 + printf("\n"); 673 + } 674 + 675 + if (lto_clang) 676 + for (i = 0; i < table_cnt; i++) 677 + cleanup_symbol_name((char *)table[i]->sym); 678 + 679 + sort_symbols_by_name(); 680 + output_label("kallsyms_seqs_of_names"); 681 + for (i = 0; i < table_cnt; i++) 682 + printf("\t.byte 0x%02x, 0x%02x, 0x%02x\n", 683 + (unsigned char)(table[i]->seq >> 16), 684 + (unsigned char)(table[i]->seq >> 8), 685 + (unsigned char)(table[i]->seq >> 0)); 481 686 printf("\n"); 482 687 } 483 688
-27
scripts/kconfig/lxdialog/dialog.h
··· 18 18 #endif 19 19 #include <ncurses.h> 20 20 21 - /* 22 - * Colors in ncurses 1.9.9e do not work properly since foreground and 23 - * background colors are OR'd rather than separately masked. This version 24 - * of dialog was hacked to work with ncurses 1.9.9e, making it incompatible 25 - * with standard curses. The simplest fix (to make this work with standard 26 - * curses) uses the wbkgdset() function, not used in the original hack. 27 - * Turn it off if we're building with 1.9.9e, since it just confuses things. 28 - */ 29 - #if defined(NCURSES_VERSION) && defined(_NEED_WRAP) && !defined(GCC_PRINTFLIKE) 30 - #define OLD_NCURSES 1 31 - #undef wbkgdset 32 - #define wbkgdset(w,p) /*nothing */ 33 - #else 34 - #define OLD_NCURSES 0 35 - #endif 36 - 37 21 #define TR(params) _tracef params 38 22 39 23 #define KEY_ESC 27 ··· 209 225 int width, int list_height); 210 226 int dialog_inputbox(const char *title, const char *prompt, int height, 211 227 int width, const char *init); 212 - 213 - /* 214 - * This is the base for fictitious keys, which activate 215 - * the buttons. 216 - * 217 - * Mouse-generated keys are the following: 218 - * -- the first 32 are used as numbers, in addition to '0'-'9' 219 - * -- the lowercase are used to signal mouse-enter events (M_EVENT + 'o') 220 - * -- uppercase chars are used to invoke the button (M_EVENT + 'O') 221 - */ 222 - #define M_EVENT (KEY_MAX+1)
-8
scripts/kconfig/lxdialog/menubox.c
··· 63 63 /* Clear 'residue' of last item */ 64 64 wattrset(win, dlg.menubox.atr); 65 65 wmove(win, line_y, 0); 66 - #if OLD_NCURSES 67 - { 68 - int i; 69 - for (i = 0; i < menu_width; i++) 70 - waddch(win, ' '); 71 - } 72 - #else 73 66 wclrtoeol(win); 74 - #endif 75 67 wattrset(win, selected ? dlg.item_selected.atr : dlg.item.atr); 76 68 mvwaddstr(win, line_y, item_x, menu_item); 77 69 if (hotkey) {
+125 -142
scripts/kconfig/lxdialog/textbox.c
··· 8 8 9 9 #include "dialog.h" 10 10 11 - static void back_lines(int n); 12 - static void print_page(WINDOW *win, int height, int width, update_text_fn 13 - update_text, void *data); 14 - static void print_line(WINDOW *win, int row, int width); 15 - static char *get_line(void); 16 - static void print_position(WINDOW * win); 17 - 18 11 static int hscroll; 19 12 static int begin_reached, end_reached, page_length; 20 13 static char *buf; 21 14 static char *page; 15 + 16 + /* 17 + * Go back 'n' lines in text. Called by dialog_textbox(). 18 + * 'page' will be updated to point to the desired line in 'buf'. 19 + */ 20 + static void back_lines(int n) 21 + { 22 + int i; 23 + 24 + begin_reached = 0; 25 + /* Go back 'n' lines */ 26 + for (i = 0; i < n; i++) { 27 + if (*page == '\0') { 28 + if (end_reached) { 29 + end_reached = 0; 30 + continue; 31 + } 32 + } 33 + if (page == buf) { 34 + begin_reached = 1; 35 + return; 36 + } 37 + page--; 38 + do { 39 + if (page == buf) { 40 + begin_reached = 1; 41 + return; 42 + } 43 + page--; 44 + } while (*page != '\n'); 45 + page++; 46 + } 47 + } 48 + 49 + /* 50 + * Return current line of text. Called by dialog_textbox() and print_line(). 51 + * 'page' should point to start of current line before calling, and will be 52 + * updated to point to start of next line. 53 + */ 54 + static char *get_line(void) 55 + { 56 + int i = 0; 57 + static char line[MAX_LEN + 1]; 58 + 59 + end_reached = 0; 60 + while (*page != '\n') { 61 + if (*page == '\0') { 62 + end_reached = 1; 63 + break; 64 + } else if (i < MAX_LEN) 65 + line[i++] = *(page++); 66 + else { 67 + /* Truncate lines longer than MAX_LEN characters */ 68 + if (i == MAX_LEN) 69 + line[i++] = '\0'; 70 + page++; 71 + } 72 + } 73 + if (i <= MAX_LEN) 74 + line[i] = '\0'; 75 + if (!end_reached) 76 + page++; /* move past '\n' */ 77 + 78 + return line; 79 + } 80 + 81 + /* 82 + * Print a new line of text. 83 + */ 84 + static void print_line(WINDOW *win, int row, int width) 85 + { 86 + char *line; 87 + 88 + line = get_line(); 89 + line += MIN(strlen(line), hscroll); /* Scroll horizontally */ 90 + wmove(win, row, 0); /* move cursor to correct line */ 91 + waddch(win, ' '); 92 + waddnstr(win, line, MIN(strlen(line), width - 2)); 93 + 94 + /* Clear 'residue' of previous line */ 95 + wclrtoeol(win); 96 + } 97 + 98 + /* 99 + * Print a new page of text. 100 + */ 101 + static void print_page(WINDOW *win, int height, int width, update_text_fn 102 + update_text, void *data) 103 + { 104 + int i, passed_end = 0; 105 + 106 + if (update_text) { 107 + char *end; 108 + 109 + for (i = 0; i < height; i++) 110 + get_line(); 111 + end = page; 112 + back_lines(height); 113 + update_text(buf, page - buf, end - buf, data); 114 + } 115 + 116 + page_length = 0; 117 + for (i = 0; i < height; i++) { 118 + print_line(win, i, width); 119 + if (!passed_end) 120 + page_length++; 121 + if (end_reached && !passed_end) 122 + passed_end = 1; 123 + } 124 + wnoutrefresh(win); 125 + } 126 + 127 + /* 128 + * Print current position 129 + */ 130 + static void print_position(WINDOW *win) 131 + { 132 + int percent; 133 + 134 + wattrset(win, dlg.position_indicator.atr); 135 + wbkgdset(win, dlg.position_indicator.atr & A_COLOR); 136 + percent = (page - buf) * 100 / strlen(buf); 137 + wmove(win, getmaxy(win) - 3, getmaxx(win) - 9); 138 + wprintw(win, "(%3d%%)", percent); 139 + } 22 140 23 141 /* 24 142 * refresh window content ··· 150 32 wmove(dialog, cur_y, cur_x); /* Restore cursor position */ 151 33 wrefresh(dialog); 152 34 } 153 - 154 35 155 36 /* 156 37 * Display text from a file in a dialog box. ··· 375 258 if (_hscroll) 376 259 *_hscroll = hscroll; 377 260 return key; 378 - } 379 - 380 - /* 381 - * Go back 'n' lines in text. Called by dialog_textbox(). 382 - * 'page' will be updated to point to the desired line in 'buf'. 383 - */ 384 - static void back_lines(int n) 385 - { 386 - int i; 387 - 388 - begin_reached = 0; 389 - /* Go back 'n' lines */ 390 - for (i = 0; i < n; i++) { 391 - if (*page == '\0') { 392 - if (end_reached) { 393 - end_reached = 0; 394 - continue; 395 - } 396 - } 397 - if (page == buf) { 398 - begin_reached = 1; 399 - return; 400 - } 401 - page--; 402 - do { 403 - if (page == buf) { 404 - begin_reached = 1; 405 - return; 406 - } 407 - page--; 408 - } while (*page != '\n'); 409 - page++; 410 - } 411 - } 412 - 413 - /* 414 - * Print a new page of text. 415 - */ 416 - static void print_page(WINDOW *win, int height, int width, update_text_fn 417 - update_text, void *data) 418 - { 419 - int i, passed_end = 0; 420 - 421 - if (update_text) { 422 - char *end; 423 - 424 - for (i = 0; i < height; i++) 425 - get_line(); 426 - end = page; 427 - back_lines(height); 428 - update_text(buf, page - buf, end - buf, data); 429 - } 430 - 431 - page_length = 0; 432 - for (i = 0; i < height; i++) { 433 - print_line(win, i, width); 434 - if (!passed_end) 435 - page_length++; 436 - if (end_reached && !passed_end) 437 - passed_end = 1; 438 - } 439 - wnoutrefresh(win); 440 - } 441 - 442 - /* 443 - * Print a new line of text. 444 - */ 445 - static void print_line(WINDOW * win, int row, int width) 446 - { 447 - char *line; 448 - 449 - line = get_line(); 450 - line += MIN(strlen(line), hscroll); /* Scroll horizontally */ 451 - wmove(win, row, 0); /* move cursor to correct line */ 452 - waddch(win, ' '); 453 - waddnstr(win, line, MIN(strlen(line), width - 2)); 454 - 455 - /* Clear 'residue' of previous line */ 456 - #if OLD_NCURSES 457 - { 458 - int x = getcurx(win); 459 - int i; 460 - for (i = 0; i < width - x; i++) 461 - waddch(win, ' '); 462 - } 463 - #else 464 - wclrtoeol(win); 465 - #endif 466 - } 467 - 468 - /* 469 - * Return current line of text. Called by dialog_textbox() and print_line(). 470 - * 'page' should point to start of current line before calling, and will be 471 - * updated to point to start of next line. 472 - */ 473 - static char *get_line(void) 474 - { 475 - int i = 0; 476 - static char line[MAX_LEN + 1]; 477 - 478 - end_reached = 0; 479 - while (*page != '\n') { 480 - if (*page == '\0') { 481 - end_reached = 1; 482 - break; 483 - } else if (i < MAX_LEN) 484 - line[i++] = *(page++); 485 - else { 486 - /* Truncate lines longer than MAX_LEN characters */ 487 - if (i == MAX_LEN) 488 - line[i++] = '\0'; 489 - page++; 490 - } 491 - } 492 - if (i <= MAX_LEN) 493 - line[i] = '\0'; 494 - if (!end_reached) 495 - page++; /* move past '\n' */ 496 - 497 - return line; 498 - } 499 - 500 - /* 501 - * Print current position 502 - */ 503 - static void print_position(WINDOW * win) 504 - { 505 - int percent; 506 - 507 - wattrset(win, dlg.position_indicator.atr); 508 - wbkgdset(win, dlg.position_indicator.atr & A_COLOR); 509 - percent = (page - buf) * 100 / strlen(buf); 510 - wmove(win, getmaxy(win) - 3, getmaxx(win) - 9); 511 - wprintw(win, "(%3d%%)", percent); 512 261 }
+152 -162
scripts/kconfig/mconf.c
··· 290 290 static int silent; 291 291 292 292 static void conf(struct menu *menu, struct menu *active_menu); 293 - static void conf_choice(struct menu *menu); 294 - static void conf_string(struct menu *menu); 295 - static void conf_load(void); 296 - static void conf_save(void); 297 - static int show_textbox_ext(const char *title, char *text, int r, int c, 298 - int *keys, int *vscroll, int *hscroll, 299 - update_text_fn update_text, void *data); 300 - static void show_textbox(const char *title, const char *text, int r, int c); 301 - static void show_helptext(const char *title, const char *text); 302 - static void show_help(struct menu *menu); 303 293 304 294 static char filename[PATH_MAX+1]; 305 295 static void set_config_filename(const char *config_filename) ··· 346 356 } 347 357 subtitles = NULL; 348 358 set_dialog_subtitles(subtitles); 359 + } 360 + 361 + static int show_textbox_ext(const char *title, char *text, int r, int c, int 362 + *keys, int *vscroll, int *hscroll, update_text_fn 363 + update_text, void *data) 364 + { 365 + dialog_clear(); 366 + return dialog_textbox(title, text, r, c, keys, vscroll, hscroll, 367 + update_text, data); 368 + } 369 + 370 + static void show_textbox(const char *title, const char *text, int r, int c) 371 + { 372 + show_textbox_ext(title, (char *) text, r, c, (int []) {0}, NULL, NULL, 373 + NULL, NULL); 374 + } 375 + 376 + static void show_helptext(const char *title, const char *text) 377 + { 378 + show_textbox(title, text, 0, 0); 379 + } 380 + 381 + static void show_help(struct menu *menu) 382 + { 383 + struct gstr help = str_new(); 384 + 385 + help.max_width = getmaxx(stdscr) - 10; 386 + menu_get_ext_help(menu, &help); 387 + 388 + show_helptext(menu_get_prompt(menu), str_get(&help)); 389 + str_free(&help); 349 390 } 350 391 351 392 struct search_data { ··· 664 643 indent -= doint; 665 644 } 666 645 667 - static void conf(struct menu *menu, struct menu *active_menu) 668 - { 669 - struct menu *submenu; 670 - const char *prompt = menu_get_prompt(menu); 671 - struct subtitle_part stpart; 672 - struct symbol *sym; 673 - int res; 674 - int s_scroll = 0; 675 - 676 - if (menu != &rootmenu) 677 - stpart.text = menu_get_prompt(menu); 678 - else 679 - stpart.text = NULL; 680 - list_add_tail(&stpart.entries, &trail); 681 - 682 - while (1) { 683 - item_reset(); 684 - current_menu = menu; 685 - build_conf(menu); 686 - if (!child_count) 687 - break; 688 - set_subtitle(); 689 - dialog_clear(); 690 - res = dialog_menu(prompt ? prompt : "Main Menu", 691 - menu_instructions, 692 - active_menu, &s_scroll); 693 - if (res == 1 || res == KEY_ESC || res == -ERRDISPLAYTOOSMALL) 694 - break; 695 - if (item_count() != 0) { 696 - if (!item_activate_selected()) 697 - continue; 698 - if (!item_tag()) 699 - continue; 700 - } 701 - submenu = item_data(); 702 - active_menu = item_data(); 703 - if (submenu) 704 - sym = submenu->sym; 705 - else 706 - sym = NULL; 707 - 708 - switch (res) { 709 - case 0: 710 - switch (item_tag()) { 711 - case 'm': 712 - if (single_menu_mode) 713 - submenu->data = (void *) (long) !submenu->data; 714 - else 715 - conf(submenu, NULL); 716 - break; 717 - case 't': 718 - if (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes) 719 - conf_choice(submenu); 720 - else if (submenu->prompt->type == P_MENU) 721 - conf(submenu, NULL); 722 - break; 723 - case 's': 724 - conf_string(submenu); 725 - break; 726 - } 727 - break; 728 - case 2: 729 - if (sym) 730 - show_help(submenu); 731 - else { 732 - reset_subtitle(); 733 - show_helptext("README", mconf_readme); 734 - } 735 - break; 736 - case 3: 737 - reset_subtitle(); 738 - conf_save(); 739 - break; 740 - case 4: 741 - reset_subtitle(); 742 - conf_load(); 743 - break; 744 - case 5: 745 - if (item_is_tag('t')) { 746 - if (sym_set_tristate_value(sym, yes)) 747 - break; 748 - if (sym_set_tristate_value(sym, mod)) 749 - show_textbox(NULL, setmod_text, 6, 74); 750 - } 751 - break; 752 - case 6: 753 - if (item_is_tag('t')) 754 - sym_set_tristate_value(sym, no); 755 - break; 756 - case 7: 757 - if (item_is_tag('t')) 758 - sym_set_tristate_value(sym, mod); 759 - break; 760 - case 8: 761 - if (item_is_tag('t')) 762 - sym_toggle_tristate_value(sym); 763 - else if (item_is_tag('m')) 764 - conf(submenu, NULL); 765 - break; 766 - case 9: 767 - search_conf(); 768 - break; 769 - case 10: 770 - show_all_options = !show_all_options; 771 - break; 772 - } 773 - } 774 - 775 - list_del(trail.prev); 776 - } 777 - 778 - static int show_textbox_ext(const char *title, char *text, int r, int c, int 779 - *keys, int *vscroll, int *hscroll, update_text_fn 780 - update_text, void *data) 781 - { 782 - dialog_clear(); 783 - return dialog_textbox(title, text, r, c, keys, vscroll, hscroll, 784 - update_text, data); 785 - } 786 - 787 - static void show_textbox(const char *title, const char *text, int r, int c) 788 - { 789 - show_textbox_ext(title, (char *) text, r, c, (int []) {0}, NULL, NULL, 790 - NULL, NULL); 791 - } 792 - 793 - static void show_helptext(const char *title, const char *text) 794 - { 795 - show_textbox(title, text, 0, 0); 796 - } 797 - 798 - static void conf_message_callback(const char *s) 799 - { 800 - if (save_and_exit) { 801 - if (!silent) 802 - printf("%s", s); 803 - } else { 804 - show_textbox(NULL, s, 6, 60); 805 - } 806 - } 807 - 808 - static void show_help(struct menu *menu) 809 - { 810 - struct gstr help = str_new(); 811 - 812 - help.max_width = getmaxx(stdscr) - 10; 813 - menu_get_ext_help(menu, &help); 814 - 815 - show_helptext(menu_get_prompt(menu), str_get(&help)); 816 - str_free(&help); 817 - } 818 - 819 646 static void conf_choice(struct menu *menu) 820 647 { 821 648 const char *prompt = menu_get_prompt(menu); ··· 816 947 case KEY_ESC: 817 948 return; 818 949 } 950 + } 951 + } 952 + 953 + static void conf(struct menu *menu, struct menu *active_menu) 954 + { 955 + struct menu *submenu; 956 + const char *prompt = menu_get_prompt(menu); 957 + struct subtitle_part stpart; 958 + struct symbol *sym; 959 + int res; 960 + int s_scroll = 0; 961 + 962 + if (menu != &rootmenu) 963 + stpart.text = menu_get_prompt(menu); 964 + else 965 + stpart.text = NULL; 966 + list_add_tail(&stpart.entries, &trail); 967 + 968 + while (1) { 969 + item_reset(); 970 + current_menu = menu; 971 + build_conf(menu); 972 + if (!child_count) 973 + break; 974 + set_subtitle(); 975 + dialog_clear(); 976 + res = dialog_menu(prompt ? prompt : "Main Menu", 977 + menu_instructions, 978 + active_menu, &s_scroll); 979 + if (res == 1 || res == KEY_ESC || res == -ERRDISPLAYTOOSMALL) 980 + break; 981 + if (item_count() != 0) { 982 + if (!item_activate_selected()) 983 + continue; 984 + if (!item_tag()) 985 + continue; 986 + } 987 + submenu = item_data(); 988 + active_menu = item_data(); 989 + if (submenu) 990 + sym = submenu->sym; 991 + else 992 + sym = NULL; 993 + 994 + switch (res) { 995 + case 0: 996 + switch (item_tag()) { 997 + case 'm': 998 + if (single_menu_mode) 999 + submenu->data = (void *) (long) !submenu->data; 1000 + else 1001 + conf(submenu, NULL); 1002 + break; 1003 + case 't': 1004 + if (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes) 1005 + conf_choice(submenu); 1006 + else if (submenu->prompt->type == P_MENU) 1007 + conf(submenu, NULL); 1008 + break; 1009 + case 's': 1010 + conf_string(submenu); 1011 + break; 1012 + } 1013 + break; 1014 + case 2: 1015 + if (sym) 1016 + show_help(submenu); 1017 + else { 1018 + reset_subtitle(); 1019 + show_helptext("README", mconf_readme); 1020 + } 1021 + break; 1022 + case 3: 1023 + reset_subtitle(); 1024 + conf_save(); 1025 + break; 1026 + case 4: 1027 + reset_subtitle(); 1028 + conf_load(); 1029 + break; 1030 + case 5: 1031 + if (item_is_tag('t')) { 1032 + if (sym_set_tristate_value(sym, yes)) 1033 + break; 1034 + if (sym_set_tristate_value(sym, mod)) 1035 + show_textbox(NULL, setmod_text, 6, 74); 1036 + } 1037 + break; 1038 + case 6: 1039 + if (item_is_tag('t')) 1040 + sym_set_tristate_value(sym, no); 1041 + break; 1042 + case 7: 1043 + if (item_is_tag('t')) 1044 + sym_set_tristate_value(sym, mod); 1045 + break; 1046 + case 8: 1047 + if (item_is_tag('t')) 1048 + sym_toggle_tristate_value(sym); 1049 + else if (item_is_tag('m')) 1050 + conf(submenu, NULL); 1051 + break; 1052 + case 9: 1053 + search_conf(); 1054 + break; 1055 + case 10: 1056 + show_all_options = !show_all_options; 1057 + break; 1058 + } 1059 + } 1060 + 1061 + list_del(trail.prev); 1062 + } 1063 + 1064 + static void conf_message_callback(const char *s) 1065 + { 1066 + if (save_and_exit) { 1067 + if (!silent) 1068 + printf("%s", s); 1069 + } else { 1070 + show_textbox(NULL, s, 6, 60); 819 1071 } 820 1072 } 821 1073
+91 -44
scripts/mksysmap
··· 4 4 # tools to retrieve the actual addresses of symbols in the kernel. 5 5 # 6 6 # Usage 7 - # mksysmap vmlinux System.map 7 + # mksysmap vmlinux System.map [exclude] 8 8 9 9 10 10 ##### 11 11 # Generate System.map (actual filename passed as second argument) 12 - 13 - # $NM produces the following output: 14 - # f0081e80 T alloc_vfsmnt 15 - 16 - # The second row specify the type of the symbol: 17 - # A = Absolute 18 - # B = Uninitialised data (.bss) 19 - # C = Common symbol 20 - # D = Initialised data 21 - # G = Initialised data for small objects 22 - # I = Indirect reference to another symbol 23 - # N = Debugging symbol 24 - # R = Read only 25 - # S = Uninitialised data for small objects 26 - # T = Text code symbol 27 - # U = Undefined symbol 28 - # V = Weak symbol 29 - # W = Weak symbol 30 - # Corresponding small letters are local symbols 31 - 32 - # For System.map filter away: 33 - # a - local absolute symbols 34 - # U - undefined global symbols 35 - # N - debugging symbols 36 - # w - local weak symbols 12 + # The following refers to the symbol type as per nm(1). 37 13 38 14 # readprofile starts reading symbols when _stext is found, and 39 15 # continue until it finds a symbol which is not either of 'T', 't', 40 16 # 'W' or 'w'. 41 17 # 42 - # Ignored prefixes: 43 - # $ - local symbols for ARM, MIPS, etc. 44 - # .L - local labels, .LBB,.Ltmpxxx,.L__unnamed_xx,.LASANPC, etc. 45 - # __crc_ - modversions 46 - # __kstrtab_ - EXPORT_SYMBOL (symbol name) 47 - # __kstrtabns_ - EXPORT_SYMBOL (namespace) 48 - # 49 - # Ignored symbols: 50 - # L0 - for LoongArch? 51 18 52 - $NM -n $1 | grep -v \ 53 - -e ' [aNUw] ' \ 54 - -e ' \$' \ 55 - -e ' \.L' \ 56 - -e ' __crc_' \ 57 - -e ' __kstrtab_' \ 58 - -e ' __kstrtabns_' \ 59 - -e ' L0$' \ 60 - > $2 19 + ${NM} -n ${1} | sed >${2} -e " 20 + # --------------------------------------------------------------------------- 21 + # Ignored symbol types 22 + # 23 + 24 + # a: local absolute symbols 25 + # N: debugging symbols 26 + # U: undefined global symbols 27 + # w: local weak symbols 28 + / [aNUw] /d 29 + 30 + # --------------------------------------------------------------------------- 31 + # Ignored prefixes 32 + # (do not forget a space before each pattern) 33 + 34 + # local symbols for ARM, MIPS, etc. 35 + / \$/d 36 + 37 + # local labels, .LBB, .Ltmpxxx, .L__unnamed_xx, .LASANPC, etc. 38 + / \.L/d 39 + 40 + # arm64 EFI stub namespace 41 + / __efistub_/d 42 + 43 + # arm64 local symbols in non-VHE KVM namespace 44 + / __kvm_nvhe_\$/d 45 + / __kvm_nvhe_\.L/d 46 + 47 + # arm64 lld 48 + / __AArch64ADRPThunk_/d 49 + 50 + # arm lld 51 + / __ARMV5PILongThunk_/d 52 + / __ARMV7PILongThunk_/d 53 + / __ThumbV7PILongThunk_/d 54 + 55 + # mips lld 56 + / __LA25Thunk_/d 57 + / __microLA25Thunk_/d 58 + 59 + # CFI type identifiers 60 + / __kcfi_typeid_/d 61 + 62 + # CRC from modversions 63 + / __crc_/d 64 + 65 + # EXPORT_SYMBOL (symbol name) 66 + / __kstrtab_/d 67 + 68 + # EXPORT_SYMBOL (namespace) 69 + / __kstrtabns_/d 70 + 71 + # --------------------------------------------------------------------------- 72 + # Ignored suffixes 73 + # (do not forget '$' after each pattern) 74 + 75 + # arm 76 + /_from_arm$/d 77 + /_from_thumb$/d 78 + /_veneer$/d 79 + 80 + # --------------------------------------------------------------------------- 81 + # Ignored symbols (exact match) 82 + # (do not forget a space before and '$' after each pattern) 83 + 84 + # for LoongArch? 85 + / L0$/d 86 + 87 + # ppc 88 + / _SDA_BASE_$/d 89 + / _SDA2_BASE_$/d 90 + 91 + # --------------------------------------------------------------------------- 92 + # Ignored patterns 93 + # (symbols that contain the pattern are ignored) 94 + 95 + # ppc stub 96 + /\.long_branch\./d 97 + /\.plt_branch\./d 98 + 99 + # --------------------------------------------------------------------------- 100 + # Ignored kallsyms symbols 101 + # 102 + # If the 3rd parameter exists, symbols from it will be omitted from the output. 103 + # This makes kallsyms have the identical symbol lists in the step 1 and 2. 104 + # Without this, the step2 would get new symbols generated by scripts/kallsyms.c 105 + # when CONFIG_KALLSYMS_ALL is enabled. That might require one more pass. 106 + $(if [ $# -ge 3 ]; then ${NM} ${3} | sed -n '/ U /!s:.* \([^ ]*\)$:/ \1$/d:p'; fi) 107 + "
+1 -1
scripts/package/builddeb
··· 209 209 210 210 # move asm headers to /usr/include/<libc-machine>/asm to match the structure 211 211 # used by Debian-based distros (to support multi-arch) 212 - host_arch=$(dpkg-architecture -a$(cat debian/arch) -qDEB_HOST_MULTIARCH) 212 + host_arch=$(dpkg-architecture -a$DEB_HOST_ARCH -qDEB_HOST_MULTIARCH) 213 213 mkdir $pdir/usr/include/$host_arch 214 214 mv $pdir/usr/include/asm $pdir/usr/include/$host_arch/ 215 215 }
+2
scripts/package/mkdebian
··· 269 269 srctree ?= . 270 270 KERNELRELEASE = ${KERNELRELEASE} 271 271 272 + .PHONY: clean build build-arch build-indep binary binary-arch binary-indep 273 + 272 274 build-indep: 273 275 build-arch: 274 276 \$(MAKE) -f \$(srctree)/Makefile ARCH=${ARCH} \
+1 -6
scripts/package/mkspec
··· 28 28 M=DEL 29 29 fi 30 30 31 - if grep -q CONFIG_DRM=y include/config/auto.conf; then 32 - PROVIDES=kernel-drm 33 - fi 34 - 35 - PROVIDES="$PROVIDES kernel-$KERNELRELEASE" 36 31 __KERNELRELEASE=$(echo $KERNELRELEASE | sed -e "s/-/_/g") 37 32 EXCLUDES="$RCS_TAR_IGNORE --exclude=*vmlinux* --exclude=*.mod \ 38 33 --exclude=*.o --exclude=*.ko --exclude=*.cmd --exclude=Documentation \ ··· 50 55 $S Source0: linux.tar.gz 51 56 $S Source1: config 52 57 $S Source2: diff.patch 53 - Provides: $PROVIDES 58 + Provides: kernel-$KERNELRELEASE 54 59 $S BuildRequires: bc binutils bison dwarves 55 60 $S BuildRequires: (elfutils-libelf-devel or libelf-devel) flex 56 61 $S BuildRequires: gcc make openssl openssl-devel perl python3 rsync
+6 -2
scripts/tools-support-relr.sh
··· 7 7 cat << "END" | $CC -c -x c - -o $tmp_file.o >/dev/null 2>&1 8 8 void *p = &p; 9 9 END 10 - $LD $tmp_file.o -shared -Bsymbolic --pack-dyn-relocs=relr \ 11 - --use-android-relr-tags -o $tmp_file 10 + 11 + # ld.lld before 15 did not support -z pack-relative-relocs. 12 + if ! $LD $tmp_file.o -shared -Bsymbolic --pack-dyn-relocs=relr -o $tmp_file 2>/dev/null; then 13 + $LD $tmp_file.o -shared -Bsymbolic -z pack-relative-relocs -o $tmp_file 2>&1 | 14 + grep -q pack-relative-relocs && exit 1 15 + fi 12 16 13 17 # Despite printing an error message, GNU nm still exits with exit code 0 if it 14 18 # sees a relr section. So we need to check that nothing is printed to stderr.