Re: Symbol problems with 2.4.0-test[456]

From: Mikael Pettersson (mikpe@csd.uu.se)
Date: Fri Aug 11 2000 - 18:36:53 EST


J. Robert von Behren wrote:

>I'm getting undefined symbols with net modules in test[456] (haven't
>tried earlier ones). The problem goes away if I turn off
>CONFIG_MODVERSIONS
> ...
>/lib/modules/2.4.0-test6/kernel/drivers/net/eepro100.o: unresolved
>symbol __const_udelay
> ...
>c01c2cf8 __const_udelay_R__ver___const_udelay

This is a known problem: the lack of sub-second resolution in
file modificaton times causes 'make dep' to sometimes fail to
build a correct <linux/modversions.h> file. You're not the first
to be bitten by this bug. (Search the last month's lkml archive
for subjects containing "CONFIG_MODVERSIONS" or "undefined symbols".)

Try the patch below and let us know if it fixes the problem for you.

/Mikael

(FYI, I'm sending this patch to Linus now so that we finally can
put a stop to this broken modversions.h nonsense.)

--- linux-2.4.0-test6/Makefile.~1~ Thu Aug 10 13:31:15 2000
+++ linux-2.4.0-test6/Makefile Thu Aug 10 14:26:46 2000
@@ -428,6 +428,9 @@
         scripts/mkdep init/*.c > .depend
         scripts/mkdep `find $(FINDHPATH) -name SCCS -prune -o -follow -name \*.h ! -name modversions.h -print` > .hdepend
         $(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS)) _FASTDEP_ALL_SUB_DIRS="$(SUBDIRS)"
+ifdef CONFIG_MODVERSIONS
+ $(MAKE) update-modverfile
+endif
 
 ifdef CONFIG_MODVERSIONS
 MODVERFILE := $(TOPDIR)/include/linux/modversions.h
@@ -436,7 +439,7 @@
 endif
 export MODVERFILE
 
-depend dep: dep-files $(MODVERFILE)
+depend dep: dep-files
 
 # make checkconfig: Prune 'scripts' directory to avoid "false positives".
 checkconfig:
--- linux-2.4.0-test6/Rules.make.~1~ Thu Aug 10 13:31:15 2000
+++ linux-2.4.0-test6/Rules.make Thu Aug 10 14:26:34 2000
@@ -208,8 +208,16 @@
         
 $(addprefix $(MODINCL)/,$(SYMTAB_OBJS:.o=.ver)): $(TOPDIR)/include/linux/autoconf.h
 
-$(TOPDIR)/include/linux/modversions.h: $(addprefix $(MODINCL)/,$(SYMTAB_OBJS:.o=.ver))
- @echo updating $(TOPDIR)/include/linux/modversions.h
+# updates .ver files but not modversions.h
+fastdep: $(addprefix $(MODINCL)/,$(SYMTAB_OBJS:.o=.ver))
+
+# updates .ver files and modversions.h like before (is this needed?)
+dep: fastdep update-modverfile
+
+endif # SYMTAB_OBJS
+
+# update modversions.h, but only if it would change
+update-modverfile:
         @(echo "#ifndef _LINUX_MODVERSIONS_H";\
           echo "#define _LINUX_MODVERSIONS_H"; \
           echo "#include <linux/modsetver.h>"; \
@@ -218,11 +226,14 @@
             if [ -f $$f ]; then echo "#include <linux/modules/$${f}>"; fi; \
           done; \
           echo "#endif"; \
- ) > $@
-
-dep fastdep: $(TOPDIR)/include/linux/modversions.h
-
-endif # SYMTAB_OBJS
+ ) > $(TOPDIR)/include/linux/modversions.h.tmp
+ @if [ -r $(TOPDIR)/include/linux/modversions.h ] && cmp -s $(TOPDIR)/include/linux/modversions.h $(TOPDIR)/include/linux/modversions.h.tmp; then \
+ echo $(TOPDIR)/include/linux/modversions.h was not updated; \
+ rm -f $(TOPDIR)/include/linux/modversions.h.tmp; \
+ else \
+ echo $(TOPDIR)/include/linux/modversions.h was updated; \
+ mv -f $(TOPDIR)/include/linux/modversions.h.tmp $(TOPDIR)/include/linux/modversions.h; \
+ fi
 
 $(M_OBJS): $(TOPDIR)/include/linux/modversions.h
 ifdef MAKING_MODULES

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Aug 15 2000 - 21:00:26 EST