2007-05-02 20:16:51

by Sam Ravnborg

[permalink] [raw]
Subject: [GIT PATCHES] kbuild, kconfig + Kconfig updates

Hi Linus.

Please pull latest kbuild/kconfig and Kconfig updates.
Most of these have been present in -mm although a bunch
of trivial updates has been applied the last week too.


Main changes
o Added cleanfile and cleanpatch scripts
Useful to tidy up stuff before submission.
The discussed checkpatch script may be a good third candidate
o section mismatch does now include vmlinux so expect a few new warnings
o Ignore section mismatch warnings in several cases to bring down false positives significantly
o complain about missing system calls
The way to find missing system calls was discussed but in general the current version
was apprecated and triggered davem to add a few to sparc64 for example
o It is now possible to override build version and build timestamp using
KBUILD_BUILD_VERSION and KBUILD_BUILD_TIMESTAMP
o One patch does some trivial fixes in several Kconfig files which
caused some 'nosie' in the diffstat.
o Another patch deals with module alias which explain the changes in input.h

Please pull from
git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild.git

shortlog + diffstat below.

Sam


Alex Landau (1):
kbuild: handle compressed cpio initramfs-es

Alexander E. Patrakov (2):
usr/Kconfig: fix typo
kconfig: fix path to modules.txt in Kconfig help

Andreas Dilger (1):
kconfig.debug: clarify CONFIG_DEBUG_INFO help text

Andy Green (1):
kbuild: scripts/basic/fixdep segfault on pathological string-o-death

Anton Blanchard (1):
kbuild: small documentation fix in Documentation/kbuild/modules.txt

Don Mullis (1):
kbuild: move tags from ARCH and include/ ahead of drivers

H. Peter Anvin (2):
cleanfile: a script to clean up stealth whitespace
cleanpatch: a script to clean up stealth whitespace added by a patch

Marco Costalba (1):
kconfig/xconfig: sync main view with search dialog current menu

Matthew Wilcox (1):
kbuild: distinguish between errors and warnings in modpost

Michael Ellerman (1):
kbuild: propagate errors from find in scripts/gen_initramfs_list.sh

Mike Frysinger (1):
menuconfig: dont use obsolete index() function in lxdialog

Randy Dunlap (2):
kbuild: be more explicit on missing .config file
kernel-doc: alphabetically-sorted entries in index.html of 'htmldocs'

Robert P. J. Day (2):
kbuild: clarify the creation of the LOCALVERSION_AUTO string.
kconfig: correct minor typo in Kconfig warning message.

Sam Ravnborg (16):
kbuild: fix section mismatch check for vmlinux
kbuild: whitelist section mismatch in init/main.c
kbuild: fix warnings from .pci_fixup section
kbuild: fix segmentation fault in modpost
kbuild: whitelist logo references from .text to .init.data
kbuild: remove dependency on input.h from file2alias
menuconfig: remember alternate config filename
kbuild: do not emit src version warning for non-modules
kbuild: complain about missing system calls
kbuild: override build timestamp & version
kconfig/menuconfig: do not hardcode '.config'
kbuild: remove kconfig binaries during make mrproper
kbuild: fix make mrproper for Documentation/DocBook/man
kbuild: remove stale comment in modpost.c
kbuild: ignore section mismatch warning for references from .paravirtprobe to .init.text
kconfig: refer to qt3 if we cannot find qt libraries

Uwe Zeisberger (1):
kbuild: add a missing slash in the comments

Uwe kleine-K?nig (1):
kbuild/mkuboot.sh: allow spaces in CROSS_COMPILE

