From 2331d1a6cd3d6e580bc88b9a160066d9e1177fe1 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Sun, 11 Oct 2009 23:22:58 +0200 Subject: kbuild: revert "save ARCH & CROSS_COMPILE ..." Revert commit 575543347b5baed0ca927cb90ba8807396fe9cc9 It caused following issues: - On architectures where ARCH= setting is used to select between 32 and 64 bit this was no longer possible without "make mrproper" - If ARCH was changed then kbuild refused to run "make mrproper" because ARCH had changed - When CROSS_COMPILE was changed people were asked to run "make mrproper" but kbuild refused to run "make mrproper" because CROSS_COMPILE changed. - Spaces in CROSS_COMPILE was not 'supported' - If an non-existing ARCH= was used kbuild could get stuck Lessons learned: . Despite being simple and straghtforward people uses very different approaches when building the kernel. . CROSS_COMPILE is sometimes used for ccache despite cache being only a CC frontend so one would have expected CC to be used for this purpose. . And obviously this was not tested widely enough. Signed-off-by: Sam Ravnborg Cc: Pavel Machek Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Andrew Morton --- Makefile | 46 ++-------------------------------------------- 1 file changed, 2 insertions(+), 44 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index e50569ab5fe8..8e5aaeeb86b7 100644 --- a/Makefile +++ b/Makefile @@ -179,46 +179,9 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ # Alternatively CROSS_COMPILE can be set in the environment. # Default value for CROSS_COMPILE is not to prefix executables # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile -# -# To force ARCH and CROSS_COMPILE settings include kernel.* files -# in the kernel tree - do not patch this file. export KBUILD_BUILDHOST := $(SUBARCH) - -# Kbuild save the ARCH and CROSS_COMPILE setting in kernel.* files. -# Restore these settings and check that user did not specify -# conflicting values. - -saved_arch := $(shell cat include/generated/kernel.arch 2> /dev/null) -saved_cross := $(shell cat include/generated/kernel.cross 2> /dev/null) - -ifneq ($(CROSS_COMPILE),) - ifneq ($(saved_cross),) - ifneq ($(CROSS_COMPILE),$(saved_cross)) - $(error CROSS_COMPILE changed from \ - "$(saved_cross)" to \ - to "$(CROSS_COMPILE)". \ - Use "make mrproper" to fix it up) - endif - endif -else - CROSS_COMPILE := $(saved_cross) -endif - -ifneq ($(ARCH),) - ifneq ($(saved_arch),) - ifneq ($(saved_arch),$(ARCH)) - $(error ARCH changed from \ - "$(saved_arch)" to "$(ARCH)". \ - Use "make mrproper" to fix it up) - endif - endif -else - ifneq ($(saved_arch),) - ARCH := $(saved_arch) - else - ARCH := $(SUBARCH) - endif -endif +ARCH ?= $(SUBARCH) +CROSS_COMPILE ?= # Architecture as present in compile.h UTS_MACHINE := $(ARCH) @@ -483,11 +446,6 @@ ifeq ($(config-targets),1) include $(srctree)/arch/$(SRCARCH)/Makefile export KBUILD_DEFCONFIG KBUILD_KCONFIG -# save ARCH & CROSS_COMPILE settings -$(shell mkdir -p include/generated && \ - echo $(ARCH) > include/generated/kernel.arch && \ - echo $(CROSS_COMPILE) > include/generated/kernel.cross) - config: scripts_basic outputmakefile FORCE $(Q)mkdir -p include/linux include/config $(Q)$(MAKE) $(build)=scripts/kconfig $@ -- cgit v1.2.2