Re: [PATCH v3] x86, kconfig: Default to ARCH=x86 to avoid overriding CONFIG_64BIT

From: Arnaud Lacombe
Date: Sat Jul 30 2011 - 11:23:20 EST


Hi

On Sat, Jul 30, 2011 at 4:37 AM, David Woodhouse <dwmw2@xxxxxxxxxxxxx> wrote:
> On Fri, 2011-07-29 at 21:26 -0400, Arnaud Lacombe wrote:
>>
>> Should we not try to fix this rather than introduce a new interface ?
>
> This patch *does* fix it, without needing the new interface that I
> presented in a separate patch. The two patches I sent are not strictly
> dependent on one another.
>
>> From my point of view, we (ie. Kbuild) should be intelligent enough to
>> take the default from the .config, if one is present in the object
>> directory, rather than trying to impose it's own view on what the ARCH
>> should be.
>>
>> Is there case where we would have a .config, but would not use its
>> content ?
>
> Heh, I think you've missed some of the history here.
>
> I originally, a year or two ago, posted a patch which took precisely the
> approach I think you're advocating.
Just to make my point clearer, here is what I'd be advocating:

diff --git a/Makefile b/Makefile
index b927e75..a15b773 100644
--- a/Makefile
+++ b/Makefile
@@ -192,7 +192,11 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/
-e s/sun4u/sparc64/ \
# Default value for CROSS_COMPILE is not to prefix executables
# Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
export KBUILD_BUILDHOST := $(SUBARCH)
+ifeq ($(shell test -e .config && echo n),n)
ARCH ?= $(SUBARCH)
+else
+ARCH ?= $(shell sed '/^\# Linux\/\(.*\) .* Kernel
Configuration/!d; s//\1/' .config)
+endif
CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%)

this work but smells hackish.

- Arnaud

> It basically made the ARCH=x86
> behaviour apply in all cases. It was reverted because it made 'make
> randconfig' actually *random* — *even* for the setting of CONFIG_64BIT,
> *even* when ARCH=i386 or ARCH=x86_64.
>
> The fact that KCONFIG_ALLCONFIG allows you to override *all* config
> options and not just CONFIG_64BIT, and that using the legacy ARCH=
> settings wasn't really necessary, was evidently not sufficient. It
> apparently *had* to be possible to switch using the command line.
>
> So I did two things — I fixed this patch so that it doesn't break that
> legacy use case of 'make ARCH=i386' or 'make ARCH=x86_64' to force the
> value of CONFIG_64BIT on or off, and I also posted a separate patch
> which gives a more *sensible* way to force *any* config options on or
> off from the 'make' command line, since the world is apparently going to
> end if we can't do that.
>
> The two patches can be considered to be entirely independent.
>
> --
> dwmw2
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/