From: sashiko-bot@kernel.org
To: "Breno Leitao" <leitao@debian.org>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH v2 3/6] bootconfig: render embedded bootconfig as a kernel cmdline at build time
Date: Fri, 05 Jun 2026 12:13:54 +0000 [thread overview]
Message-ID: <20260605121354.A61741F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260605-bootconfig_using_tools-v2-3-d309f544b5f7@debian.org>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Replacing `$(CC)` with `$(HOSTCC)` in `tools/bootconfig/Makefile` breaks cross-compilation of the tool for the target architecture, and incorrectly passes target `CFLAGS` and `LDFLAGS` to the host compiler.
--
commit ea99f5270759e89336f3c07278a0b9ccf9b626a4
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 "kernel" subtree of
CONFIG_BOOT_CONFIG_EMBED_FILE into a flat cmdline string. It also updates
tools/bootconfig/Makefile to use HOSTCC instead of CC so the tool can
execute on the build host during the kernel's prepare phase.
> diff --git a/tools/bootconfig/Makefile b/tools/bootconfig/Makefile
> index 90eb47c9d8de6..aa75a7828685b 100644
> --- a/tools/bootconfig/Makefile
> +++ b/tools/bootconfig/Makefile
[ ... ]
> @@ -15,10 +15,14 @@ override CFLAGS += -Wall -g -I$(CURDIR)/include
> ALL_TARGETS := bootconfig
> ALL_PROGRAMS := $(patsubst %,$(OUTPUT)%,$(ALL_TARGETS))
>
> -all: $(ALL_PROGRAMS) test
> +all: $(ALL_PROGRAMS)
>
> +# bootconfig is a build host tool: Kbuild's prepare hook runs it on the
> +# build machine to render the embedded cmdline, so always compile it with
> +# $(HOSTCC). Using $(CC) would cross-compile it under ARCH=... builds and
> +# fail to exec on the host ("Exec format error").
> $(OUTPUT)bootconfig: main.c include/linux/bootconfig.h $(LIBSRC)
> - $(CC) $(filter %.c,$^) $(CFLAGS) $(LDFLAGS) -o $@
> + $(HOSTCC) $(filter %.c,$^) $(CFLAGS) $(LDFLAGS) -o $@
[Severity: High]
Is it safe to pass $(CFLAGS) and $(LDFLAGS) to $(HOSTCC) here?
When cross-compiling, $(CFLAGS) and $(LDFLAGS) often contain target-specific
flags. Passing these target flags to the host compiler might cause it to fail,
or incorrectly generate binaries for the target architecture that fail to
execute on the build host.
Additionally, since bootconfig is an administrative utility meant to be
deployed on the target system, will permanently hardcoding $(HOSTCC) prevent
users from cross-compiling it for their target devices?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260605-bootconfig_using_tools-v2-0-d309f544b5f7@debian.org?part=3
next prev parent reply other threads:[~2026-06-05 12:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-05 12:03 [PATCH v2 0/6] bootconfig: embed kernel.* cmdline at build time Breno Leitao
2026-06-05 12:03 ` [PATCH v2 1/6] bootconfig: fix NULL-pointer arithmetic in xbc_snprint_cmdline() Breno Leitao
2026-06-05 12:03 ` [PATCH v2 2/6] bootconfig: render descendant keys when xbc_snprint_cmdline() root has a value Breno Leitao
2026-06-05 12:03 ` [PATCH v2 3/6] bootconfig: render embedded bootconfig as a kernel cmdline at build time Breno Leitao
2026-06-05 12:13 ` sashiko-bot [this message]
2026-06-08 2:29 ` Masami Hiramatsu
2026-06-05 12:03 ` [PATCH v2 4/6] bootconfig: clean build-time tools/bootconfig from make clean Breno Leitao
2026-06-05 12:03 ` [PATCH v2 5/6] bootconfig: add xbc_prepend_embedded_cmdline() helper Breno Leitao
2026-06-05 12:03 ` [PATCH v2 6/6] x86/setup: prepend embedded bootconfig cmdline before parse_early_param Breno Leitao
2026-06-08 10:19 ` Masami Hiramatsu
2026-06-08 14:41 ` Breno Leitao
2026-06-09 1:34 ` Masami Hiramatsu
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=20260605121354.A61741F00893@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