From owner-freebsd-bugs Tue May 7 6:20:27 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 8E40F37B403 for ; Tue, 7 May 2002 06:20:03 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g47DK3P75891; Tue, 7 May 2002 06:20:03 -0700 (PDT) (envelope-from gnats) Date: Tue, 7 May 2002 06:20:03 -0700 (PDT) Message-Id: <200205071320.g47DK3P75891@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Piet Honkoop Subject: Re: misc/37775: netsmb/smb_subr.c needs opt_global.h in SMP environment Reply-To: Piet Honkoop Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR misc/37775; it has been noted by GNATS. From: Piet Honkoop To: Peter Pentchev Cc: dwmalone@FreeBSD.org, , Subject: Re: misc/37775: netsmb/smb_subr.c needs opt_global.h in SMP environment Date: Tue, 7 May 2002 15:09:51 +0100 (T) On Tue, 7 May 2002, Peter Pentchev wrote: > On Tue, May 07, 2002 at 12:56:46AM +0200, Piet Honkoop wrote: > > On Mon, 6 May 2002 dwmalone@FreeBSD.org wrote: > > > > > Synopsis: netsmb/smb_subr.c needs opt_global.h in SMP environment > > > > > > State-Changed-From-To: open->feedback > > > State-Changed-By: dwmalone > > > State-Changed-When: Mon May 6 11:23:05 PDT 2002 > > > State-Changed-Why: > > > Boris suggests that this is a more general problem and that the > > > best thing to do is compile smbfs into the kernel. (See the > > > PR audit trail for his full message). > > > > > > > Can imagine that because compiling into the kernel does produce a working > > situation. Looking further into the situation, the logic seems to be that > > the kernel compilation process uses (together with a hurdle of other > > options): -D_KERNEL -include opt_global.h > > whereas modules only use: -D_KERNEL > > which would explain why opt_global.h is not included in the module. > > Does this mean there is an omission in kmod.mk? (grep -r through /usr/sys > > does bring you somewhere...) > > Not really, at least IMHO; as far as I can understand, opt_global.h > is generated by config(8) as part of the parsing of the kernel config > file. Modules are built independently, not tied in with any config file; > thus, a module should not depend on, or use at all, any files, header > or otherwise, generated as part of the config(8) run. > I agree a module should be built independently. But if the module code depends on a *choice* the sysop makes in his/her kernel config file then the module should also access the generated .h files from that config file. Or the dependency should be removed. > As a matter of fact, I believe that modules are even built in separate > directories, so opt_global.h is not even in the CWD, and the error > generated by adding '-include opt_global.h' to CFLAGS would serve > no useful purpose at all :) > > The correct way to build a module with SMP support would be something like: > Agreed. But as it is now, there is a significant difference in building the module as options smbfs or as a separate module. And the way I understand the module system, they should be equivalent. Right? Ciao, Piet > # cd /usr/src/sys/modules/netsmb > # make cleandir && make cleandir > # make CFLAGS=-DSMP depend > # make CFLAGS=-DSMP all install > > G'luck, > Peter > > -- ========================================================================= Wirehub! Internet BV tel. +31 10 2448344 Westzeedijk 487 fax. +31 10 2448300 3024 EL Rotterdam http://www.wirehub.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message