LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Roman Zippel <zippel@linux-m68k.org>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] kconfig: use $K64BIT to set 64BIT with all*config targets
Date: Fri, 16 Nov 2007 02:28:09 +0100 (CET)	[thread overview]
Message-ID: <Pine.LNX.4.64.0711160205340.1817@scrub.home> (raw)
In-Reply-To: <20071115220640.GA25265@uranus.ravnborg.org>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1835 bytes --]

Hi,

On Thu, 15 Nov 2007, Sam Ravnborg wrote:

> You suggest just to check ARCH value and not apply your patch. This was
> not my initial understanding as was hopefully obvious from my reply.

This patch only adds some extra features.

> If user did NOT specify ARCH we should use the kernel configuration - which
> your solution fail to do.

To make this easy I attached the patch which reverts the problematic 
changes and then you only need this simple change to force the 64BIT value 
for ARCH={i386,x86_64}, otherwise it's set by the user:

bye, Roman

Signed-off-by: Roman Zippel <zippel@linux-m68k.org>

---
 Makefile         |    3 ++-
 arch/x86/Kconfig |    4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

Index: linux-2.6/Makefile
===================================================================
--- linux-2.6.orig/Makefile
+++ linux-2.6/Makefile
@@ -165,7 +165,8 @@ export srctree objtree VPATH TOPDIR
 # then ARCH is assigned, getting whatever value it gets normally, and 
 # SUBARCH is subsequently ignored.
 
-SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
+SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
+				  -e s/sun4u/sparc64/ \
 				  -e s/arm.*/arm/ -e s/sa110/arm/ \
 				  -e s/s390x/s390/ -e s/parisc64/parisc/ \
 				  -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
Index: linux-2.6/arch/x86/Kconfig
===================================================================
--- linux-2.6.orig/arch/x86/Kconfig
+++ linux-2.6/arch/x86/Kconfig
@@ -3,8 +3,8 @@ mainmenu "Linux Kernel Configuration for
 
 # Select 32 or 64 bit
 config 64BIT
-	bool "64-bit kernel"
-	default n
+	bool "64-bit kernel" if ARCH="x86"
+	default ARCH="x86_64"
 	help
 	  Say yes to build a 64-bit kernel - formerly known as x86_64
 	  Say no to build a 32-bit kernel - formerly known as i386

