Skip to content

Commit 6c160f1

Browse files
committed
Merge tag 'kbuild-fixes-v6.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull Kbuild fixes from Masahiro Yamada: - Reformat nested if-conditionals in Makefiles with 4 spaces - Fix CONFIG_DEBUG_INFO_BTF builds for big endian - Fix modpost for module srcversion - Fix an escape sequence warning in gen_compile_commands.py - Fix kallsyms to ignore ARMv4 thunk symbols * tag 'kbuild-fixes-v6.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kallsyms: ignore ARMv4 thunks along with others modpost: trim leading spaces when processing source files list gen_compile_commands: fix invalid escape sequence warning kbuild: Fix changing ELF file type for output of gen_btf for big endian docs: kconfig: Fix grammar and formatting kbuild: use 4-space indentation when followed by conditionals
2 parents ddac3d8 + a951884 commit 6c160f1

File tree

9 files changed

+33
-32
lines changed

9 files changed

+33
-32
lines changed

Documentation/kbuild/Kconfig.recursion-issue-01

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
# that are possible for CORE. So for example if CORE_BELL_A_ADVANCED is 'y',
1717
# CORE must be 'y' too.
1818
#
19-
# * What influences CORE_BELL_A_ADVANCED ?
19+
# * What influences CORE_BELL_A_ADVANCED?
2020
#
2121
# As the name implies CORE_BELL_A_ADVANCED is an advanced feature of
2222
# CORE_BELL_A so naturally it depends on CORE_BELL_A. So if CORE_BELL_A is 'y'
2323
# we know CORE_BELL_A_ADVANCED can be 'y' too.
2424
#
25-
# * What influences CORE_BELL_A ?
25+
# * What influences CORE_BELL_A?
2626
#
2727
# CORE_BELL_A depends on CORE, so CORE influences CORE_BELL_A.
2828
#
@@ -34,7 +34,7 @@
3434
# the "recursive dependency detected" error.
3535
#
3636
# Reading the Documentation/kbuild/Kconfig.recursion-issue-01 file it may be
37-
# obvious that an easy to solution to this problem should just be the removal
37+
# obvious that an easy solution to this problem should just be the removal
3838
# of the "select CORE" from CORE_BELL_A_ADVANCED as that is implicit already
3939
# since CORE_BELL_A depends on CORE. Recursive dependency issues are not always
4040
# so trivial to resolve, we provide another example below of practical

Makefile

+6-6
Original file line numberDiff line numberDiff line change
@@ -294,15 +294,15 @@ may-sync-config := 1
294294
single-build :=
295295

296296
ifneq ($(filter $(no-dot-config-targets), $(MAKECMDGOALS)),)
297-
ifeq ($(filter-out $(no-dot-config-targets), $(MAKECMDGOALS)),)
297+
ifeq ($(filter-out $(no-dot-config-targets), $(MAKECMDGOALS)),)
298298
need-config :=
299-
endif
299+
endif
300300
endif
301301

302302
ifneq ($(filter $(no-sync-config-targets), $(MAKECMDGOALS)),)
303-
ifeq ($(filter-out $(no-sync-config-targets), $(MAKECMDGOALS)),)
303+
ifeq ($(filter-out $(no-sync-config-targets), $(MAKECMDGOALS)),)
304304
may-sync-config :=
305-
endif
305+
endif
306306
endif
307307

308308
need-compiler := $(may-sync-config)
@@ -323,9 +323,9 @@ endif
323323
# We cannot build single targets and the others at the same time
324324
ifneq ($(filter $(single-targets), $(MAKECMDGOALS)),)
325325
single-build := 1
326-
ifneq ($(filter-out $(single-targets), $(MAKECMDGOALS)),)
326+
ifneq ($(filter-out $(single-targets), $(MAKECMDGOALS)),)
327327
mixed-build := 1
328-
endif
328+
endif
329329
endif
330330

331331
# For "make -j clean all", "make -j mrproper defconfig all", etc.

arch/m68k/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
KBUILD_DEFCONFIG := multi_defconfig
1616

1717
ifdef cross_compiling
18-
ifeq ($(CROSS_COMPILE),)
18+
ifeq ($(CROSS_COMPILE),)
1919
CROSS_COMPILE := $(call cc-cross-prefix, \
2020
m68k-linux-gnu- m68k-linux- m68k-unknown-linux-gnu-)
21-
endif
21+
endif
2222
endif
2323

2424
#

arch/parisc/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ export CROSS32CC
5050