Documentation/DocBook/Makefile | 9 +-
Documentation/DocBook/man/Makefile | 3 -
Documentation/kbuild/modules.txt | 2 +-
Kbuild | 11 ++
Makefile | 15 ++-
drivers/mtd/devices/Kconfig | 4 +-
drivers/net/Kconfig | 6 +-
drivers/net/wireless/Kconfig | 12 +-
drivers/scsi/Kconfig | 4 +-
drivers/video/Kconfig | 8 +-
include/linux/input.h | 4 +
include/linux/mod_devicetable.h | 1 +
init/Kconfig | 16 ++-
init/main.c | 6 +-
lib/Kconfig.debug | 3 +
net/ipv6/netfilter/Kconfig | 2 +-
net/netfilter/Kconfig | 24 ++--
net/tipc/Kconfig | 2 +-
scripts/Makefile.modpost | 8 +-
scripts/basic/fixdep.c | 2 +
scripts/checksyscalls.sh | 118 ++++++++++++++++++++
scripts/cleanfile | 126 ++++++++++++++++++++++
scripts/cleanpatch | 206 ++++++++++++++++++++++++++++++++++++
scripts/gen_initramfs_list.sh | 12 ++-
scripts/kconfig/Makefile | 5 +-
scripts/kconfig/conf.c | 1 +
scripts/kconfig/lkc.h | 1 +
scripts/kconfig/lxdialog/dialog.h | 1 +
scripts/kconfig/lxdialog/util.c | 9 ++-
scripts/kconfig/mconf.c | 43 ++++++--
scripts/kconfig/menu.c | 2 +-
scripts/kconfig/qconf.cc | 5 +-
scripts/kconfig/qconf.h | 2 +-
scripts/mkcompile_h | 27 ++++--
scripts/mkuboot.sh | 2 +-
scripts/mod/file2alias.c | 21 ++--
scripts/mod/modpost.c | 141 +++++++++++++++++++------
scripts/mod/modpost.h | 1 +
scripts/mod/sumversion.c | 5 +-
usr/Kconfig | 2 +-
40 files changed, 735 insertions(+), 137 deletions(-)


2007-05-06 07:35:24

by Sam Ravnborg

