Re: Unresolved symbols in 2.4.0-test5

From: Mikael Pettersson (mikpe@csd.uu.se)
Date: Sun Jul 30 2000 - 16:51:18 EST


BaRT <bart11@dingoblue.net.au> wrote:

>I am having this problem with 2.4.0-test5:
>
>[root@fathom /root]# depmod -ae
>depmod: *** Unresolved symbols in /lib/modules/2.4.0-test5/fs/fat.o
>depmod: strtok
>depmod: __generic_copy_to_user
>...
>cpu MHz : 877.894528

Definitely looks like a bite from the modversions.h-race bug.
See the recent "CONFIG_MODVERSIONS problem identified" thread
in lkml for an explanation of what's going on (on fast machines,
make dep may fail to properly build modversions.h, resulting
in the Unresolved symbols problem you had).

The patch below should fix the problem. Please try it out.

/Mikael

--- linux-2.4.0-test5/Makefile.~1~ Fri Jul 28 13:44:14 2000
+++ linux-2.4.0-test5/Makefile Fri Jul 28 14:09:39 2000
@@ -439,6 +439,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
@@ -447,7 +450,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-test5/Rules.make.~1~ Sat Jul 1 00:13:51 2000
+++ linux-2.4.0-test5/Rules.make Fri Jul 28 14:05:05 2000
@@ -215,8 +215,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>"; \
@@ -225,11 +233,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 : Mon Jul 31 2000 - 21:00:31 EST