Messages in this thread Patch in this message |  | | Date | Wed, 23 Aug 2000 15:02:55 -0400 | From | I Lee Hetherington <> | Subject | Re: __generic_copy_from_user question |
| |
You probably have CONFIG_MODVERSIONS enabled and i386_ksyms.ver probably didn't make it into include/linux/modversions.h due to a race in make (not even a parallel make).
I've been using the attached patch with good luck in 2.4 and 2.2 to get around this. Before using this patch, about 2/3 of the time modversions.h was not correctly constructed, and I would get insmod problems.
--Lee Hetherington
>From - Fri Jul 28 09:20:46 2000 Return-Path: <owner-linux-kernel-outgoing@vger.rutgers.edu> Received: from sls.lcs.mit.edu (sls [18.27.0.167]) by golden-bear.lcs.mit.edu (8.9.3/8.9.3) with ESMTP id SAA19688 for <ilh@golden-bear.lcs.mit.edu>; Thu, 27 Jul 2000 18:17:20 -0400 (EDT) Received: from nic.funet.fi (nic.funet.fi [193.166.0.145]) by sls.lcs.mit.edu (8.9.3/8.9.3) with ESMTP id SAA24997 for <ilh@sls.lcs.mit.edu>; Thu, 27 Jul 2000 18:17:16 -0400 (EDT) Received: from vger.rutgers.edu ([128.6.190.2]:12055 "EHLO vger.rutgers.edu" ident: "NO-IDENT-SERVICE[2]" smtp-auth: <none> TLS-CIPHER: <none>) by nic.funet.fi with ESMTP id <S31272AbQG0WQw>; Fri, 28 Jul 2000 01:16:52 +0300 Received: (majordomo@vger.rutgers.edu) by vger.rutgers.edu via listexpand id <S160470AbQG0Vvr>; Thu, 27 Jul 2000 17:51:47 -0400 Received: by vger.rutgers.edu id <S157628AbQG0VuW>; Thu, 27 Jul 2000 17:50:22 -0400 Received: from harpo.it.uu.se ([130.238.12.34]:53536 "EHLO harpo.it.uu.se") by vger.rutgers.edu with ESMTP id <S160318AbQG0Vtf>; Thu, 27 Jul 2000 17:49:35 -0400 Received: (from mikpe@localhost) by harpo.it.uu.se (8.8.5/8.8.5) id AAA18357; Fri, 28 Jul 2000 00:06:55 +0200 (MET DST) Date: Fri, 28 Jul 2000 00:06:55 +0200 (MET DST) From: Mikael Pettersson <mikpe@csd.uu.se> Message-Id: <200007272206.AAA18357@harpo.it.uu.se> To: linux-kernel@vger.rutgers.edu Subject: Re: CONFIG_MODVERSIONS problem identified Cc: torvalds@transmeta.com Sender: owner-linux-kernel@vger.rutgers.edu Precedence: bulk X-Loop: majordomo@vger.rutgers.edu
Andreas Schwab and Russel King noted some problems with my first patch for the modversions.h problem: it wouldn't work with parallel makes (due to assuming make executes dependencies left-to-right), and it could cause excessive recompilations (due to always updating modversions.h).
Here's Version 2 of the patch which I think addresses all of the issues raised. In particular: - sequencing is expressed by shell commands - update-modverfile does the update via a temporary file, and only touches modversions.h if it actually changed This version has survived numerous 'make -j dep' on UP.
I didn't use a .PHONY: on modversions.h as Russel suggested, since that would cause re-execution of that rule whenever a target depends on modversions.h via some .{h,}depend file.
A question: Rules.make has a goal 'dep' which does the same thing as 'fastdep', however, 'fastdep' is what the top-level Makefile's 'dep' invokes. What's Rules.make's 'dep' for?
/Mikael
--- linux-2.4.0-test5-pre6/Makefile.~1~ Thu Jul 27 21:36:59 2000 +++ linux-2.4.0-test5-pre6/Makefile Thu Jul 27 21:37:24 2000 @@ -437,6 +437,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 @@ -445,7 +448,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-pre6/Rules.make.~1~ Sat Jul 1 00:13:51 2000 +++ linux-2.4.0-test5-pre6/Rules.make Thu Jul 27 22:46:54 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/
|  |