Skip to content

Commit 3461e95

Browse files
committed
Merge tag 'kbuild-fixes-6.18-3' of git://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux
Pull Kbuild fixes from Nathan Chancellor: - Strip trailing padding bytes from modules.builtin.modinfo to fix error during modules_install with certain versions of kmod - Drop unused static inline function warning in .c files with clang from W=1 to W=2 - Ensure kernel-doc.py invocations use the PYTHON3 make variable to ensure user's choice of Python interpreter is always respected * tag 'kbuild-fixes-6.18-3' of git://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux: kbuild: Let kernel-doc.py use PYTHON3 override compiler_types: Move unused static inline functions warning to W=2 kbuild: Strip trailing padding bytes from modules.builtin.modinfo
2 parents 439fc29 + 002621a commit 3461e95

File tree

6 files changed

+20
-8
lines changed

6 files changed

+20
-8
lines changed

drivers/gpu/drm/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ always-$(CONFIG_DRM_HEADER_TEST) += \
245245
quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
246246
cmd_hdrtest = \
247247
$(CC) $(c_flags) -fsyntax-only -x c /dev/null -include $< -include $<; \
248-
PYTHONDONTWRITEBYTECODE=1 $(KERNELDOC) -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \
248+
PYTHONDONTWRITEBYTECODE=1 $(PYTHON3) $(KERNELDOC) -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \
249249
touch $@
250250

251251
$(obj)/%.hdrtest: $(src)/%.h FORCE

drivers/gpu/drm/i915/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ obj-$(CONFIG_DRM_I915_GVT_KVMGT) += kvmgt.o
413413
#
414414
# Enable locally for CONFIG_DRM_I915_WERROR=y. See also scripts/Makefile.build
415415
ifdef CONFIG_DRM_I915_WERROR
416-
cmd_checkdoc = PYTHONDONTWRITEBYTECODE=1 $(KERNELDOC) -none -Werror $<
416+
cmd_checkdoc = PYTHONDONTWRITEBYTECODE=1 $(PYTHON3) $(KERNELDOC) -none -Werror $<
417417
endif
418418

419419
# header test

include/drm/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ always-$(CONFIG_DRM_HEADER_TEST) += \
1111
quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
1212
cmd_hdrtest = \
1313
$(CC) $(c_flags) -fsyntax-only -x c /dev/null -include $< -include $<; \
14-
PYTHONDONTWRITEBYTECODE=1 $(KERNELDOC) -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \
14+
PYTHONDONTWRITEBYTECODE=1 $(PYTHON3) $(KERNELDOC) -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \
1515
touch $@
1616

1717
$(obj)/%.hdrtest: $(src)/%.h FORCE

include/linux/compiler_types.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,9 @@ struct ftrace_likely_data {
250250
/*
251251
* GCC does not warn about unused static inline functions for -Wunused-function.
252252
* Suppress the warning in clang as well by using __maybe_unused, but enable it
253-
* for W=1 build. This will allow clang to find unused functions. Remove the
254-
* __inline_maybe_unused entirely after fixing most of -Wunused-function warnings.
253+
* for W=2 build. This will allow clang to find unused functions.
255254
*/
256-
#ifdef KBUILD_EXTRA_WARN1
255+
#ifdef KBUILD_EXTRA_WARN2
257256
#define __inline_maybe_unused
258257
#else
259258
#define __inline_maybe_unused __maybe_unused

scripts/Makefile.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ else ifeq ($(KBUILD_CHECKSRC),2)
167167
endif
168168

169169
ifneq ($(KBUILD_EXTRA_WARN),)
170-
cmd_checkdoc = PYTHONDONTWRITEBYTECODE=1 $(KERNELDOC) -none $(KDOCFLAGS) \
170+
cmd_checkdoc = PYTHONDONTWRITEBYTECODE=1 $(PYTHON3) $(KERNELDOC) -none $(KDOCFLAGS) \
171171
$(if $(findstring 2, $(KBUILD_EXTRA_WARN)), -Wall) \
172172
$<
173173
endif

scripts/Makefile.vmlinux

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,24 @@ vmlinux: vmlinux.unstripped FORCE
102102
# modules.builtin.modinfo
103103
# ---------------------------------------------------------------------------
104104

105+
# .modinfo in vmlinux.unstripped is aligned to 8 bytes for compatibility with
106+
# tools that expect vmlinux to have sufficiently aligned sections but the
107+
# additional bytes used for padding .modinfo to satisfy this requirement break
108+
# certain versions of kmod with
109+
#
110+
# depmod: ERROR: kmod_builtin_iter_next: unexpected string without modname prefix
111+
#
112+
# Strip the trailing padding bytes after extracting .modinfo to comply with
113+
# what kmod expects to parse.
114+
quiet_cmd_modules_builtin_modinfo = GEN $@
115+
cmd_modules_builtin_modinfo = $(cmd_objcopy); \
116+
sed -i 's/\x00\+$$/\x00/g' $@
117+
105118
OBJCOPYFLAGS_modules.builtin.modinfo := -j .modinfo -O binary
106119

107120
targets += modules.builtin.modinfo
108121
modules.builtin.modinfo: vmlinux.unstripped FORCE
109-
$(call if_changed,objcopy)
122+
$(call if_changed,modules_builtin_modinfo)
110123

111124
# modules.builtin
112125
# ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)