From owner-freebsd-bugs Tue May 7 5:20:18 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 4170237B408 for ; Tue, 7 May 2002 05:20:03 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g47CK3l58722; Tue, 7 May 2002 05:20:03 -0700 (PDT) (envelope-from gnats) Date: Tue, 7 May 2002 05:20:03 -0700 (PDT) Message-Id: <200205071220.g47CK3l58722@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Peter Pentchev Subject: Re: misc/37775: netsmb/smb_subr.c needs opt_global.h in SMP environment Reply-To: Peter Pentchev 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: Peter Pentchev To: Piet Honkoop 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