Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 May 2002 06:20:03 -0700 (PDT)
From:      Piet Honkoop <piet@wirehub.net>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: misc/37775: netsmb/smb_subr.c needs opt_global.h in SMP environment
Message-ID:  <200205071320.g47DK3P75891@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR misc/37775; it has been noted by GNATS.

From: Piet Honkoop <piet@wirehub.net>
To: Peter Pentchev <roam@ringlet.net>
Cc: dwmalone@FreeBSD.org, <bp@FreeBSD.org>,
	<bug-followup@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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200205071320.g47DK3P75891>