[permalink] [raw]
Subject: [GIT PATCHES #2] kbuild, kconfig + Kconfig updates

Hi Linus.

On top of the below additional three patches has been pushed out:

kconfig: fix mconf segmentation fault
kbuild: enable use of code from a different dir
kconfig: error out if recursive dependencies are found

Please pull from:
git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild.git


Diffstat for the NEW patches (see diffstat for the other 35 patches at end of mail)

scripts/Makefile.build | 19 +++++++++----------
scripts/Makefile.host | 14 +++++++-------
scripts/kconfig/lex.zconf.c_shipped | 2 +-
scripts/kconfig/symbol.c | 13 +++++--------
scripts/kconfig/zconf.l | 2 +-
scripts/kconfig/zconf.tab.c_shipped | 6 ++++--
scripts/kconfig/zconf.y | 6 ++++--
7 files changed, 31 insertions(+), 31 deletions(-)

Patches will be sent to lkml only.

Sam

On Wed, May 02, 2007 at 10:17:41PM +0200, Sam Ravnborg wrote:
> Hi Linus.
>
> Please pull latest kbuild/kconfig and Kconfig updates.
> Most of these have been present in -mm although a bunch
> of trivial updates has been applied the last week too.
>
>
> Main changes
> o Added cleanfile and cleanpatch scripts
> Useful to tidy up stuff before submission.
> The discussed checkpatch script may be a good third candidate
> o section mismatch does now include vmlinux so expect a few new warnings
> o Ignore section mismatch warnings in several cases to bring down false positives significantly
> o complain about missing system calls
> The way to find missing system calls was discussed but in general the current version
> was apprecated and triggered davem to add a few to sparc64 for example
> o It is now possible to override build version and build timestamp using
> KBUILD_BUILD_VERSION and KBUILD_BUILD_TIMESTAMP
> o One patch does some trivial fixes in several Kconfig files which
> caused some 'nosie' in the diffstat.
> o Another patch deals with module alias which explain the changes in input.h
>
> Please pull from
> git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild.git
>
> shortlog + diffstat below.
>
> Sam
>
>
> Alex Landau (1):
> kbuild: handle compressed cpio initramfs-es
>
> Alexander E. Patrakov (2):
> usr/Kconfig: fix typo
> kconfig: fix path to modules.txt in Kconfig help
>
> Andreas Dilger (1):
> kconfig.debug: clarify CONFIG_DEBUG_INFO help text
>
> Andy Green (1):
> kbuild: scripts/basic/fixdep segfault on pathological string-o-death
>
> Anton Blanchard (1):
> kbuild: small documentation fix in Documentation/kbuild/modules.txt
>
> Don Mullis (1):
> kbuild: move tags from ARCH and include/ ahead of drivers
>
> H. Peter Anvin (2):
> cleanfile: a script to clean up stealth whitespace
> cleanpatch: a script to clean up stealth whitespace added by a patch
>
> Marco Costalba (1):
> kconfig/xconfig: sync main view with search dialog current menu
>
> Matthew Wilcox (1):
> kbuild: distinguish between errors and warnings in modpost
>
> Michael Ellerman (1):
> kbuild: propagate errors from find in scripts/gen_initramfs_list.sh
>
> Mike Frysinger (1):
> menuconfig: dont use obsolete index() function in lxdialog
>
> Randy Dunlap (2):
> kbuild: be more explicit on missing .config file
> kernel-doc: alphabetically-sorted entries in index.html of 'htmldocs'
>
> Robert P. J. Day (2):
> kbuild: clarify the creation of the LOCALVERSION_AUTO string.
> kconfig: correct minor typo in Kconfig warning message.
>
> Sam Ravnborg (16):
> kbuild: fix section mismatch check for vmlinux
> kbuild: whitelist section mismatch in init/main.c
> kbuild: fix warnings from .pci_fixup section
> kbuild: fix segmentation fault in modpost
> kbuild: whitelist logo references from .text to .init.data
> kbuild: remove dependency on input.h from file2alias
> menuconfig: remember alternate config filename
> kbuild: do not emit src version warning for non-modules
> kbuild: complain about missing system calls
> kbuild: override build timestamp & version
> kconfig/menuconfig: do not hardcode '.config'
> kbuild: remove kconfig binaries during make mrproper
> kbuild: fix make mrproper for Documentation/DocBook/man
> kbuild: remove stale comment in modpost.c
> kbuild: ignore section mismatch warning for references from .paravirtprobe to .init.text
> kconfig: refer to qt3 if we cannot find qt libraries
>
> Uwe Zeisberger (1):
> kbuild: add a missing slash in the comments
>
> Uwe kleine-K?nig (1):
> kbuild/mkuboot.sh: allow spaces in CROSS_COMPILE
>
> Documentation/DocBook/Makefile | 9 +-
> Documentation/DocBook/man/Makefile | 3 -
> Documentation/kbuild/modules.txt | 2 +-
> Kbuild | 11 ++
> Makefile | 15 ++-
> drivers/mtd/devices/Kconfig | 4 +-
> drivers/net/Kconfig | 6 +-
> drivers/net/wireless/Kconfig | 12 +-
> drivers/scsi/Kconfig | 4 +-
> drivers/video/Kconfig | 8 +-
> include/linux/input.h | 4 +
> include/linux/mod_devicetable.h | 1 +
> init/Kconfig | 16 ++-
> init/main.c | 6 +-
> lib/Kconfig.debug | 3 +
> net/ipv6/netfilter/Kconfig | 2 +-
> net/netfilter/Kconfig | 24 ++--
> net/tipc/Kconfig | 2 +-
> scripts/Makefile.modpost | 8 +-
> scripts/basic/fixdep.c | 2 +
> scripts/checksyscalls.sh | 118 ++++++++++++++++++++
> scripts/cleanfile | 126 ++++++++++++++++++++++
> scripts/cleanpatch | 206 ++++++++++++++++++++++++++++++++++++
> scripts/gen_initramfs_list.sh | 12 ++-
> scripts/kconfig/Makefile | 5 +-
> scripts/kconfig/conf.c | 1 +
> scripts/kconfig/lkc.h | 1 +
> scripts/kconfig/lxdialog/dialog.h | 1 +
> scripts/kconfig/lxdialog/util.c | 9 ++-
> scripts/kconfig/mconf.c | 43 ++++++--
> scripts/kconfig/menu.c | 2 +-
> scripts/kconfig/qconf.cc | 5 +-
> scripts/kconfig/qconf.h | 2 +-
> scripts/mkcompile_h | 27 ++++--
> scripts/mkuboot.sh | 2 +-
> scripts/mod/file2alias.c | 21 ++--
> scripts/mod/modpost.c | 141 +++++++++++++++++++------
> scripts/mod/modpost.h | 1 +
> scripts/mod/sumversion.c | 5 +-
> usr/Kconfig | 2 +-
> 40 files changed, 735 insertions(+), 137 deletions(-)
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/

2007-05-06 07:39:45

by Sam Ravnborg

[permalink] [raw]
Subject: kconfig: error out if recursive dependencies are found


Sample:
config FOO
bool "This is foo"
depends on BAR

config BAR
bool "This is bar"
depends on FOO

This will result in following error message:
error: found recursive dependency: FOO -> BAR -> FOO

And will then exit with exit code equal 1 so make will stop.
Inspired by patch from: Adrian Bunk <[email protected]>

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Adrian Bunk <[email protected]>
Cc: Roman Zippel <[email protected]>
---
scripts/kconfig/symbol.c | 13 +++++--------
scripts/kconfig/zconf.tab.c_shipped | 6 ++++--
scripts/kconfig/zconf.y | 6 ++++--
3 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index 8f06c47..c35dcc5 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -786,13 +786,15 @@ static struct symbol *sym_check_expr_deps(struct expr *e)
return NULL;
}

