Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit ec9eeb8

Browse files
committed
Merge tag 'kbuild-fixes-v6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull Kbuild fixes from Masahiro Yamada: - Fix a Kconfig bug regarding comparisons to 'm' or 'n' - Replace missed $(srctree)/$(src) - Fix unneeded kallsyms step 3 - Remove incorrect "compatible" properties from image nodes in image.fit - Improve gen_kheaders.sh - Fix 'make dt_binding_check' - Clean up unnecessary code * tag 'kbuild-fixes-v6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: dt-bindings: kbuild: Fix dt_binding_check on unconfigured build kheaders: use `command -v` to test for existence of `cpio` kheaders: explicitly define file modes for archived headers scripts/make_fit: Drop fdt image entry compatible string kbuild: remove a stale comment about cleaning in link-vmlinux.sh kbuild: fix short log for AS in link-vmlinux.sh kbuild: change scripts/mksysmap into sed script kbuild: avoid unneeded kallsyms step 3 kbuild: scripts/gdb: Replace missed $(srctree)/$(src) w/ $(src) kconfig: remove redundant check in expr_join_or() kconfig: fix comparison to constant symbols, 'm', 'n' kconfig: remove unused expr_is_no()
2 parents bbeb121 + 1b1c9f0 commit ec9eeb8

File tree

9 files changed

+25
-41
lines changed

9 files changed

+25
-41
lines changed

kernel/gen_kheaders.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ include/
1414
arch/$SRCARCH/include/
1515
"
1616

17-
type cpio > /dev/null
17+
if ! command -v cpio >/dev/null; then
18+
echo >&2 "***"
19+
echo >&2 "*** 'cpio' could not be found."
20+
echo >&2 "***"
21+
exit 1
22+
fi
1823

1924
# Support incremental builds by skipping archive generation
2025
# if timestamps of files being archived are not changed.
@@ -84,7 +89,7 @@ find $cpio_dir -type f -print0 |
8489

8590
# Create archive and try to normalize metadata for reproducibility.
8691
tar "${KBUILD_BUILD_TIMESTAMP:+--mtime=$KBUILD_BUILD_TIMESTAMP}" \
87-
--owner=0 --group=0 --sort=name --numeric-owner \
92+
--owner=0 --group=0 --sort=name --numeric-owner --mode=u=rw,go=r,a+X \
8893
-I $XZ -cf $tarfile -C $cpio_dir/ . > /dev/null
8994

9095
echo $headers_md5 > kernel/kheaders.md5

scripts/dtc/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# *** Also keep .gitignore in sync when changing ***
55
hostprogs-always-$(CONFIG_DTC) += dtc fdtoverlay
6-
hostprogs-always-$(CHECK_DT_BINDING) += dtc
6+
hostprogs-always-$(CHECK_DTBS) += dtc
77

88
dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \
99
srcpos.o checks.o util.o

