From: Sasha Levin <sashal@kernel.org>
To: patches@lists.linux.dev, stable@vger.kernel.org
Cc: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
"Nicolas Schier" <nsc@kernel.org>,
"Nathan Chancellor" <nathan@kernel.org>,
"Sasha Levin" <sashal@kernel.org>,
linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH AUTOSEL 6.19-6.12] kbuild: install-extmod-build: Package resolve_btfids if necessary
Date: Tue, 10 Mar 2026 05:01:07 -0400 [thread overview]
Message-ID: <20260310090145.2709021-7-sashal@kernel.org> (raw)
In-Reply-To: <20260310090145.2709021-1-sashal@kernel.org>
From: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
[ Upstream commit 459cb3c054c2352bb321648744b620259a716b60 ]
When CONFIG_DEBUG_INFO_BTF_MODULES is enabled and vmlinux is available,
Makefile.modfinal and gen-btf.sh will try to use resolve_btfids on the
module .ko. install-extmod-build currently does not package
resolve_btfids, so that step fails.
Package resolve_btfids if it may be used.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Reviewed-by: Nicolas Schier <nsc@kernel.org>
Link: https://patch.msgid.link/20260226-kbuild-resolve_btfids-v1-1-2bf38b93dfe7@linutronix.de
[nathan: Small commit message tweaks]
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
Now I have a clear picture. Let me verify the `RESOLVE_BTFIDS` variable
definition and confirm it would fail when building external modules
without this tool packaged.
The issue is clear: When `CONFIG_DEBUG_INFO_BTF_MODULES` is enabled,
`Makefile.modfinal` at line 47 calls `$(RESOLVE_BTFIDS)` (defined as
`$(objtree)/tools/bpf/resolve_btfids/resolve_btfids` in the main
Makefile). If someone builds an external module using the installed
headers/build files (packaged by `install-extmod-build`), and the
`resolve_btfids` binary wasn't packaged, the build will fail at that
step.
## Analysis
### What the commit does
This commit adds packaging of the `resolve_btfids` binary when
`CONFIG_DEBUG_INFO_BTF_MODULES` is enabled in the `install-extmod-build`
script. This script creates the minimal build environment needed for
building external (out-of-tree) kernel modules.
### The bug
When `CONFIG_DEBUG_INFO_BTF_MODULES` is enabled and `vmlinux` is
available, `Makefile.modfinal` (line 47) invokes `$(RESOLVE_BTFIDS)` on
module `.ko` files. The `install-extmod-build` script packages
everything needed to build external modules, but it was missing
`resolve_btfids`. This causes external module builds to **fail** with a
missing binary error.
### Is this a real bug fix?
**Yes** — this is a build fix. Without this change, users who install
kernel headers packages (deb-pkg, rpm-pkg) with
`CONFIG_DEBUG_INFO_BTF_MODULES=y` cannot build external modules.
External module building is a core use case for distributions (DKMS,
NVIDIA drivers, VirtualBox, ZFS, etc.).
### Scope and risk
- **3 lines added** — extremely small and contained
- Follows the exact same pattern as the existing `CONFIG_OBJTOOL`
conditional packaging (lines 31-33)
- No behavioral change to anything else
- Only affects the packaging script, not runtime kernel behavior
- Risk of regression is essentially zero
### Stable tree applicability
- The `install-extmod-build` script exists since v6.6
- The `CONFIG_DEBUG_INFO_BTF_MODULES` and `resolve_btfids` usage in
`Makefile.modfinal` also exists in older stable trees
- The fix would apply cleanly or with minor adaptation to 6.6.y and
newer stable trees
- This matches the "build fix" exception category — it prevents
compilation/build failures
### Concern
The exact form of the script has evolved over time (e.g., v6.6 has
slightly different structure), so backporting to older stable trees may
need minor adjustments, but the logic is the same.
### Verification
- Read `scripts/package/install-extmod-build` — confirmed the fix adds
`resolve_btfids` packaging with same pattern as `objtool`
- Read `scripts/Makefile.modfinal` lines 41-63 — confirmed that
`$(RESOLVE_BTFIDS)` is called when `CONFIG_DEBUG_INFO_BTF_MODULES` is
enabled and `vmlinux` exists
- Checked `Makefile` line 536 — confirmed `RESOLVE_BTFIDS` points to
`$(objtree)/tools/bpf/resolve_btfids/resolve_btfids`
- `git tag --contains` on the earliest form of `install-extmod-build` —
confirmed file exists since v6.6
- Checked `v6.6:scripts/package/install-extmod-build` — confirmed the
script existed with similar structure but without `resolve_btfids`
packaging
- The commit message clearly states the problem: "install-extmod-build
currently does not package resolve_btfids, so that step fails"
- Reviewed-by: Nicolas Schier (kbuild expert) confirms the fix is
correct
This is a clear build fix: small, obvious, low-risk, fixes a real
failure that affects users building external modules with BTF-enabled
kernels. It fits squarely within the stable kernel "build fix" category.
**YES**
scripts/package/install-extmod-build | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/scripts/package/install-extmod-build b/scripts/package/install-extmod-build
index 2576cf7902dbb..f12e1ffe409eb 100755
--- a/scripts/package/install-extmod-build
+++ b/scripts/package/install-extmod-build
@@ -32,6 +32,10 @@ mkdir -p "${destdir}"
echo tools/objtool/objtool
fi
+ if is_enabled CONFIG_DEBUG_INFO_BTF_MODULES; then
+ echo tools/bpf/resolve_btfids/resolve_btfids
+ fi
+
echo Module.symvers
echo "arch/${SRCARCH}/include/generated"
echo include/config/auto.conf
--
2.51.0
next prev parent reply other threads:[~2026-03-10 9:01 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-10 9:01 [PATCH AUTOSEL 6.19-6.18] ALSA: hda/hdmi: Add Tegra238 HDA codec device ID Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-6.18] ASoC: amd: acp: Add ACP6.3 match entries for Cirrus Logic parts Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-5.10] nvme-pci: ensure we're polling a polled queue Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-6.18] ASoC: cs35l56: Only patch ASP registers if the DAI is part of a DAIlink Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-6.12] ALSA: hda/senary: Ensure EAPD is enabled during init Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-5.10] ASoC: fsl_easrc: Fix event generation in fsl_easrc_iec958_set_reg() Sasha Levin
2026-03-10 9:01 ` Sasha Levin [this message]
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-6.12] scsi: devinfo: Add BLIST_SKIP_IO_HINTS for Iomega ZIP Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-6.18] block: break pcpu_alloc_mutex dependency on freeze_lock Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-6.18] platform/x86: oxpec: Add support for OneXPlayer X1z Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19] spi: spi-dw-dma: fix print error log when wait finish transaction Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-6.6] HID: asus: add xg mobile 2023 external hardware support Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-6.18] ASoC: rt1321: fix DMIC ch2/3 mask issue Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-6.12] drm/ttm/tests: Fix build failure on PREEMPT_RT Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-6.12] bpf: Fix u32/s32 bounds when ranges cross min/max boundary Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-5.10] HID: mcp2221: cancel last I2C command on read error Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-5.15] platform/x86: intel-hid: Add Dell 14 Plus 2-in-1 to dmi_vgbs_allow_list Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-5.10] HID: asus: avoid memory leak in asus_report_fixup() Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-6.12] scsi: mpi3mr: Clear reset history on ready and recheck state after timeout Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-6.18] platform/x86: oxpec: Add support for Aokzoe A2 Pro Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19] platform/x86: hp-wmi: Add Victus 16-d0xxx support Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-5.10] platform/x86: touchscreen_dmi: Add quirk for y-inverted Goodix touchscreen on SUPI S10 Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-6.1] HID: apple: avoid memory leak in apple_report_fixup() Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-5.10] platform/x86: intel-hid: Enable 5-button array on ThinkPad X1 Fold 16 Gen 1 Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-6.18] ASoC: Intel: sof_sdw: Add quirk for Alienware Area 51 (2025) 0CCD SKU Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-6.18] platform/x86: hp-wmi: Add Omen 16-xd0xxx fan and thermal support Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-6.12] HID: apple: Add EPOMAKER TH87 to the non-apple keyboards list Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-6.18] platform/x86: hp-wmi: Add Omen 16-wf0xxx fan and thermal support Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-5.15] nvme-pci: cap queue creation to used queues Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-5.10] dma-buf: Include ioctl.h in UAPI header Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-6.18] platform/x86: oxpec: Add support for OneXPlayer X1 Air Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19] platform/x86: hp-wmi: add Omen 14-fb1xxx (board 8E41) support Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-5.15] net: usb: r8152: add TRENDnet TUC-ET2G Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-6.18] platform/x86: oxpec: Add support for OneXPlayer APEX Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-5.10] ASoC: fsl_easrc: Fix event generation in fsl_easrc_iec958_put_bits() Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-5.15] HID: magicmouse: fix battery reporting for Apple Magic Trackpad 2 Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-6.18] HID: intel-ish-hid: ipc: Add Nova Lake-H/S PCI device IDs Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-6.1] nvme-fabrics: use kfree_sensitive() for DHCHAP secrets Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-5.15] module: Fix kernel panic when a symbol st_shndx is out of bounds Sasha Levin
2026-03-10 9:01 ` [PATCH AUTOSEL 6.19-5.15] HID: magicmouse: avoid memory leak in magicmouse_report_fixup() Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260310090145.2709021-7-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=nsc@kernel.org \
--cc=patches@lists.linux.dev \
--cc=stable@vger.kernel.org \
--cc=thomas.weissschuh@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox