Date: Tue, 7 May 2002 05:20:03 -0700 (PDT) From: Peter Pentchev <roam@ringlet.net> To: freebsd-bugs@FreeBSD.org Subject: Re: misc/37775: netsmb/smb_subr.c needs opt_global.h in SMP environment Message-ID: <200205071220.g47CK3l58722@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: Peter Pentchev <roam@ringlet.net> To: Piet Honkoop <piet@wirehub.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:10:51 +0300 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. 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: # cd /usr/src/sys/modules/netsmb # make cleandir && make cleandir # make CFLAGS=-DSMP depend # make CFLAGS=-DSMP all install G'luck, Peter -- Peter Pentchev roam@ringlet.net roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 Thit sentence is not self-referential because "thit" is not a word. 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?200205071220.g47CK3l58722>