From: sashiko-bot@kernel.org
To: "Breno Leitao" <leitao@debian.org>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH v7 3/9] bootconfig: render embedded bootconfig as a kernel cmdline at build time
Date: Fri, 26 Jun 2026 13:04:22 +0000 [thread overview]
Message-ID: <20260626130423.2A7CC1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260626-bootconfig_using_tools-v7-3-24ab72139c29@debian.org>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The host-built tools/bootconfig binary shares the same output directory as the target-built tool, causing an 'Exec format error' when intermixing builds.
--
commit c67f0035f4bd8f4051e26e40c1dccfbeef9c755f
Author: Breno Leitao <leitao@debian.org>
bootconfig: render embedded bootconfig as a kernel cmdline at build time
This commit adds a build-time pipeline to render the embedded bootconfig
kernel subtree into a flat command line string. It wires up the userspace
bootconfig tool to run during the prepare phase on the host to generate
this string.
> diff --git a/Makefile b/Makefile
> index 12fd3d2d47b58..2bb1b44256b5f 100644
> --- a/Makefile
> +++ b/Makefile
[ ... ]
> @@ -1552,6 +1552,22 @@ prepare: tools/bpf/resolve_btfids
> endif
> endif
>
> +# tools/bootconfig renders the embedded bootconfig into a cmdline at build time.
> +ifdef CONFIG_CMDLINE_FROM_BOOTCONFIG
> +prepare: tools/bootconfig
> +endif
> +
> +# tools/bootconfig is run on the build host during prepare, so force a host
> +# binary here; its own Makefile keeps $(CC) for standalone and cross builds.
> +# CROSS_COMPILE= is cleared so tools/scripts/Makefile.include does not inject
> +# the target's --target=/--sysroot= flags into the host clang invocation under
> +# LLVM=1 cross builds (which would produce a target binary that fails to exec).
> +tools/bootconfig: export CC := $(HOSTCC)
> +tools/bootconfig: FORCE
> + $(Q)mkdir -p $(objtree)/tools
> + $(Q)$(MAKE) O=$(abspath $(objtree)) subdir=tools -C $(srctree)/tools/ \
> + bootconfig CROSS_COMPILE=
[Severity: Low]
Will this cause a build failure if the tool is cross-compiled for the target
before the kernel is built?
Since the tool shares the same output directory for both target and host builds,
and its Makefile does not use dependency tracking files to detect compiler
changes, is it possible make will consider a previously cross-compiled binary
to be up to date and skip rebuilding it with the host compiler?
> diff --git a/lib/Makefile b/lib/Makefile
> index 7f75cc6edf94a..4ccdce2fd5e5b 100644
> --- a/lib/Makefile
> +++ b/lib/Makefile
[ ... ]
> @@ -273,6 +273,22 @@ filechk_defbconf = cat $(or $(real-prereqs), /dev/null)
> $(obj)/default.bconf: $(CONFIG_BOOT_CONFIG_EMBED_FILE) FORCE
> $(call filechk,defbconf)
>
> +obj-$(CONFIG_CMDLINE_FROM_BOOTCONFIG) += embedded-cmdline.o
> +$(obj)/embedded-cmdline.o: $(obj)/embedded_cmdline.bin
> +
> +# Render the bootconfig "kernel" subtree to a flat cmdline string using
> +# the userspace tools/bootconfig parser (-C mode). The runtime prepend
> +# helper enforces COMMAND_LINE_SIZE at boot, so no build-time size
> +# check is performed here (COMMAND_LINE_SIZE is an arch header
> +# constant, not a Kconfig value).
> +quiet_cmd_render_cmdline = BCONF2C $@
> + cmd_render_cmdline = \
> + $(objtree)/tools/bootconfig/bootconfig -C $< > $@
[Severity: Low]
If the prepare phase skips rebuilding the tool because a cross-compiled
version already exists, will this execution fail with an Exec format error
when it attempts to run a target architecture binary on the build host?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260626-bootconfig_using_tools-v7-0-24ab72139c29@debian.org?part=3
next prev parent reply other threads:[~2026-06-26 13:04 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-26 12:50 [PATCH v7 0/9] bootconfig: embed kernel.* cmdline at build time Breno Leitao
2026-06-26 12:50 ` [PATCH v7 1/9] bootconfig: fix NULL-pointer arithmetic in xbc_snprint_cmdline() Breno Leitao
2026-06-26 12:50 ` [PATCH v7 2/9] bootconfig: render descendant keys when xbc_snprint_cmdline() root has a value Breno Leitao
2026-06-26 12:50 ` [PATCH v7 3/9] bootconfig: render embedded bootconfig as a kernel cmdline at build time Breno Leitao
2026-06-26 13:04 ` sashiko-bot [this message]
2026-06-26 12:50 ` [PATCH v7 4/9] bootconfig: clean build-time tools/bootconfig from make clean Breno Leitao
2026-06-26 12:50 ` [PATCH v7 5/9] bootconfig: add xbc_prepend_embedded_cmdline() helper Breno Leitao
2026-06-26 12:50 ` [PATCH v7 6/9] Documentation: bootconfig: document build-time cmdline rendering Breno Leitao
2026-06-26 12:50 ` [PATCH v7 7/9] x86/setup: prepend embedded bootconfig cmdline before parse_early_param Breno Leitao
2026-06-26 12:50 ` [PATCH v7 8/9] bootconfig: skip runtime kernel.* render once prepended early Breno Leitao
2026-06-26 12:50 ` [PATCH v7 9/9] init/main.c: use bootconfig_cmdline_requested() for the runtime opt-in Breno Leitao
2026-06-26 14:33 ` [PATCH v7 0/9] bootconfig: embed kernel.* cmdline at build time Masami Hiramatsu
2026-06-26 14:53 ` Breno Leitao
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=20260626130423.2A7CC1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=leitao@debian.org \
--cc=sashiko-reviews@lists.linux.dev \
/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