scripts/gdb/linux/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ifdef building_out_of_srctree
55
symlinks := $(patsubst $(src)/%,%,$(wildcard $(src)/*.py))
66

77
quiet_cmd_symlink = SYMLINK $@
8-
cmd_symlink = ln -fsn $(patsubst $(obj)/%,$(abspath $(srctree))/$(src)/%,$@) $@
8+
cmd_symlink = ln -fsn $(patsubst $(obj)/%,$(src)/%,$@) $@
99

1010
always-y += $(symlinks)
1111
$(addprefix $(obj)/, $(symlinks)): FORCE

scripts/kconfig/expr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ static struct expr *expr_join_or(struct expr *e1, struct expr *e2)
476476
return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_yes);
477477
}
478478
}
479-
if (sym1->type == S_BOOLEAN && sym1 == sym2) {
479+
if (sym1->type == S_BOOLEAN) {
480480
if ((e1->type == E_NOT && e1->left.expr->type == E_SYMBOL && e2->type == E_SYMBOL) ||
481481
(e2->type == E_NOT && e2->left.expr->type == E_SYMBOL && e1->type == E_SYMBOL))
482482
return expr_alloc_symbol(&symbol_yes);

scripts/kconfig/expr.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,11 +302,6 @@ static inline int expr_is_yes(struct expr *e)
302302
return !e || (e->type == E_SYMBOL && e->left.sym == &symbol_yes);
303303
}
304304

305-
static inline int expr_is_no(struct expr *e)
306-
{
307-
return e && (e->type == E_SYMBOL && e->left.sym == &symbol_no);
308-
}
309-
310305
#ifdef __cplusplus
311306
}
312307
#endif

scripts/kconfig/symbol.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,23 @@
1414

1515
struct symbol symbol_yes = {
1616
.name = "y",
17+
.type = S_TRISTATE,
1718
.curr = { "y", yes },
1819
.menus = LIST_HEAD_INIT(symbol_yes.menus),
1920
.flags = SYMBOL_CONST|SYMBOL_VALID,
2021
};
2122

2223
struct symbol symbol_mod = {
2324
.name = "m",
25+
.type = S_TRISTATE,
2426
.curr = { "m", mod },
2527
.menus = LIST_HEAD_INIT(symbol_mod.menus),
2628
.flags = SYMBOL_CONST|SYMBOL_VALID,
2729
};
2830

2931
struct symbol symbol_no = {
3032
.name = "n",
33+
.type = S_TRISTATE,
3134
.curr = { "n", no },
3235
.menus = LIST_HEAD_INIT(symbol_no.menus),
3336
.flags = SYMBOL_CONST|SYMBOL_VALID,
@@ -820,8 +823,7 @@ const char *sym_get_string_value(struct symbol *sym)
820823
case no:
821824
return "n";
822825
case mod:
823-
sym_calc_value(modules_sym);
824-
return (modules_sym->curr.tri == no) ? "n" : "m";
826+
return "m";
825827
case yes:
826828
return "y";
827829
}

scripts/link-vmlinux.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,10 @@ kallsyms_step()
179179
kallsyms_S=${kallsyms_vmlinux}.S
180180

181181
vmlinux_link ${kallsyms_vmlinux} "${kallsymso_prev}" ${btf_vmlinux_bin_o}
182-
mksysmap ${kallsyms_vmlinux} ${kallsyms_vmlinux}.syms ${kallsymso_prev}
182+
mksysmap ${kallsyms_vmlinux} ${kallsyms_vmlinux}.syms
183183
kallsyms ${kallsyms_vmlinux}.syms ${kallsyms_S}
184184

185-
info AS ${kallsyms_S}
185+
info AS ${kallsymso}
186186
${CC} ${NOSTDINC_FLAGS} ${LINUXINCLUDE} ${KBUILD_CPPFLAGS} \
187187
${KBUILD_AFLAGS} ${KBUILD_AFLAGS_KERNEL} \
188188
-c -o ${kallsymso} ${kallsyms_S}
@@ -193,15 +193,14 @@ kallsyms_step()
193193
mksysmap()
194194
{
195195
info NM ${2}
196-
${CONFIG_SHELL} "${srctree}/scripts/mksysmap" ${1} ${2} ${3}
196+
${NM} -n "${1}" | "${srctree}/scripts/mksysmap" > "${2}"
197197
}
198198

199199
sorttable()
200200
{
201201
${objtree}/scripts/sorttable ${1}
202202
}
203203

204-
# Delete output files in case of error
205204
cleanup()
206205
{
207206
rm -f .btf.*
@@ -282,7 +281,7 @@ if is_enabled CONFIG_DEBUG_INFO_BTF && is_enabled CONFIG_BPF; then
282281
${RESOLVE_BTFIDS} vmlinux
283282
fi
284283

285-
mksysmap vmlinux System.map ${kallsymso}
284+
mksysmap vmlinux System.map
286285

287286
if is_enabled CONFIG_BUILDTIME_TABLE_SORT; then
288287
info SORTTAB vmlinux

scripts/make_fit.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def output_dtb(fsw, seq, fname, arch, compress):
190190
Args:
191191
fsw (libfdt.FdtSw): Object to use for writing
192192
seq (int): Sequence number (1 for first)
193-
fmame (str): Filename containing the DTB
193+
fname (str): Filename containing the DTB
194194
arch: FIT architecture, e.g. 'arm64'
195195
compress (str): Compressed algorithm, e.g. 'gzip'
196196
@@ -211,7 +211,6 @@ def output_dtb(fsw, seq, fname, arch, compress):
211211
fsw.property_string('type', 'flat_dt')
212212
fsw.property_string('arch', arch)
213213
fsw.property_string('compression', compress)
214-
fsw.property('compatible', bytes(compat))
215214

216215
with open(fname, 'rb') as inf:
217216
compressed = compress_data(inf, compress)

scripts/mksysmap

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
1-
#!/bin/sh -x
2-
# Based on the vmlinux file create the System.map file
1+
#!/bin/sed -f
2+
# SPDX-License-Identifier: GPL-2.0-only
3+
#
4+
# sed script to filter out symbols that are not needed for System.map,
5+
# or not suitable for kallsyms. The input should be 'nm -n <file>'.
6+
#
37
# System.map is used by module-init tools and some debugging
48
# tools to retrieve the actual addresses of symbols in the kernel.
59
#
6-
# Usage
7-
# mksysmap vmlinux System.map [exclude]
8-
9-
10-
#####
11-
# Generate System.map (actual filename passed as second argument)
12-
# The following refers to the symbol type as per nm(1).
13-
1410
# readprofile starts reading symbols when _stext is found, and
1511
# continue until it finds a symbol which is not either of 'T', 't',
1612
# 'W' or 'w'.
1713
#
18-
19-
${NM} -n ${1} | sed >${2} -e "
2014
# ---------------------------------------------------------------------------
2115
# Ignored symbol types
2216
#
@@ -92,13 +86,3 @@ ${NM} -n ${1} | sed >${2} -e "
9286
# ppc stub
9387
/\.long_branch\./d
9488
/\.plt_branch\./d
95-
96-
# ---------------------------------------------------------------------------
97-
# Ignored kallsyms symbols
98-
#
99-
# If the 3rd parameter exists, symbols from it will be omitted from the output.
100-
# This makes kallsyms have the identical symbol lists in the step 1 and 2.
101-
# Without this, the step2 would get new symbols generated by scripts/kallsyms.c
102-
# when CONFIG_KALLSYMS_ALL is enabled. That might require one more pass.
103-
$(if [ $# -ge 3 ]; then ${NM} ${3} | sed -n '/ U /!s:.* \([^ ]*\)$:/ \1$/d:p'; fi)
104-
"

0 commit comments

Comments
 (0)