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-fixes-v5.5' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild

Pull Kbuild fixes from Masahiro Yamada:

- fix warning in out-of-tree 'make clean'

- add READELF variable to the top Makefile

- fix broken builds when LINUX_COMPILE_BY contains a backslash

- fix build warning in kallsyms

- fix NULL pointer access in expr_eq() in Kconfig

- fix missing dependency on rsync in deb-pkg build

- remove ---help--- from documentation

- fix misleading documentation about directory descending

* tag 'kbuild-fixes-v5.5' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
kbuild: clarify the difference between obj-y and obj-m w.r.t. descending
kconfig: remove ---help--- from documentation
scripts: package: mkdebian: add missing rsync dependency
kconfig: don't crash on NULL expressions in expr_eq()
scripts/kallsyms: fix offset overflow of kallsyms_relative_base
mkcompile_h: use printf for LINUX_COMPILE_BY
mkcompile_h: git rid of UTS_TRUNCATE from LINUX_COMPILE_{BY,HOST}
x86/boot: kbuild: allow readelf executable to be specified
kbuild: fix 'No such file or directory' warning when cleaning

+48 -37
+1 -4
Documentation/kbuild/kconfig-language.rst
··· 196 196 or equal to the first symbol and smaller than or equal to the second 197 197 symbol. 198 198 199 - - help text: "help" or "---help---" 199 + - help text: "help" 200 200 201 201 This defines a help text. The end of the help text is determined by 202 202 the indentation level, this means it ends at the first line which has 203 203 a smaller indentation than the first line of the help text. 204 - "---help---" and "help" do not differ in behaviour, "---help---" is 205 - used to help visually separate configuration logic from help within 206 - the file as an aid to developers. 207 204 208 205 - misc options: "option" <symbol>[=<value>] 209 206
+13 -3
Documentation/kbuild/makefiles.rst
··· 297 297 If CONFIG_EXT2_FS is set to either 'y' (built-in) or 'm' (modular) 298 298 the corresponding obj- variable will be set, and kbuild will descend 299 299 down in the ext2 directory. 300 - Kbuild only uses this information to decide that it needs to visit 301 - the directory, it is the Makefile in the subdirectory that 302 - specifies what is modular and what is built-in. 300 + 301 + Kbuild uses this information not only to decide that it needs to visit 302 + the directory, but also to decide whether or not to link objects from 303 + the directory into vmlinux. 304 + 305 + When Kbuild descends into the directory with 'y', all built-in objects 306 + from that directory are combined into the built-in.a, which will be 307 + eventually linked into vmlinux. 308 + 309 + When Kbuild descends into the directory with 'm', in contrast, nothing 310 + from that directory will be linked into vmlinux. If the Makefile in 311 + that directory specifies obj-y, those objects will be left orphan. 312 + It is very likely a bug of the Makefile or of dependencies in Kconfig. 303 313 304 314 It is good practice to use a `CONFIG_` variable when assigning directory 305 315 names. This allows kbuild to totally skip the directory if the
+2 -1
Makefile
··· 414 414 OBJCOPY = $(CROSS_COMPILE)objcopy 415 415 OBJDUMP = $(CROSS_COMPILE)objdump 416 416 OBJSIZE = $(CROSS_COMPILE)size 417 + READELF = $(CROSS_COMPILE)readelf 417 418 PAHOLE = pahole 418 419 LEX = flex 419 420 YACC = bison ··· 473 472 CLANG_FLAGS := 474 473 475 474 export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS LD CC 476 - export CPP AR NM STRIP OBJCOPY OBJDUMP OBJSIZE PAHOLE LEX YACC AWK INSTALLKERNEL 475 + export CPP AR NM STRIP OBJCOPY OBJDUMP OBJSIZE READELF PAHOLE LEX YACC AWK INSTALLKERNEL 477 476 export PERL PYTHON PYTHON2 PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX 478 477 export KBUILD_HOSTCXXFLAGS KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS LDFLAGS_MODULE 479 478
+1 -1
arch/x86/boot/compressed/Makefile
··· 103 103 quiet_cmd_check_data_rel = DATAREL $@ 104 104 define cmd_check_data_rel 105 105 for obj in $(filter %.o,$^); do \ 106 - ${CROSS_COMPILE}readelf -S $$obj | grep -qF .rel.local && { \ 106 + $(READELF) -S $$obj | grep -qF .rel.local && { \ 107 107 echo "error: $$obj has data relocations!" >&2; \ 108 108 exit 1; \ 109 109 } || true; \
+18 -20
scripts/kallsyms.c
··· 310 310 printf("%s:\n", label); 311 311 } 312 312 313 + /* Provide proper symbols relocatability by their '_text' relativeness. */ 314 + static void output_address(unsigned long long addr) 315 + { 316 + if (_text <= addr) 317 + printf("\tPTR\t_text + %#llx\n", addr - _text); 318 + else 319 + printf("\tPTR\t_text - %#llx\n", _text - addr); 320 + } 321 + 313 322 /* uncompress a compressed symbol. When this function is called, the best table 314 323 * might still be compressed itself, so the function needs to be recursive */ 315 324 static int expand_symbol(const unsigned char *data, int len, char *result) ··· 369 360 370 361 printf("\t.section .rodata, \"a\"\n"); 371 362 372 - /* Provide proper symbols relocatability by their relativeness 373 - * to a fixed anchor point in the runtime image, either '_text' 374 - * for absolute address tables, in which case the linker will 375 - * emit the final addresses at build time. Otherwise, use the 376 - * offset relative to the lowest value encountered of all relative 377 - * symbols, and emit non-relocatable fixed offsets that will be fixed 378 - * up at runtime. 379 - * 380 - * The symbol names cannot be used to construct normal symbol 381 - * references as the list of symbols contains symbols that are 382 - * declared static and are private to their .o files. This prevents 383 - * .tmp_kallsyms.o or any other object from referencing them. 384 - */ 385 363 if (!base_relative) 386 364 output_label("kallsyms_addresses"); 387 365 else ··· 376 380 377 381 for (i = 0; i < table_cnt; i++) { 378 382 if (base_relative) { 383 + /* 384 + * Use the offset relative to the lowest value 385 + * encountered of all relative symbols, and emit 386 + * non-relocatable fixed offsets that will be fixed 387 + * up at runtime. 388 + */ 389 + 379 390 long long offset; 380 391 int overflow; 381 392 ··· 405 402 } 406 403 printf("\t.long\t%#x\n", (int)offset); 407 404 } else if (!symbol_absolute(&table[i])) { 408 - if (_text <= table[i].addr) 409 - printf("\tPTR\t_text + %#llx\n", 410 - table[i].addr - _text); 411 - else 412 - printf("\tPTR\t_text - %#llx\n", 413 - _text - table[i].addr); 405 + output_address(table[i].addr); 414 406 } else { 415 407 printf("\tPTR\t%#llx\n", table[i].addr); 416 408 } ··· 414 416 415 417 if (base_relative) { 416 418 output_label("kallsyms_relative_base"); 417 - printf("\tPTR\t_text - %#llx\n", _text - relative_base); 419 + output_address(relative_base); 418 420 printf("\n"); 419 421 } 420 422
+7
scripts/kconfig/expr.c
··· 254 254 { 255 255 int res, old_count; 256 256 257 + /* 258 + * A NULL expr is taken to be yes, but there's also a different way to 259 + * represent yes. expr_is_yes() checks for either representation. 260 + */ 261 + if (!e1 || !e2) 262 + return expr_is_yes(e1) && expr_is_yes(e2); 263 + 257 264 if (e1->type != e2->type) 258 265 return 0; 259 266 switch (e1->type) {
+4 -6
scripts/mkcompile_h
··· 55 55 if [ -n "$SMP" ] ; then CONFIG_FLAGS="SMP"; fi 56 56 if [ -n "$PREEMPT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"; fi 57 57 if [ -n "$PREEMPT_RT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT_RT"; fi 58 - UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS $TIMESTAMP" 59 58 60 59 # Truncate to maximum length 61 - 62 60 UTS_LEN=64 63 - UTS_TRUNCATE="cut -b -$UTS_LEN" 61 + UTS_VERSION="$(echo $UTS_VERSION $CONFIG_FLAGS $TIMESTAMP | cut -b -$UTS_LEN)" 64 62 65 63 # Generate a temporary compile.h 66 64 ··· 67 69 68 70 echo \#define UTS_MACHINE \"$ARCH\" 69 71 70 - echo \#define UTS_VERSION \"`echo $UTS_VERSION | $UTS_TRUNCATE`\" 72 + echo \#define UTS_VERSION \"$UTS_VERSION\" 71 73 72 - echo \#define LINUX_COMPILE_BY \"`echo $LINUX_COMPILE_BY | $UTS_TRUNCATE`\" 73 - echo \#define LINUX_COMPILE_HOST \"`echo $LINUX_COMPILE_HOST | $UTS_TRUNCATE`\" 74 + printf '#define LINUX_COMPILE_BY "%s"\n' "$LINUX_COMPILE_BY" 75 + echo \#define LINUX_COMPILE_HOST \"$LINUX_COMPILE_HOST\" 74 76 75 77 echo \#define LINUX_COMPILER \"`$CC -v 2>&1 | grep ' version ' | sed 's/[[:space:]]*$//'`\" 76 78 } > .tmpcompile
+1 -1
scripts/package/mkdebian
··· 174 174 Section: kernel 175 175 Priority: optional 176 176 Maintainer: $maintainer 177 - Build-Depends: bc, kmod, cpio, bison, flex | flex:native $extra_build_depends 177 + Build-Depends: bc, rsync, kmod, cpio, bison, flex | flex:native $extra_build_depends 178 178 Homepage: http://www.kernel.org/ 179 179 180 180 Package: $packagename
+1 -1
usr/include/Makefile
··· 91 91 # asm-generic/*.h is used by asm/*.h, and should not be included directly 92 92 header-test- += asm-generic/% 93 93 94 - extra-y := $(patsubst $(obj)/%.h,%.hdrtest, $(shell find $(obj) -name '*.h')) 94 + extra-y := $(patsubst $(obj)/%.h,%.hdrtest, $(shell find $(obj) -name '*.h' 2>/dev/null)) 95 95 96 96 quiet_cmd_hdrtest = HDRTEST $< 97 97 cmd_hdrtest = \