+/* return NULL when dependencies are OK */
struct symbol *sym_check_deps(struct symbol *sym)
{
struct symbol *sym2;
struct property *prop;

if (sym->flags & SYMBOL_CHECK) {
- printf("Warning! Found recursive dependency: %s", sym->name);
+ fprintf(stderr, "%s:%d:error: found recursive dependency: %s",
+ sym->prop->file->name, sym->prop->lineno, sym->name);
return sym;
}
if (sym->flags & SYMBOL_CHECKED)
@@ -816,13 +818,8 @@ struct symbol *sym_check_deps(struct symbol *sym)
goto out;
}
out:
- if (sym2) {
- printf(" %s", sym->name);
- if (sym2 == sym) {
- printf("\n");
- sym2 = NULL;
- }
- }
+ if (sym2)
+ fprintf(stderr, " -> %s%s", sym->name, sym2 == sym? "\n": "");
sym->flags &= ~SYMBOL_CHECK;
return sym2;
}
diff --git a/scripts/kconfig/zconf.tab.c_shipped b/scripts/kconfig/zconf.tab.c_shipped
index d777fe8..9a06b67 100644
--- a/scripts/kconfig/zconf.tab.c_shipped
+++ b/scripts/kconfig/zconf.tab.c_shipped
@@ -2132,9 +2132,11 @@ void conf_parse(const char *name)
}
menu_finalize(&rootmenu);
for_all_symbols(i, sym) {
- sym_check_deps(sym);
+ if (sym_check_deps(sym))
+ zconfnerrs++;
}
-
+ if (zconfnerrs)
+ exit(1);
sym_set_change_count(1);
}

diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
index 04a5864..92eb02b 100644
--- a/scripts/kconfig/zconf.y
+++ b/scripts/kconfig/zconf.y
@@ -501,9 +501,11 @@ void conf_parse(const char *name)
}
menu_finalize(&rootmenu);
for_all_symbols(i, sym) {
- sym_check_deps(sym);
+ if (sym_check_deps(sym))
+ zconfnerrs++;
}
-
+ if (zconfnerrs)
+ exit(1);
sym_set_change_count(1);
}

--
1.5.1.rc3.20.gaa453

2007-05-06 07:41:23

by Sam Ravnborg

[permalink] [raw]
Subject: kbuild: enable use of code from a different dir

To introduce support for source in one directory but output files
in another directory during a non O= build prefix all paths
with $(src) repsectively $(obj).

Signed-off-by: Sam Ravnborg <[email protected]>
---
scripts/Makefile.build | 19 +++++++++----------
scripts/Makefile.host | 14 +++++++-------
2 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index e2ad2dc..a525112 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -131,13 +131,13 @@ $(multi-objs-y:.o=.lst) : modname = $(modname-multi)
quiet_cmd_cc_s_c = CC $(quiet_modtag) $@
cmd_cc_s_c = $(CC) $(c_flags) -fverbose-asm -S -o $@ $<

-%.s: %.c FORCE
+$(obj)/%.s: $(src)/%.c FORCE
$(call if_changed_dep,cc_s_c)

quiet_cmd_cc_i_c = CPP $(quiet_modtag) $@
cmd_cc_i_c = $(CPP) $(c_flags) -o $@ $<

-%.i: %.c FORCE
+$(obj)/%.i: $(src)/%.c FORCE
$(call if_changed_dep,cc_i_c)

quiet_cmd_cc_symtypes_c = SYM $(quiet_modtag) $@
@@ -146,7 +146,7 @@ cmd_cc_symtypes_c = \
| $(GENKSYMS) -T $@ >/dev/null; \
test -s $@ || rm -f $@

