Skip to content

Commit 35697d8

Browse files
committed
Merge tag 'kbuild-fixes-v6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull Kbuild fixes from Masahiro Yamada: - Use POSIX-compatible grep options - Document git-related tips for reproducible builds - Fix a typo in the modpost rule - Suppress SIGPIPE error message from gcc-ar and llvm-ar - Fix segmentation fault in the menuconfig search * tag 'kbuild-fixes-v6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kconfig: fix segmentation fault in menuconfig search kbuild: fix SIGPIPE error message for AR=gcc-ar and AR=llvm-ar kbuild: fix typo in modpost Documentation: kbuild: Add description of git for reproducible builds kbuild: use POSIX-compatible grep option
2 parents 089d1c3 + 7a263a0 commit 35697d8

File tree

4 files changed

+16
-21
lines changed

4 files changed

+16
-21
lines changed

Documentation/kbuild/reproducible-builds.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,16 @@ To avoid this, you can make the vDSO different for different
119119
kernel versions by including an arbitrary string of "salt" in it.
120120
This is specified by the Kconfig symbol ``CONFIG_BUILD_SALT``.
121121

122+
Git
123+
---
124+
125+
Uncommitted changes or different commit ids in git can also lead
126+
to different compilation results. For example, after executing
127+
``git reset HEAD^``, even if the code is the same, the
128+
``include/config/kernel.release`` generated during compilation
129+
will be different, which will eventually lead to binary differences.
130+
See ``scripts/setlocalversion`` for details.
131+
122132
.. _KBUILD_BUILD_TIMESTAMP: kbuild.html#kbuild-build-timestamp
123133
.. _KBUILD_BUILD_USER and KBUILD_BUILD_HOST: kbuild.html#kbuild-build-user-kbuild-build-host
124134
.. _KCFLAGS: kbuild.html#kcflags

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1218,7 +1218,7 @@ quiet_cmd_ar_vmlinux.a = AR $@
12181218
cmd_ar_vmlinux.a = \
12191219
rm -f $@; \
12201220
$(AR) cDPrST $@ $(KBUILD_VMLINUX_OBJS); \
1221-
$(AR) mPiT $$($(AR) t $@ | head -n1) $@ $$($(AR) t $@ | grep -F --file=$(srctree)/scripts/head-object-list.txt)
1221+
$(AR) mPiT $$($(AR) t $@ | sed -n 1p) $@ $$($(AR) t $@ | grep -F -f $(srctree)/scripts/head-object-list.txt)
12221222

12231223
targets += vmlinux.a
12241224
vmlinux.a: $(KBUILD_VMLINUX_OBJS) scripts/head-object-list.txt autoksyms_recursive FORCE

scripts/Makefile.modpost

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ quiet_cmd_modpost = MODPOST $@
122122
sed 's/ko$$/o/' $(or $(modorder-if-needed), /dev/null) | $(MODPOST) $(modpost-args) -T - $(vmlinux.o-if-present)
123123

124124
targets += $(output-symdump)
125-
$(output-symdump): $(modorder-if-needed) $(vmlinux.o-if-present) $(moudle.symvers-if-present) $(MODPOST) FORCE
125+
$(output-symdump): $(modorder-if-needed) $(vmlinux.o-if-present) $(module.symvers-if-present) $(MODPOST) FORCE
126126
$(call if_changed,modpost)
127127

128128
__modpost: $(output-symdump)

scripts/kconfig/menu.c

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -722,8 +722,8 @@ static void get_prompt_str(struct gstr *r, struct property *prop,
722722
if (!expr_eq(prop->menu->dep, prop->visible.expr))
723723
get_dep_str(r, prop->visible.expr, " Visible if: ");
724724

725-
menu = prop->menu->parent;
726-
for (i = 0; menu && i < 8; menu = menu->parent) {
725+
menu = prop->menu;
726+
for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent) {
727727
bool accessible = menu_is_visible(menu);
728728

729729
submenu[i++] = menu;
@@ -733,16 +733,7 @@ static void get_prompt_str(struct gstr *r, struct property *prop,
733733
if (head && location) {
734734
jump = xmalloc(sizeof(struct jump_key));
735735

736-
if (menu_is_visible(prop->menu)) {
737-
/*
738-
* There is not enough room to put the hint at the
739-
* beginning of the "Prompt" line. Put the hint on the
740-
* last "Location" line even when it would belong on
741-
* the former.
742-
*/
743-
jump->target = prop->menu;
744-
} else
745-
jump->target = location;
736+
jump->target = location;
746737

747738
if (list_empty(head))
748739
jump->index = 0;
@@ -758,13 +749,7 @@ static void get_prompt_str(struct gstr *r, struct property *prop,
758749
menu = submenu[i];
759750
if (jump && menu == location)
760751
jump->offset = strlen(r->s);
761-
762-
if (menu == &rootmenu)
763-
/* The real rootmenu prompt is ugly */
764-
str_printf(r, "%*cMain menu", j, ' ');
765-
else
766-
str_printf(r, "%*c-> %s", j, ' ', menu_get_prompt(menu));
767-
752+
str_printf(r, "%*c-> %s", j, ' ', menu_get_prompt(menu));
768753
if (menu->sym) {
769754
str_printf(r, " (%s [=%s])", menu->sym->name ?
770755
menu->sym->name : "<choice>",

0 commit comments

Comments
 (0)