diff options
author | David Woodhouse <dwmw2@infradead.org> | 2012-12-20 16:51:55 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2012-12-20 17:37:18 -0500 |
commit | ffee0de411fd4f74f3b788892eeb075abbf26c52 (patch) | |
tree | 1b1bd2751822cdabca7d44de635369c9091ae624 | |
parent | 29594404d7fe73cd80eaa4ee8c43dcc53970c60e (diff) |
x86: Default to ARCH=x86 to avoid overriding CONFIG_64BIT
It is easy to waste a bunch of time when one takes a 32-bit .config
from a test machine and try to build it on a faster 64-bit system, and
its existing setting of CONFIG_64BIT=n gets *changed* to match the
build host. Similarly, if one has an existing build tree it is easy
to trash an entire build tree that way.
This is because the default setting for $ARCH when discovered from
'uname' is one of the legacy pre-x86-merge values (i386 or x86_64),
which effectively force the setting of CONFIG_64BIT to match. We should
default to ARCH=x86 instead, finally completing the merge that we
started so long ago.
This patch preserves the behaviour of the legacy ARCH settings for commands
such as:
make ARCH=x86_64 randconfig
make ARCH=i386 randconfig
... since making the value of CONFIG_64BIT actually random in that situation
is not desirable.
In time, perhaps we can retire this legacy use of the old ARCH= values.
We already have a way to override values for *any* config option, using
$KCONFIG_ALLCONFIG, so it could be argued that we don't necessarily need
to keep ARCH={i386,x86_64} around as a special case just for overriding
CONFIG_64BIT.
We'd probably at least want to add a way to override config options from
the command line ('make CONFIG_FOO=y oldconfig') before we talk about doing
that though.
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Link: http://lkml.kernel.org/r/1356040315.3198.51.camel@shinybook.infradead.org
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | arch/x86/Kconfig | 2 | ||||
-rw-r--r-- | arch/x86/Makefile | 4 | ||||
-rw-r--r-- | arch/x86/configs/i386_defconfig | 1 |
4 files changed, 8 insertions, 2 deletions
@@ -165,7 +165,8 @@ export srctree objtree VPATH | |||
165 | # then ARCH is assigned, getting whatever value it gets normally, and | 165 | # then ARCH is assigned, getting whatever value it gets normally, and |
166 | # SUBARCH is subsequently ignored. | 166 | # SUBARCH is subsequently ignored. |
167 | 167 | ||
168 | SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ | 168 | SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \ |
169 | -e s/sun4u/sparc64/ \ | ||
169 | -e s/arm.*/arm/ -e s/sa110/arm/ \ | 170 | -e s/arm.*/arm/ -e s/sa110/arm/ \ |
170 | -e s/s390x/s390/ -e s/parisc64/parisc/ \ | 171 | -e s/s390x/s390/ -e s/parisc64/parisc/ \ |
171 | -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \ | 172 | -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \ |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 46c3bff3ced2..9084c7bdc650 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # Select 32 or 64 bit | 1 | # Select 32 or 64 bit |
2 | config 64BIT | 2 | config 64BIT |
3 | bool "64-bit kernel" if ARCH = "x86" | 3 | bool "64-bit kernel" if ARCH = "x86" |
4 | default ARCH = "x86_64" | 4 | default ARCH != "i386" |
5 | ---help--- | 5 | ---help--- |
6 | Say yes to build a 64-bit kernel - formerly known as x86_64 | 6 | Say yes to build a 64-bit kernel - formerly known as x86_64 |
7 | Say no to build a 32-bit kernel - formerly known as i386 | 7 | Say no to build a 32-bit kernel - formerly known as i386 |
diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 05afcca66de6..fa981ca1bfe5 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile | |||
@@ -2,7 +2,11 @@ | |||
2 | 2 | ||
3 | # select defconfig based on actual architecture | 3 | # select defconfig based on actual architecture |
4 | ifeq ($(ARCH),x86) | 4 | ifeq ($(ARCH),x86) |
5 | ifeq ($(shell uname -m),x86_64) | ||
6 | KBUILD_DEFCONFIG := x86_64_defconfig | ||
7 | else | ||
5 | KBUILD_DEFCONFIG := i386_defconfig | 8 | KBUILD_DEFCONFIG := i386_defconfig |
9 | endif | ||
6 | else | 10 | else |
7 | KBUILD_DEFCONFIG := $(ARCH)_defconfig | 11 | KBUILD_DEFCONFIG := $(ARCH)_defconfig |
8 | endif | 12 | endif |
diff --git a/arch/x86/configs/i386_defconfig b/arch/x86/configs/i386_defconfig index 5598547281a7..94447086e551 100644 --- a/arch/x86/configs/i386_defconfig +++ b/arch/x86/configs/i386_defconfig | |||
@@ -1,3 +1,4 @@ | |||
1 | # CONFIG_64BIT is not set | ||
1 | CONFIG_EXPERIMENTAL=y | 2 | CONFIG_EXPERIMENTAL=y |
2 | # CONFIG_LOCALVERSION_AUTO is not set | 3 | # CONFIG_LOCALVERSION_AUTO is not set |
3 | CONFIG_SYSVIPC=y | 4 | CONFIG_SYSVIPC=y |