Skip to content

Commit 140332b

Browse files
committed
kbuild: fix linux-headers package build when $(CC) cannot link userspace
Since commit 5f73e7d ("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 f354fc8 ("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: 5f73e7d ("kbuild: refactor cross-compiling linux-headers package") Reported-by: Jeff Johnson <[email protected]> Closes: https://lore.kernel.org/linux-kbuild/CAK7LNARb3xO3ptBWOMpwKcyf3=zkfhMey5H2KnB1dOmUwM79dA@mail.gmail.com/T/#t Signed-off-by: Masahiro Yamada <[email protected]> Tested-by: Jeff Johnson <[email protected]>
1 parent d1d0963 commit 140332b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/package/install-extmod-build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ if [ "${CC}" != "${HOSTCC}" ]; then
6262
#
6363
# Clear VPATH and srcroot because the source files reside in the output
6464
# directory.
65-
# shellcheck disable=SC2016 # $(MAKE), $(CC), and $(build) will be expanded by Make
66-
"${MAKE}" run-command KBUILD_RUN_COMMAND='+$(MAKE) HOSTCC="$(CC)" VPATH= srcroot=. $(build)='"${destdir}"/scripts
65+
# shellcheck disable=SC2016 # $(MAKE) and $(build) will be expanded by Make
66+
"${MAKE}" run-command KBUILD_RUN_COMMAND='+$(MAKE) HOSTCC='"${CC}"' VPATH= srcroot=. $(build)='"${destdir}"/scripts
6767

6868
rm -f "${destdir}/scripts/Kbuild"
6969
fi

0 commit comments

Comments
 (0)