Re: [PATCH v2] kbuild: install-extmod-build: Properly fix CC expansion when ccache is used
From: Nicolas Schier
Date: Tue Nov 11 2025 - 09:48:47 EST
On Tue, Nov 11, 2025 at 04:28:06PM +0200, Abel Vesa wrote:
> On 25-11-11 14:03:10, Nicolas Schier wrote:
> > On Tue, Nov 11, 2025 at 08:43:51AM +0200, Abel Vesa wrote:
> > > Currently, when cross-compiling and ccache is used, the expanding of CC
> > > turns out to be without any quotes, leading to the following error:
> > >
> > > make[4]: *** No rule to make target 'aarch64-linux-gnu-gcc'. Stop.
> > > make[3]: *** [Makefile:2164: run-command] Error 2
> > >
> > > And it makes sense, because after expansion it ends up like this:
> > >
> > > make run-command KBUILD_RUN_COMMAND=+$(MAKE) \
> > > HOSTCC=ccache aarch64-linux-gnu-gcc VPATH= srcroot=. $(build)= ...
> > >
> > > So add another set of double quotes to surround whatever CC expands to
> > > to make sure the aarch64-linux-gnu-gcc isn't expanded to something that
> > > looks like an entirely separate target.
> > >
> > > Fixes: 140332b6ed72 ("kbuild: fix linux-headers package build when $(CC) cannot link userspace")
> > > Signed-off-by: Abel Vesa <abel.vesa@xxxxxxxxxx>
> > > ---
> > > Changes in v2:
> > > - Moved the new double quotes inside of single ones, to be able
> > > to drop the escape, like Nathan suggested.
> > > - Re-worded the commit message according to the above change.
> > > - Link to v1: https://lore.kernel.org/r/20251110-kbuild-install-extmod-build-fix-cc-expand-third-try-v1-1-5c0ddb1c67a8@xxxxxxxxxx
> > > ---
> > > scripts/package/install-extmod-build | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> >
> > Just as a note: the fix is only required for build rpm packages.
>
> .. or pacman packages. Easy way to reproduce:
>
> make ARCH=arm64 CROSS_COMPILE="aarch64-linux-gnu-" CC="ccache aarch64-linux-gnu-gcc" pacman-pkg
ah sure. Thanks!
--
Nicolas