5151
# Set default cross compiler for kernel build
5252
ifdef cross_compiling
53-
ifeq ($(CROSS_COMPILE),)
53+
ifeq ($(CROSS_COMPILE),)
5454
CC_SUFFIXES = linux linux-gnu unknown-linux-gnu suse-linux
5555
CROSS_COMPILE := $(call cc-cross-prefix, \
5656
$(foreach a,$(CC_ARCHES), \
5757
$(foreach s,$(CC_SUFFIXES),$(a)-$(s)-)))
58-
endif
58+
endif
5959
endif
6060

6161
ifdef CONFIG_DYNAMIC_FTRACE

arch/x86/Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,13 @@ ifeq ($(CONFIG_X86_32),y)
112112
# temporary until string.h is fixed
113113
KBUILD_CFLAGS += -ffreestanding
114114

115-
ifeq ($(CONFIG_STACKPROTECTOR),y)
116-
ifeq ($(CONFIG_SMP),y)
115+
ifeq ($(CONFIG_STACKPROTECTOR),y)
116+
ifeq ($(CONFIG_SMP),y)
117117
KBUILD_CFLAGS += -mstack-protector-guard-reg=fs -mstack-protector-guard-symbol=__stack_chk_guard
118-
else
118+
else
119119
KBUILD_CFLAGS += -mstack-protector-guard=global
120-
endif
121120
endif
121+
endif
122122
else
123123
BITS := 64
124124
UTS_MACHINE := x86_64

scripts/clang-tools/gen_compile_commands.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def process_line(root_directory, command_prefix, file_path):
170170
# escape the pound sign '#', either as '\#' or '$(pound)' (depending on the
171171
# kernel version). The compile_commands.json file is not interepreted
172172
# by Make, so this code replaces the escaped version with '#'.
173-
prefix = command_prefix.replace('\#', '#').replace('$(pound)', '#')
173+
prefix = command_prefix.replace(r'\#', '#').replace('$(pound)', '#')
174174

175175
# Return the canonical path, eliminating any symbolic links encountered in the path.
176176
abs_path = os.path.realpath(os.path.join(root_directory, file_path))

scripts/link-vmlinux.sh

+7-2
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,13 @@ gen_btf()
135135
${OBJCOPY} --only-section=.BTF --set-section-flags .BTF=alloc,readonly \
136136
--strip-all ${1} ${2} 2>/dev/null
137137
# Change e_type to ET_REL so that it can be used to link final vmlinux.
138-
# Unlike GNU ld, lld does not allow an ET_EXEC input.
139-
printf '\1' | dd of=${2} conv=notrunc bs=1 seek=16 status=none
138+
# GNU ld 2.35+ and lld do not allow an ET_EXEC input.
139+
if is_enabled CONFIG_CPU_BIG_ENDIAN; then
140+
et_rel='\0\1'
141+
else
142+
et_rel='\1\0'
143+
fi
144+
printf "${et_rel}" | dd of=${2} conv=notrunc bs=1 seek=16 status=none
140145
}
141146

142147
# Create ${2} .S file with all symbols from the ${1} object file

scripts/mksysmap

+2-11
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,8 @@ ${NM} -n ${1} | sed >${2} -e "
4848
/ __kvm_nvhe_\\$/d
4949
/ __kvm_nvhe_\.L/d
5050
51-
# arm64 lld
52-
/ __AArch64ADRPThunk_/d
53-
54-
# arm lld
55-
/ __ARMV5PILongThunk_/d
56-
/ __ARMV7PILongThunk_/d
57-
/ __ThumbV7PILongThunk_/d
58-
59-
# mips lld
60-
/ __LA25Thunk_/d
61-
/ __microLA25Thunk_/d
51+
# lld arm/aarch64/mips thunks
52+
/ __[[:alnum:]]*Thunk_/d
6253
6354
# CFI type identifiers
6455
/ __kcfi_typeid_/d

scripts/mod/sumversion.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,12 @@ static int parse_source_files(const char *objfile, struct md4_ctx *md)
326326

327327
/* Sum all files in the same dir or subdirs. */
328328
while ((line = get_line(&pos))) {
329-
char* p = line;
329+
char* p;
330+
331+
/* trim the leading spaces away */
332+
while (isspace(*line))
333+
line++;
334+
p = line;
330335

331336
if (strncmp(line, "source_", sizeof("source_")-1) == 0) {
332337
p = strrchr(line, ' ');

0 commit comments

Comments
 (0)