Skip to contentSkip to conversation

kbuild: Inform user to pass ARCH= for make mrproper

PATCH In review Geert Uytterhoeven 3 participants 4 messages Jul 9, 2019 – Jul 11, 2019 Kbuild

lore
Share & tools
lore
#0 lore raw

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.

Fixes a788b2ed81abeb94 ("kbuild: check arch/$(SRCARCH)/include/generated before out-of-tree build")
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index 3e4868a6498b2224..704e193c16472be1 100644
@@ -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
#1 lore raw
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")

---

Applied to linux-kbuild. Thanks.

Signature · 2 lines
Best Regards
Masahiro Yamada
#3 lore raw
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