* [PATCH v2] kbuild: fix linux-headers package build when $(CC) cannot link userspace
@ 2025-02-13 6:26 Masahiro Yamada
2025-02-13 7:30 ` Jeff Johnson
0 siblings, 1 reply; 2+ messages in thread
From: Masahiro Yamada @ 2025-02-13 6:26 UTC (permalink / raw)
To: linux-kbuild
Cc: linux-kernel, Masahiro Yamada, Jeff Johnson, Nathan Chancellor,
Nicolas Schier
Since commit 5f73e7d0386d ("kbuild: refactor cross-compiling
linux-headers package"), the linux-headers Debian package fails to
build when $(CC) cannot build userspace applications, for example,
when using toolchains installed by the 0day bot.
The host programs in the linux-headers package should be rebuilt using
the disto's cross-compiler, ${DEB_HOST_GNU_TYPE}-gcc instead of $(CC).
Hence, the variable 'CC' must be expanded in this shell script instead
of in the top-level Makefile.
Commit f354fc88a72a ("kbuild: install-extmod-build: add missing
quotation marks for CC variable") was not a correct fix because
CC="ccache gcc" should be unrelated when rebuilding userspace tools.
Fixes: 5f73e7d0386d ("kbuild: refactor cross-compiling linux-headers package")
Reported-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Closes: https://lore.kernel.org/linux-kbuild/CAK7LNARb3xO3ptBWOMpwKcyf3=zkfhMey5H2KnB1dOmUwM79dA@mail.gmail.com/T/#t
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
Changes in v2:
- Fix the comment line because 'CC' needs expanding in this script
scripts/package/install-extmod-build | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/package/install-extmod-build b/scripts/package/install-extmod-build
index b724626ea0ca..2966473b4660 100755
--- a/scripts/package/install-extmod-build
+++ b/scripts/package/install-extmod-build
@@ -62,8 +62,8 @@ if [ "${CC}" != "${HOSTCC}" ]; then
#
# Clear VPATH and srcroot because the source files reside in the output
# directory.
- # shellcheck disable=SC2016 # $(MAKE), $(CC), and $(build) will be expanded by Make
- "${MAKE}" run-command KBUILD_RUN_COMMAND='+$(MAKE) HOSTCC="$(CC)" VPATH= srcroot=. $(build)='"${destdir}"/scripts
+ # shellcheck disable=SC2016 # $(MAKE) and $(build) will be expanded by Make
+ "${MAKE}" run-command KBUILD_RUN_COMMAND='+$(MAKE) HOSTCC='"${CC}"' VPATH= srcroot=. $(build)='"${destdir}"/scripts
rm -f "${destdir}/scripts/Kbuild"
fi
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] kbuild: fix linux-headers package build when $(CC) cannot link userspace
2025-02-13 6:26 [PATCH v2] kbuild: fix linux-headers package build when $(CC) cannot link userspace Masahiro Yamada
@ 2025-02-13 7:30 ` Jeff Johnson
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Johnson @ 2025-02-13 7:30 UTC (permalink / raw)
To: Masahiro Yamada, linux-kbuild
Cc: linux-kernel, Nathan Chancellor, Nicolas Schier
On 2/12/2025 10:26 PM, Masahiro Yamada wrote:
> Since commit 5f73e7d0386d ("kbuild: refactor cross-compiling
> linux-headers package"), the linux-headers Debian package fails to
> build when $(CC) cannot build userspace applications, for example,
> when using toolchains installed by the 0day bot.
>
> The host programs in the linux-headers package should be rebuilt using
> the disto's cross-compiler, ${DEB_HOST_GNU_TYPE}-gcc instead of $(CC).
> Hence, the variable 'CC' must be expanded in this shell script instead
> of in the top-level Makefile.
>
> Commit f354fc88a72a ("kbuild: install-extmod-build: add missing
> quotation marks for CC variable") was not a correct fix because
> CC="ccache gcc" should be unrelated when rebuilding userspace tools.
>
> Fixes: 5f73e7d0386d ("kbuild: refactor cross-compiling linux-headers package")
> Reported-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
> Closes: https://lore.kernel.org/linux-kbuild/CAK7LNARb3xO3ptBWOMpwKcyf3=zkfhMey5H2KnB1dOmUwM79dA@mail.gmail.com/T/#t
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Thanks for the quick fix!
Tested-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-02-13 7:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-13 6:26 [PATCH v2] kbuild: fix linux-headers package build when $(CC) cannot link userspace Masahiro Yamada
2025-02-13 7:30 ` Jeff Johnson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.