-%.symtypes : %.c FORCE
+$(obj)/%.symtypes : $(src)/%.c FORCE
$(call if_changed_dep,cc_symtypes_c)

# C (.c) files
@@ -198,14 +198,13 @@ define rule_cc_o_c
endef

# Built-in and composite module parts
-
-%.o: %.c FORCE
+$(obj)/%.o: $(src)/%.c FORCE
$(call cmd,force_checksrc)
$(call if_changed_rule,cc_o_c)

# Single-part modules are special since we need to mark them in $(MODVERDIR)

-$(single-used-m): %.o: %.c FORCE
+$(single-used-m): $(obj)/%.o: $(src)/%.c FORCE
$(call cmd,force_checksrc)
$(call if_changed_rule,cc_o_c)
@{ echo $(@:.o=.ko); echo $@; } > $(MODVERDIR)/$(@F:.o=.mod)
@@ -215,7 +214,7 @@ quiet_cmd_cc_lst_c = MKLST $@
$(CONFIG_SHELL) $(srctree)/scripts/makelst $*.o \
System.map $(OBJDUMP) > $@

-%.lst: %.c FORCE
+$(obj)/%.lst: $(src)/%.c FORCE
$(call if_changed_dep,cc_lst_c)

# Compile assembler sources (.S)
@@ -229,13 +228,13 @@ $(real-objs-m:.o=.s): modkern_aflags := $(AFLAGS_MODULE)
quiet_cmd_as_s_S = CPP $(quiet_modtag) $@
cmd_as_s_S = $(CPP) $(a_flags) -o $@ $<

-%.s: %.S FORCE
+$(obj)/%.s: $(src)/%.S FORCE
$(call if_changed_dep,as_s_S)

quiet_cmd_as_o_S = AS $(quiet_modtag) $@
cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $<

-%.o: %.S FORCE
+$(obj)/%.o: $(src)/%.S FORCE
$(call if_changed_dep,as_o_S)

targets += $(real-objs-y) $(real-objs-m) $(lib-y)
@@ -246,7 +245,7 @@ targets += $(extra-y) $(MAKECMDGOALS) $(always)
quiet_cmd_cpp_lds_S = LDS $@
cmd_cpp_lds_S = $(CPP) $(cpp_flags) -D__ASSEMBLY__ -o $@ $<

-%.lds: %.lds.S FORCE
+$(obj)/%.lds: $(src)/%.lds.S FORCE
$(call if_changed_dep,cpp_lds_S)

