kbuild: Inform user to pass ARCH= for make mrproper
PATCH 1/1 kbuild: Inform user to pass ARCH= for make mrproper
When cross-compiling an out-of-tree build with an unclean source tree directory, the build fails with:
/path/to/kernel/source/tree is not clean, please run 'make mrproper' in the '/path/to/kernel/source/tree' directory.
However, doing so does not fix the problem, as "make mrproper" now requires passing the target architecture to the make command, else it won't remove $(srctree)/arch/$(SRCARCH)/include/generated. "git ls-files -o" doesn't give a clue, as it doesn't list (empty) directories, only files.
Improve usability by including the ARCH= option in the error output.
--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
@@ -1101,7 +1101,7 @@ ifneq ($(srctree),.) $(Q)if [ -f $(srctree)/.config -o \ -d $(srctree)/include/config -o \ -d $(srctree)/arch/$(SRCARCH)/include/generated ]; then \ - echo >&2 " $(srctree) is not clean, please run 'make mrproper'"; \ + echo >&2 " $(srctree) is not clean, please run 'make ARCH=$(ARCH) mrproper'"; \ echo >&2 " in the '$(srctree)' directory.";\ /bin/false; \ fi;
Signature · 1 line
2.17.1
Quoted 13 lines · Geert Uytterhoeven
When cross-compiling an out-of-tree build with an unclean source tree directory, the build fails with:
/path/to/kernel/source/tree is not clean, please run 'make mrproper' in the '/path/to/kernel/source/tree' directory.
However, doing so does not fix the problem, as "make mrproper" now requires passing the target architecture to the make command, else it won't remove $(srctree)/arch/$(SRCARCH)/include/generated. "git ls-files -o" doesn't give a clue, as it doesn't list (empty) directories, only files.
Quoted 5 lines
Improve usability by including the ARCH= option in the error output.
Fixes a788b2ed81abeb94 ("kbuild: check arch/$(SRCARCH)/include/generated before out-of-tree build")Signed-off-by Geert Uytterhoeven <[email protected]>---
Applied to linux-kbuild. Thanks.
Signature · 2 lines
Best Regards Masahiro Yamada
Is there any chance we could save ARCH in .config? That would make cross compile builds so much easier.. Same for CROSS_COMPILE.
Quoted 3 lines · Christoph Hellwig
Is there any chance we could save ARCH in .config? That would make cross compile builds so much easier.. Same for
CROSS_COMPILE.
Then, I have no idea how "make clean", "make help", etc. should work.
If a user has configured the kernel, do they work for CONFIG_ARCH stored in the .config file or still for the host-arch?
If not yet, do they fall-back to host-arch?
Signature · 2 lines
Best Regards Masahiro Yamada