problem in building modules-with-world re: cvs commit:src/sys/netinet ip_fw_pfil.c

Ruslan Ermilov ru at FreeBSD.org
Fri Aug 20 15:27:05 PDT 2004


On Fri, Aug 20, 2004 at 11:43:21PM +0200, Andre Oppermann wrote:
> Ruslan Ermilov wrote:
> > > > > I have just cvsupped -current and the GENERIC kernel compiles just fine.
> > > > >
> > > > > Looking at the error message in your log output one might conclude that you
> > > > > are missing "option INET" in your kernel config?
> > > >
> > > > MODULES_WITH_WORLD
> > > >
> > > > Please read the subject line.  ;)
> > >
> > > Ok, there seems to be a problem with setting up the environment when doing
> > > this.  Why do you build modules with WORLD instead of doing it with the
> > > kernel?  This sounds quite dangerous to me when kernel/modules go out of
> > > sync.
> > >
> > > Ruslan, do you have any idea what is going wrong?
> > >
> > Yes.  You removed far too much in your conversion.  ;)
> 
> Yes and no.  The goal was to get a ipfw module that can have IPDIVERT
> (requires kernel to have it too) and IPFIREWALL_FORWARD (kernel doesn't
> matter, just won't work if kernel doesn't have it) in it.  When building
> the modules together with the kernel it works because the opt_* files
> are around.  This doesn't seem to be the case when building it with
> world.  Isn't there some #define when it is compiled with world?
> 
No, there is not.  When modules are built outside of the kernel,
you never know which kernel it will be linked with at run time.
Since you don't know if a kernel will have IPDIVERT support or
not, you cannot deliberately compile a module with -DIPDIVERT in
CFLAGS.  (When compiling with a kernel, it's not a problem -- you
get the necessary information from opt_ipdivert.h.)  I'd say, put
the another commented out line to modules/ipfw/Makefile:

#CFLAGS+= -DIPDIVERT

The existing ones are here for the MODULES_WITH_WORLD and standalone
build cases, decoupled from the kernel build.


Cheers,
-- 
Ruslan Ermilov
ru at FreeBSD.org
FreeBSD committer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-src/attachments/20040821/5371ab98/attachment.bin


More information about the cvs-src mailing list