[-- Attachment #2: Type: TEXT/PLAIN, Size: 6852 bytes --]

Revert

9c900a9c9d9351e55ab6a84e12e3a52c474c7c8b
0f855aa64b3f63d35a891510cf7db932a435c116
2a113281f5cd2febbab21a93c8943f8d3eece4d3

and K64BIT parts of

daa93fab824f2b8c35bd11670c7fab2f32b2de5f

Signed-off-by: Roman Zippel <zippel@linux-m68k.org>

---
 Makefile                    |    4 -
 README                      |    2 
 scripts/kconfig/conf.c      |    1 
 scripts/kconfig/confdata.c  |  146 ++++++++++++++++----------------------------
 scripts/kconfig/lkc_proto.h |    1 
 5 files changed, 56 insertions(+), 98 deletions(-)

Index: linux-2.6/Makefile
===================================================================
--- linux-2.6.orig/Makefile
+++ linux-2.6/Makefile
@@ -200,11 +200,9 @@ SRCARCH 	:= $(ARCH)
 # Additional ARCH settings for x86
 ifeq ($(ARCH),i386)
         SRCARCH := x86
-        K64BIT  := n
 endif
 ifeq ($(ARCH),x86_64)
         SRCARCH := x86
-        K64BIT  := y
 endif
 
 KCONFIG_CONFIG	?= .config
@@ -341,7 +339,7 @@ KERNELRELEASE = $(shell cat include/conf
 KERNELVERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
 export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION
-export ARCH SRCARCH K64BIT CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC
+export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC
 export CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE
 export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
 
Index: linux-2.6/README
===================================================================
--- linux-2.6.orig/README
+++ linux-2.6/README
@@ -194,8 +194,6 @@ CONFIGURING the kernel:
    "make *config" checks for a file named "all{yes/mod/no/random}.config"
    for symbol values that are to be forced.  If this file is not found,
    it checks for a file named "all.config" to contain forced values.
-   Finally it checks the environment variable K64BIT and if found, sets
-   the config symbol "64BIT" to the value of the K64BIT variable.
    
 	NOTES on "make config":
 	- having unnecessary drivers will make the kernel bigger, and can
Index: linux-2.6/scripts/kconfig/conf.c
===================================================================
--- linux-2.6.orig/scripts/kconfig/conf.c
+++ linux-2.6/scripts/kconfig/conf.c
@@ -591,7 +591,6 @@ int main(int ac, char **av)
 			conf_read_simple(name, S_DEF_USER);
 		else if (!stat("all.config", &tmpstat))
 			conf_read_simple("all.config", S_DEF_USER);
-		conf_set_env_sym("K64BIT", "64BIT", S_DEF_USER);
 		break;
 	default:
 		break;
Index: linux-2.6/scripts/kconfig/confdata.c
===================================================================
--- linux-2.6.orig/scripts/kconfig/confdata.c
+++ linux-2.6/scripts/kconfig/confdata.c
@@ -83,95 +83,6 @@ char *conf_get_default_confname(void)
 	return name;
 }
 
-static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
-{
-	char *p2;
-
-	switch (sym->type) {
-	case S_TRISTATE:
-		if (p[0] == 'm') {
-			sym->def[def].tri = mod;
-			sym->flags |= def_flags;
-			break;
-		}
-	case S_BOOLEAN:
-		if (p[0] == 'y') {
-			sym->def[def].tri = yes;
-			sym->flags |= def_flags;
-			break;
-		}
-		if (p[0] == 'n') {
-			sym->def[def].tri = no;
-			sym->flags |= def_flags;
-			break;
-		}
-		conf_warning("symbol value '%s' invalid for %s", p, sym->name);
-		break;
-	case S_OTHER:
-		if (*p != '"') {
-			for (p2 = p; *p2 && !isspace(*p2); p2++)
-				;
-			sym->type = S_STRING;
-			goto done;
-		}
-	case S_STRING:
-		if (*p++ != '"')
-			break;
-		for (p2 = p; (p2 = strpbrk(p2, "\"\\")); p2++) {
-			if (*p2 == '"') {
-				*p2 = 0;
-				break;
-			}
-			memmove(p2, p2 + 1, strlen(p2));
-		}
-		if (!p2) {
-			conf_warning("invalid string found");
-			return 1;
-		}
-	case S_INT:
-	case S_HEX:
-	done:
-		if (sym_string_valid(sym, p)) {
-			sym->def[def].val = strdup(p);
-			sym->flags |= def_flags;
-		} else {
-			conf_warning("symbol value '%s' invalid for %s", p, sym->name);
-			return 1;
-		}
-		break;
-	default:
-		;
-	}
-	return 0;
-}
-
-/* Read an environment variable and assign the value to the symbol */
-int conf_set_env_sym(const char *env, const char *symname, int def)
-{
-	struct symbol *sym;
-	char *p;
-	int def_flags;
-
-	p = getenv(env);
-	if (p) {
-		char warning[200];
-		sprintf(warning, "Environment variable (%s = \"%s\")", env, p);
-		conf_filename = warning;
-		def_flags = SYMBOL_DEF << def;
-		if (def == S_DEF_USER) {
-			sym = sym_find(symname);
-			if (!sym)
-				return 1;
-		} else {
-			sym = sym_lookup(symname, 0);
-			if (sym->type == S_UNKNOWN)
-				sym->type = S_OTHER;
-		}
-		conf_set_sym_val(sym, def, def_flags, p);
-	}
-	return 0;
-}
-
 int conf_read_simple(const char *name, int def)
 {
 	FILE *in = NULL;
@@ -302,8 +213,61 @@ load:
 				conf_warning("trying to reassign symbol %s", sym->name);
 				break;
 			}
-			if (conf_set_sym_val(sym, def, def_flags, p))
-				continue;
+			switch (sym->type) {
+			case S_TRISTATE:
+				if (p[0] == 'm') {
+					sym->def[def].tri = mod;
+					sym->flags |= def_flags;
+					break;
+				}
+			case S_BOOLEAN:
+				if (p[0] == 'y') {
+					sym->def[def].tri = yes;
+					sym->flags |= def_flags;
+					break;
+				}
+				if (p[0] == 'n') {
+					sym->def[def].tri = no;
+					sym->flags |= def_flags;
+					break;
+				}
+				conf_warning("symbol value '%s' invalid for %s", p, sym->name);
+				break;
+			case S_OTHER:
+				if (*p != '"') {
+					for (p2 = p; *p2 && !isspace(*p2); p2++)
+						;
+					sym->type = S_STRING;
+					goto done;
+				}
+			case S_STRING:
+				if (*p++ != '"')
+					break;
+				for (p2 = p; (p2 = strpbrk(p2, "\"\\")); p2++) {
+					if (*p2 == '"') {
+						*p2 = 0;
+						break;
+					}
+					memmove(p2, p2 + 1, strlen(p2));
+				}
+				if (!p2) {
+					conf_warning("invalid string found");
+					continue;
+				}
+			case S_INT:
+			case S_HEX:
+			done:
+				if (sym_string_valid(sym, p)) {
+					sym->def[def].val = strdup(p);
+					sym->flags |= def_flags;
+				} else {
+					conf_warning("symbol value '%s' invalid for %s", p, sym->name);
+					continue;
+				}
+				break;
+			default:
+				;
+			}
 			break;
 		case '\r':
 		case '\n':
Index: linux-2.6/scripts/kconfig/lkc_proto.h
===================================================================
--- linux-2.6.orig/scripts/kconfig/lkc_proto.h
+++ linux-2.6/scripts/kconfig/lkc_proto.h
@@ -1,7 +1,6 @@
 
 /* confdata.c */
 P(conf_parse,void,(const char *name));
-P(conf_set_env_sym,int,(const char *envname, const char *symname, int def));
 P(conf_read,int,(const char *name));
 P(conf_read_simple,int,(const char *name, int));
 P(conf_write,int,(const char *name));

  reply	other threads:[~2007-11-16  1:28 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-10 20:40 [PATCH 0/5] introduce K64BIT=y and backward compatibility ARCH={i386,x86_64} for x86 Sam Ravnborg
2007-11-10 20:43 ` [PATCH] kconfig: factor out code in confdata.c Sam Ravnborg
2007-11-10 20:43   ` [PATCH] kconfig: use $K64BIT to set 64BIT with all*config targets Sam Ravnborg
2007-11-10 20:43     ` [PATCH] x86: Use CONFIG_64BIT to select between 32 and 64 bit in Kconfig Sam Ravnborg
2007-11-10 20:43       ` [PATCH] kconfig: document make K64BIT=y in README Sam Ravnborg
2007-11-10 20:43         ` [PATCH] x86: introduce ARCH=i386,ARCH=x86_64 to select 32/64 bit Sam Ravnborg
2007-11-10 22:23         ` [PATCH] kconfig: document make K64BIT=y in README Randy Dunlap
2007-11-10 22:18       ` [PATCH] x86: Use CONFIG_64BIT to select between 32 and 64 bit in Kconfig Randy Dunlap
2007-11-10 20:55     ` [PATCH] kconfig: use $K64BIT to set 64BIT with all*config targets Guillaume Chazarain
2007-11-11  5:14       ` Adrian Bunk
2007-11-11 12:43         ` Guillaume Chazarain
2007-11-11 13:07           ` Adrian Bunk
2007-11-11 14:59             ` Guillaume Chazarain
2007-11-11 15:30               ` Sam Ravnborg
2007-11-11 15:55                 ` Guillaume Chazarain
2007-11-10 22:16     ` Randy Dunlap
2007-11-10 22:31       ` Sam Ravnborg
2007-11-14 20:57     ` Roman Zippel
2007-11-14 22:08       ` Sam Ravnborg
2007-11-15 15:43         ` Roman Zippel
2007-11-15 19:25           ` Sam Ravnborg
2007-11-15 19:43             ` Roman Zippel
2007-11-15 20:45               ` Sam Ravnborg
2007-11-15 21:24                 ` Roman Zippel
2007-11-15 22:06                   ` Sam Ravnborg
2007-11-16  1:28                     ` Roman Zippel [this message]
2007-11-16  3:44                       ` Randy Dunlap
2007-11-16 13:02                         ` Roman Zippel
2007-11-16  5:41                       ` Sam Ravnborg
2007-11-16 12:54                         ` Roman Zippel
2008-01-06 13:26           ` kconfig: support option env="" [Was: kconfig: use $K64BIT to set 64BIT with all*config targets] Sam Ravnborg
2008-01-14  3:49             ` Roman Zippel
2008-01-14  5:58               ` Sam Ravnborg
2008-01-14  3:50             ` [PATCH 1/3] explicitly introduce expression list Roman Zippel
2008-01-14  3:50             ` [PATCH 2/3] environment symbol support Roman Zippel
2008-01-14  3:51             ` [PATCH 3/3] use environment option Roman Zippel
2007-11-10 22:33 ` [PATCH 0/5] introduce K64BIT=y and backward compatibility ARCH={i386,x86_64} for x86 Randy Dunlap
2007-11-10 22:50   ` Sam Ravnborg
2007-11-11  5:09 ` Adrian Bunk
2007-11-11 11:54   ` Sam Ravnborg
2007-11-12  2:47 ` Roman Zippel
2007-11-12  5:23   ` Sam Ravnborg
2007-11-12 20:54 [PATCH revised] enable make ARCH=x86 (and stay backward compatible) Sam Ravnborg
2007-11-12 21:00 ` [PATCH] x86: unification of cfufreq/Kconfig Sam Ravnborg
2007-11-12 21:00   ` [PATCH] x86: start unification of arch/x86/Kconfig.* Sam Ravnborg
2007-11-12 21:00     ` [PATCH] x86: arch/x86/Kconfig.cpu unification Sam Ravnborg
2007-11-12 21:00       ` [PATCH] x86: add X86_32 dependency to i386 specific symbols in Kconfig.i386 Sam Ravnborg
2007-11-12 21:00         ` [PATCH] x86: add X86_64 dependency to x86_64 specific symbols in Kconfig.x86_64 Sam Ravnborg
2007-11-12 21:00           ` [PATCH] x86: copy x86_64 specific Kconfig symbols to Kconfig.i386 Sam Ravnborg
2007-11-12 21:00             ` [PATCH] x86: move all simple arch settings to Kconfig Sam Ravnborg
2007-11-12 21:00               ` [PATCH] x86: move the rest of the menu's " Sam Ravnborg
2007-11-12 21:00                 ` [PATCH] kconfig: factor out code in confdata.c Sam Ravnborg
2007-11-12 21:00                   ` [PATCH] kconfig: add helper to set config symbol from environment variable Sam Ravnborg
2007-11-12 21:00                     ` [PATCH] kconfig: use $K64BIT to set 64BIT with all*config targets Sam Ravnborg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0711160205340.1817@scrub.home \
    --to=zippel@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).