# Build the compiled-in targets
diff --git a/scripts/Makefile.host b/scripts/Makefile.host
index 575afbe..6943a7a 100644
--- a/scripts/Makefile.host
+++ b/scripts/Makefile.host
@@ -114,7 +114,7 @@ hostcxx_flags = -Wp,-MD,$(depfile) $(__hostcxx_flags)
quiet_cmd_host-csingle = HOSTCC $@
cmd_host-csingle = $(HOSTCC) $(hostc_flags) -o $@ $< \
$(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
-$(host-csingle): %: %.c FORCE
+$(host-csingle): $(obj)/%: $(src)/%.c FORCE
$(call if_changed_dep,host-csingle)

# Link an executable based on list of .o files, all plain c
@@ -123,14 +123,14 @@ quiet_cmd_host-cmulti = HOSTLD $@
cmd_host-cmulti = $(HOSTCC) $(HOSTLDFLAGS) -o $@ \
$(addprefix $(obj)/,$($(@F)-objs)) \
$(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
-$(host-cmulti): %: $(host-cobjs) $(host-cshlib) FORCE
+$(host-cmulti): $(obj)/%: $(host-cobjs) $(host-cshlib) FORCE
$(call if_changed,host-cmulti)

# Create .o file from a single .c file
# host-cobjs -> .o
quiet_cmd_host-cobjs = HOSTCC $@
cmd_host-cobjs = $(HOSTCC) $(hostc_flags) -c -o $@ $<
-$(host-cobjs): %.o: %.c FORCE
+$(host-cobjs): $(obj)/%.o: $(src)/%.c FORCE
$(call if_changed_dep,host-cobjs)

# Link an executable based on list of .o files, a mixture of .c and .cc
@@ -140,20 +140,20 @@ quiet_cmd_host-cxxmulti = HOSTLD $@
$(foreach o,objs cxxobjs,\
$(addprefix $(obj)/,$($(@F)-$(o)))) \
$(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
-$(host-cxxmulti): %: $(host-cobjs) $(host-cxxobjs) $(host-cshlib) FORCE
+$(host-cxxmulti): $(obj)/%: $(host-cobjs) $(host-cxxobjs) $(host-cshlib) FORCE
$(call if_changed,host-cxxmulti)

# Create .o file from a single .cc (C++) file
quiet_cmd_host-cxxobjs = HOSTCXX $@
cmd_host-cxxobjs = $(HOSTCXX) $(hostcxx_flags) -c -o $@ $<
-$(host-cxxobjs): %.o: %.cc FORCE
+$(host-cxxobjs): $(obj)/%.o: $(src)/%.cc FORCE
$(call if_changed_dep,host-cxxobjs)

# Compile .c file, create position independent .o file
# host-cshobjs -> .o
quiet_cmd_host-cshobjs = HOSTCC -fPIC $@
cmd_host-cshobjs = $(HOSTCC) $(hostc_flags) -fPIC -c -o $@ $<
-$(host-cshobjs): %.o: %.c FORCE
+$(host-cshobjs): $(obj)/%.o: $(src)/%.c FORCE
$(call if_changed_dep,host-cshobjs)

# Link a shared library, based on position independent .o files
@@ -162,7 +162,7 @@ quiet_cmd_host-cshlib = HOSTLLD -shared $@
cmd_host-cshlib = $(HOSTCC) $(HOSTLDFLAGS) -shared -o $@ \
$(addprefix $(obj)/,$($(@F:.so=-objs))) \
$(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
-$(host-cshlib): %: $(host-cshobjs) FORCE
+$(host-cshlib): $(obj)/%: $(host-cshobjs) FORCE
$(call if_changed,host-cshlib)

targets += $(host-csingle) $(host-cmulti) $(host-cobjs)\
--
1.5.1.rc3.20.gaa453

2007-05-06 07:42:38

by Sam Ravnborg

[permalink] [raw]
Subject: kconfig: fix mconf segmentation fault

I have found small bug in mconf, when you run it without any argument it
will sigsegv.

Without patch:
$ scripts/kconfig/mconf
Segmentation fault

With patch:
$ scripts/kconfig/mconf
can't find file (null)

Signed-off-by: Marcin Garski <[email protected]>
Signed-off-by: Sam Ravnborg <[email protected]>
---
scripts/kconfig/lex.zconf.c_shipped | 2 +-
scripts/kconfig/zconf.l | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/kconfig/lex.zconf.c_shipped b/scripts/kconfig/lex.zconf.c_shipped
index 800f8c7..0fdc904 100644
--- a/scripts/kconfig/lex.zconf.c_shipped
+++ b/scripts/kconfig/lex.zconf.c_shipped
@@ -2264,7 +2264,7 @@ FILE *zconf_fopen(const char *name)
FILE *f;

f = fopen(name, "r");
- if (!f && name[0] != '/') {
+ if (!f && name != NULL && name[0] != '/') {
env = getenv(SRCTREE);
if (env) {
sprintf(fullname, "%s/%s", env, name);
diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l
index cfa4607..187d38c 100644
--- a/scripts/kconfig/zconf.l
+++ b/scripts/kconfig/zconf.l
@@ -265,7 +265,7 @@ FILE *zconf_fopen(const char *name)
FILE *f;

f = fopen(name, "r");
- if (!f && name[0] != '/') {
+ if (!f && name != NULL && name[0] != '/') {
env = getenv(SRCTREE);
if (env) {
sprintf(fullname, "%s/%s", env, name);
--
1.5.1.rc3.20.gaa453

2007-05-07 00:38:44

by Roman Zippel

[permalink] [raw]
Subject: Re: kconfig: error out if recursive dependencies are found

Hi,

On Sun, 6 May 2007, Sam Ravnborg wrote:

> if (sym->flags & SYMBOL_CHECK) {
> - printf("Warning! Found recursive dependency: %s", sym->name);
> + fprintf(stderr, "%s:%d:error: found recursive dependency: %s",
> + sym->prop->file->name, sym->prop->lineno, sym->name);
> return sym;
> }

If it were that simple to print the location, I had done it already. :)
Try this:

config FOO
bool
select BAR
depends on BAR

config BAR
bool

I looked into this before, for simple properties one could just remember
the last checked property via a static variable. The problem are the
selects which are checked before that loop, here the information from
where they were selected is not available anymore (at least not easily).

bye, Roman

2007-05-07 19:36:16

by Sam Ravnborg

[permalink] [raw]
Subject: Re: kconfig: error out if recursive dependencies are found

On Mon, May 07, 2007 at 02:38:36AM +0200, Roman Zippel wrote:
> Hi,
>
> On Sun, 6 May 2007, Sam Ravnborg wrote:
>
> > if (sym->flags & SYMBOL_CHECK) {
> > - printf("Warning! Found recursive dependency: %s", sym->name);
> > + fprintf(stderr, "%s:%d:error: found recursive dependency: %s",
> > + sym->prop->file->name, sym->prop->lineno, sym->name);
> > return sym;
> > }
>
> If it were that simple to print the location, I had done it already. :)
> Try this:
>
> config FOO
> bool
> select BAR
> depends on BAR
>
> config BAR
> bool
>
> I looked into this before, for simple properties one could just remember
> the last checked property via a static variable. The problem are the
> selects which are checked before that loop, here the information from
> where they were selected is not available anymore (at least not easily).

We need to point out _one_ of the faulty spots only.
But I see that kconfig records file:line for properties and menu entries
but not for symbols.
Any special reason why file:line is omitted for symbols (except size of allocated
memory)?

Without looking into details it looks more relevant to have file:line for symbols
rather than for prompts / properties..

Sam

2007-05-07 22:03:59

by Roman Zippel

[permalink] [raw]
Subject: Re: kconfig: error out if recursive dependencies are found

Hi,

On Mon, 7 May 2007, Sam Ravnborg wrote:

> We need to point out _one_ of the faulty spots only.

The problem is you print only a random spot (which may not even be right
one) of one of the involved symbols.
We could actually print out the whole faulty chain, but it would require a
few changes, which might be useful to improve the select handling.

> But I see that kconfig records file:line for properties and menu entries
> but not for symbols.
> Any special reason why file:line is omitted for symbols (except size of allocated
> memory)?
>
> Without looking into details it looks more relevant to have file:line for symbols
> rather than for prompts / properties..

A symbol can have multiple entries. The "config" line is just the start
marker for the symbol information, which is the actual relevant part.

bye, Roman

2007-05-07 22:36:08

by Adrian Bunk

[permalink] [raw]
Subject: Re: kconfig: error out if recursive dependencies are found

On Mon, May 07, 2007 at 09:37:07PM +0200, Sam Ravnborg wrote:
> On Mon, May 07, 2007 at 02:38:36AM +0200, Roman Zippel wrote:
> > Hi,
> >
> > On Sun, 6 May 2007, Sam Ravnborg wrote:
> >
> > > if (sym->flags & SYMBOL_CHECK) {
> > > - printf("Warning! Found recursive dependency: %s", sym->name);
> > > + fprintf(stderr, "%s:%d:error: found recursive dependency: %s",
> > > + sym->prop->file->name, sym->prop->lineno, sym->name);
> > > return sym;
> > > }
> >
> > If it were that simple to print the location, I had done it already. :)
> > Try this:
> >
> > config FOO
> > bool
> > select BAR
> > depends on BAR
> >
> > config BAR
> > bool
> >
> > I looked into this before, for simple properties one could just remember
> > the last checked property via a static variable. The problem are the
> > selects which are checked before that loop, here the information from
> > where they were selected is not available anymore (at least not easily).
>
> We need to point out _one_ of the faulty spots only.
> But I see that kconfig records file:line for properties and menu entries
> but not for symbols.
> Any special reason why file:line is omitted for symbols (except size of allocated
> memory)?
>
> Without looking into details it looks more relevant to have file:line for symbols
> rather than for prompts / properties..

I'm not getting what problem you are trying to solve.

Kconfig has always printed all symbols in the dependency circle, and
with this information it was never a problem to locate what went wrong.

The only thing that was missing was that the error often wasn't detected
since it scroled away, so we need to error out.

I have no problem with more information being printed, but at least for
me it isn't required since grep'ing for it is trivial.

> Sam

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed